mirror of
https://github.com/yuliskov/LeanKeyboard.git
synced 2026-05-02 21:02:37 -04:00
improve rus translation
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.liskovsoft.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
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 LeanKeyPreferences sInstance;
|
||||
private final Context mContext;
|
||||
private SharedPreferences mPrefs;
|
||||
|
||||
public static LeanKeyPreferences instance(Context ctx) {
|
||||
if (sInstance == null)
|
||||
sInstance = new LeanKeyPreferences(ctx);
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public LeanKeyPreferences(Context context) {
|
||||
mContext = context.getApplicationContext();
|
||||
mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
|
||||
}
|
||||
|
||||
public boolean isRunOnce() {
|
||||
return mPrefs.getBoolean(APP_RUN_ONCE, false);
|
||||
}
|
||||
|
||||
public void setRunOnce(boolean runOnce) {
|
||||
mPrefs.edit()
|
||||
.putBoolean(APP_RUN_ONCE, runOnce)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public void setPreferredLanguage(String name) {
|
||||
mPrefs.edit()
|
||||
.putString(BOOTSTRAP_SELECTED_LANGUAGE, name)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public String getPreferredLanguage() {
|
||||
String name = mPrefs.getString(BOOTSTRAP_SELECTED_LANGUAGE, "");
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user