49 lines
1.3 KiB
Java

package com.simplemobiletools.filemanager;
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 getShowHidden() {
return mPrefs.getBoolean(Constants.SHOW_HIDDEN, false);
}
public void setShowHidden(boolean show) {
mPrefs.edit().putBoolean(Constants.SHOW_HIDDEN, show).apply();
}
public boolean getShowFullPath() {
return mPrefs.getBoolean(Constants.SHOW_FULL_PATH, false);
}
public void setShowFullPath(boolean show) {
mPrefs.edit().putBoolean(Constants.SHOW_FULL_PATH, show).apply();
}
}