mirror of
https://github.com/FossifyOrg/Camera.git
synced 2026-06-13 02:26:40 -04:00
some refactoring, no real functionality change
This commit is contained in:
@@ -4,29 +4,29 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
public class Config {
|
||||
private SharedPreferences prefs;
|
||||
private SharedPreferences mPrefs;
|
||||
|
||||
public static Config newInstance(Context context) {
|
||||
return new Config(context);
|
||||
}
|
||||
|
||||
public Config(Context context) {
|
||||
prefs = context.getSharedPreferences(Constants.PREFS_KEY, Context.MODE_PRIVATE);
|
||||
mPrefs = context.getSharedPreferences(Constants.PREFS_KEY, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public boolean getLongTapEnabled() {
|
||||
return prefs.getBoolean(Constants.LONG_TAP, true);
|
||||
return mPrefs.getBoolean(Constants.LONG_TAP, true);
|
||||
}
|
||||
|
||||
public void setLongTapEnabled(boolean enabled) {
|
||||
prefs.edit().putBoolean(Constants.LONG_TAP, enabled).apply();
|
||||
mPrefs.edit().putBoolean(Constants.LONG_TAP, enabled).apply();
|
||||
}
|
||||
|
||||
public boolean getFocusBeforeCaptureEnabled() {
|
||||
return prefs.getBoolean(Constants.FOCUS_BEFORE_CAPTURE, false);
|
||||
return mPrefs.getBoolean(Constants.FOCUS_BEFORE_CAPTURE, false);
|
||||
}
|
||||
|
||||
public void setFocusBeforeCaptureEnabled(boolean enabled) {
|
||||
prefs.edit().putBoolean(Constants.FOCUS_BEFORE_CAPTURE, enabled).apply();
|
||||
mPrefs.edit().putBoolean(Constants.FOCUS_BEFORE_CAPTURE, enabled).apply();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user