Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an incorrect settings reset on startup #101

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/io/github/sspanak/tt9/ime/TraditionalT9.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ public static Context getMainContext() {
private void loadPreferences() {
mLanguage = LanguageCollection.getLanguage(prefs.getInputLanguage());
mEnabledLanguages = prefs.getEnabledLanguages();
validateLanguages();

mInputMode = InputMode.getInstance(prefs.getInputMode());
mInputMode = InputModeValidator.validateMode(prefs, mInputMode, allowedInputModes);

InputModeValidator.validateTextCase(prefs, mInputMode, prefs.getTextCase());
mInputMode.setTextCase(prefs.getTextCase());
}


Expand All @@ -69,10 +65,17 @@ protected void onInit() {


protected void onRestart(EditorInfo inputField) {
// determine the valid state for the current input field and preferences
mEnabledLanguages = prefs.getEnabledLanguages(); // in case we are back from Preferences screen, update the language list
// in case we are back from Preferences screen, update the language list
mEnabledLanguages = prefs.getEnabledLanguages();
validateLanguages();

// some input fields support only numbers or do not accept predictions
determineAllowedInputModes(inputField);
determineNextTextCase(); // Only in some modes. If they support it, let's overwrite the default.
mInputMode = InputModeValidator.validateMode(prefs, mInputMode, allowedInputModes);

// Some modes may want to change the default text case based on grammar rules.
determineNextTextCase();
InputModeValidator.validateTextCase(prefs, mInputMode, prefs.getTextCase());

// build the UI
clearSuggestions();
Expand Down