fix: remember selected kbd

This commit is contained in:
Yuriy Liskov
2018-07-18 14:29:08 +03:00
parent a1f7c7959a
commit c16cc2525a
23 changed files with 92 additions and 36 deletions

View File

@@ -7,6 +7,7 @@ import android.preference.PreferenceManager;
public final class LeanKeyPreferences {
private static final String APP_RUN_ONCE = "appRunOnce";
private static final String BOOTSTRAP_SELECTED_LANGUAGE = "bootstrapSelectedLanguage";
private static final String APP_KEYBOARD_INDEX = "appKeyboardIndex";
private static LeanKeyPreferences sInstance;
private final Context mContext;
private SharedPreferences mPrefs;
@@ -42,4 +43,15 @@ public final class LeanKeyPreferences {
String name = mPrefs.getString(BOOTSTRAP_SELECTED_LANGUAGE, "");
return name;
}
public int getKeyboardIndex() {
int idx = mPrefs.getInt(APP_KEYBOARD_INDEX, 0);
return idx;
}
public void setKeyboardIndex(int idx) {
mPrefs.edit()
.putInt(APP_KEYBOARD_INDEX, idx)
.apply();
}
}