mirror of
https://github.com/yuliskov/LeanKeyboard.git
synced 2026-05-02 21:02:37 -04:00
fix: remember selected kbd
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user