From 2a13ae186a7fee142c20939255f90de8f994f5f4 Mon Sep 17 00:00:00 2001 From: Helium314 Date: Wed, 6 Mar 2024 21:29:11 +0100 Subject: [PATCH] avoid immediate switch to other app when language key switches both layouts and keyboard apps --- app/src/main/java/helium314/keyboard/latin/LatinIME.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/latin/LatinIME.java b/app/src/main/java/helium314/keyboard/latin/LatinIME.java index 844f48049..64d2382c7 100644 --- a/app/src/main/java/helium314/keyboard/latin/LatinIME.java +++ b/app/src/main/java/helium314/keyboard/latin/LatinIME.java @@ -526,7 +526,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final class SubtypeState { private InputMethodSubtype mLastActiveSubtype; - private boolean mCurrentSubtypeHasBeenUsed; + private boolean mCurrentSubtypeHasBeenUsed = true; // starting with true avoids immediate switch public void setCurrentSubtypeHasBeenUsed() { mCurrentSubtypeHasBeenUsed = true; @@ -1477,13 +1477,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } if (shouldSwitchToOtherInputMethods()) { final InputMethodSubtype nextSubtype = mRichImm.getNextSubtypeInThisIme(false); - // todo (later): this will switch IME if we are at the end of the list, but ideally we - // want to switch IME only if all internal subtypes are unused - // -> need to store used/unused subtypes in mSubtypeState if (nextSubtype != null) { switchToSubtype(nextSubtype); return; - } else if (switchInputMethod()){ + } else if (switchInputMethod()) { return; } }