mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-13 07:00:10 +01:00
49 lines
1.4 KiB
Java
49 lines
1.4 KiB
Java
package com.simplemobiletools.notes;
|
|
|
|
import android.content.Context;
|
|
import android.content.SharedPreferences;
|
|
|
|
public class Config {
|
|
private SharedPreferences mPrefs;
|
|
|
|
public static Config newInstance(Context context) {
|
|
return new Config(context);
|
|
}
|
|
|
|
public Config(Context context) {
|
|
mPrefs = context.getSharedPreferences(Constants.PREFS_KEY, Context.MODE_PRIVATE);
|
|
}
|
|
|
|
public boolean getIsFirstRun() {
|
|
return mPrefs.getBoolean(Constants.IS_FIRST_RUN, true);
|
|
}
|
|
|
|
public void setIsFirstRun(boolean firstRun) {
|
|
mPrefs.edit().putBoolean(Constants.IS_FIRST_RUN, firstRun).apply();
|
|
}
|
|
|
|
public boolean getIsDarkTheme() {
|
|
return mPrefs.getBoolean(Constants.IS_DARK_THEME, false);
|
|
}
|
|
|
|
public void setIsDarkTheme(boolean isDarkTheme) {
|
|
mPrefs.edit().putBoolean(Constants.IS_DARK_THEME, isDarkTheme).apply();
|
|
}
|
|
|
|
public boolean getIsAutosaveEnabled() {
|
|
return mPrefs.getBoolean(Constants.AUTOSAVE, false);
|
|
}
|
|
|
|
public void setIsAutosaveEnabled(boolean enabled) {
|
|
mPrefs.edit().putBoolean(Constants.AUTOSAVE, enabled).apply();
|
|
}
|
|
|
|
public boolean getShouldPromptAutosave() {
|
|
return mPrefs.getBoolean(Constants.PROMPT_AUTOSAVE, true);
|
|
}
|
|
|
|
public void setShouldPromptAutosave(boolean prompt) {
|
|
mPrefs.edit().putBoolean(Constants.PROMPT_AUTOSAVE, prompt).apply();
|
|
}
|
|
}
|