Settings upgrade (#1325)

Re-implement most of the settings in compose, searchable
Languages & Layouts, Colors, and Personal Dictionary still missing, will be done later
This commit is contained in:
Helium314 2025-02-09 13:27:55 +01:00 committed by GitHub
parent 679754bb2d
commit e845e38e42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 4708 additions and 24 deletions

View file

@ -73,7 +73,6 @@ import helium314.keyboard.latin.inputlogic.InputLogic;
import helium314.keyboard.latin.permissions.PermissionsManager;
import helium314.keyboard.latin.personalization.PersonalizationHelper;
import helium314.keyboard.latin.settings.Settings;
import helium314.keyboard.latin.settings.SettingsActivity;
import helium314.keyboard.latin.settings.SettingsValues;
import helium314.keyboard.latin.suggestions.SuggestionStripView;
import helium314.keyboard.latin.suggestions.SuggestionStripViewAccessor;
@ -89,6 +88,8 @@ import helium314.keyboard.latin.utils.StatsUtilsManager;
import helium314.keyboard.latin.utils.SubtypeLocaleUtils;
import helium314.keyboard.latin.utils.SubtypeSettingsKt;
import helium314.keyboard.latin.utils.ViewLayoutUtils;
import helium314.keyboard.settings.SettingsActivity;
import helium314.keyboard.settings.SettingsActivityKt;
import kotlin.collections.CollectionsKt;
import java.io.FileDescriptor;
@ -900,6 +901,8 @@ 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.
@ -1976,4 +1979,13 @@ 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;
}
}
}