better way of force-reloading the keyboard theme

not duplicating an existing mechanism any more
and working while keyboard is shown (at least it looks like it)
This commit is contained in:
Helium314 2025-03-01 17:06:49 +01:00
parent f0bb541b72
commit 95b6333bf4
19 changed files with 86 additions and 80 deletions

View file

@ -89,7 +89,6 @@ import helium314.keyboard.latin.utils.SubtypeLocaleUtils;
import helium314.keyboard.latin.utils.SubtypeSettings;
import helium314.keyboard.latin.utils.ViewLayoutUtils;
import helium314.keyboard.settings.SettingsActivity;
import helium314.keyboard.settings.SettingsActivityKt;
import kotlin.collections.CollectionsKt;
import java.io.FileDescriptor;
@ -899,8 +898,6 @@ public class LatinIME extends InputMethodService implements
void onStartInputViewInternal(final EditorInfo editorInfo, final boolean restarting) {
super.onStartInputView(editorInfo, restarting);
reloadIfNecessary();
mDictionaryFacilitator.onStartInput();
// Switch to the null consumer to handle cases leading to early exit below, for which we
// also wouldn't be consuming gesture data.
@ -1975,13 +1972,4 @@ public class LatinIME extends InputMethodService implements
// deallocateMemory always called on hiding, and should not be called when showing
}
}
private void reloadIfNecessary() {
// better do the reload when showing the keyboard next time, and not on settings change
if (SettingsActivityKt.keyboardNeedsReload) {
KeyboardLayoutSet.onKeyboardThemeChanged();
mKeyboardSwitcher.forceUpdateKeyboardTheme(mDisplayContext);
SettingsActivityKt.keyboardNeedsReload = false;
}
}
}