diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVKeyboardSettingsActivity.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVKeyboardSettingsActivity.java index aa16529f67..592ce72c29 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVKeyboardSettingsActivity.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVKeyboardSettingsActivity.java @@ -182,8 +182,8 @@ public final class FVKeyboardSettingsActivity extends AppCompatActivity { // The following two layouts/toggles will need to link with these objects. Context appContext = this.getApplicationContext(); prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE); - boolean mayPredict = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(lgCode), true); - boolean mayCorrect = prefs.getBoolean(KMManager.getLanguageCorrectionPreferenceKey(lgCode), true); + boolean mayPredict = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(lgCode), false); + boolean mayCorrect = prefs.getBoolean(KMManager.getLanguageCorrectionPreferenceKey(lgCode), false); layout = (RelativeLayout)findViewById(R.id.corrections_toggle); diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java index c232bf19be..f0f1afcf8e 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java @@ -2,6 +2,7 @@ package com.firstvoices.keyboards; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -254,13 +255,21 @@ public class MainActivity extends AppCompatActivity implements OnKeyboardDownloa KMManager.KMDefault_LanguageID; boolean matchingModel = false; + SharedPreferences prefs = context.getSharedPreferences(context.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE); + SharedPreferences.Editor editor = prefs.edit(); + for(int i=0; ilexicalModelInfo = new HashMap<>(lexicalModelsInstalled.get(i)); if(lexicalModelInfo.get(KMManager.KMKey_LanguageID).equals(langId)) { matchingModel = true; } KMManager.addLexicalModel(this, lexicalModelInfo); + + // Enable predictions and corrections toggles + editor.putBoolean(KMManager.getLanguagePredictionPreferenceKey(lexicalModelInfo.get(KMManager.KMKey_LanguageID)), true); + editor.putBoolean(KMManager.getLanguageCorrectionPreferenceKey(lexicalModelInfo.get(KMManager.KMKey_LanguageID)), true); } + editor.commit(); // We're on the main thread, so if the active keyboard's language code matches, // let's register the associated lexical model.