From 1882092c7c12308bfd4c069c440de05541ed44a0 Mon Sep 17 00:00:00 2001 From: "Kholmatov B." <21.sfrvn@gmail.com> Date: Tue, 26 May 2026 04:38:55 +0500 Subject: [PATCH] fix(settings): always show language switch key when toggle is on The 'Language switch key' toggle silently had no effect when only a single subtype was enabled, because isLanguageSwitchKeyEnabled() gated visibility on the *behavior* preference (internal / input_method / both). For the default 'internal' behavior, the key was hidden whenever the user had a single LeanType subtype, which is the common case. The behavior preference should only decide what tapping the key does, not whether the key is rendered. With this fix, the key is shown whenever the user explicitly enables the toggle and there is anything to switch to (any other subtype in this IME or any other enabled IME). --- .../keyboard/latin/settings/SettingsValues.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java b/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java index 4c2a3d34..8aabf8d4 100644 --- a/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java +++ b/app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java @@ -460,13 +460,10 @@ public boolean isLanguageSwitchKeyEnabled() { if (!mShowsLanguageSwitchKey) { return false; } + // The behavior preference (mLanguageSwitchKeyToOtherImes / mLanguageSwitchKeyToOtherSubtypes) + // only controls what tapping the key does — it must not gate visibility, otherwise the + // toggle silently has no effect for users with a single enabled subtype (the common case). final RichInputMethodManager imm = RichInputMethodManager.getInstance(); - if (!mLanguageSwitchKeyToOtherSubtypes) { - return imm.hasMultipleEnabledIMEsOrSubtypes(false /* include aux subtypes */); - } - if (!mLanguageSwitchKeyToOtherImes) { - return imm.hasMultipleEnabledSubtypesInThisIme(false /* include aux subtypes */); - } return imm.hasMultipleEnabledSubtypesInThisIme(false /* include aux subtypes */) || imm.hasMultipleEnabledIMEsOrSubtypes(false /* include aux subtypes */); }