|
|
|
@ -51,17 +51,16 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
private SwitchCompat swAuthentication;
|
|
|
|
|
private SwitchCompat swParanoid;
|
|
|
|
|
private TextView tvParanoidHint;
|
|
|
|
|
private SwitchCompat swCacheLists;
|
|
|
|
|
private TextView tvCacheListsHint;
|
|
|
|
|
private SwitchCompat swWatchdog;
|
|
|
|
|
private SwitchCompat swUpdates;
|
|
|
|
|
private SwitchCompat swCrashReports;
|
|
|
|
|
private SwitchCompat swDebug;
|
|
|
|
|
|
|
|
|
|
private TextView tvMemoryClass;
|
|
|
|
|
private TextView tvLastCleanup;
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
|
"badge", "subscriptions", "subscribed_only", "english", "authentication", "paranoid", "cache_lists", "watchdog", "updates", "crash_reports", "debug"
|
|
|
|
|
"badge", "subscriptions", "subscribed_only", "english", "authentication", "paranoid", "watchdog", "updates", "crash_reports", "debug"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_QUESTIONS = new String[]{
|
|
|
|
@ -85,13 +84,12 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
swAuthentication = view.findViewById(R.id.swAuthentication);
|
|
|
|
|
swParanoid = view.findViewById(R.id.swParanoid);
|
|
|
|
|
tvParanoidHint = view.findViewById(R.id.tvParanoidHint);
|
|
|
|
|
swCacheLists = view.findViewById(R.id.swCacheLists);
|
|
|
|
|
tvCacheListsHint = view.findViewById(R.id.tvCacheListsHint);
|
|
|
|
|
swWatchdog = view.findViewById(R.id.swWatchdog);
|
|
|
|
|
swUpdates = view.findViewById(R.id.swUpdates);
|
|
|
|
|
swCrashReports = view.findViewById(R.id.swCrashReports);
|
|
|
|
|
swDebug = view.findViewById(R.id.swDebug);
|
|
|
|
|
|
|
|
|
|
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
|
|
|
|
|
tvLastCleanup = view.findViewById(R.id.tvLastCleanup);
|
|
|
|
|
|
|
|
|
|
setOptions();
|
|
|
|
@ -158,13 +156,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swCacheLists.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
prefs.edit().putBoolean("cache_lists", checked).apply();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
swWatchdog.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
@ -256,7 +247,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
swEnglish.setChecked(prefs.getBoolean("english", false));
|
|
|
|
|
swAuthentication.setChecked(prefs.getBoolean("authentication", false));
|
|
|
|
|
swParanoid.setChecked(prefs.getBoolean("paranoid", true));
|
|
|
|
|
swCacheLists.setChecked(prefs.getBoolean("cache_lists", true));
|
|
|
|
|
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
|
|
|
|
|
swUpdates.setChecked(prefs.getBoolean("updates", true));
|
|
|
|
|
swUpdates.setVisibility(Helper.isPlayStoreInstall(getContext()) ? View.GONE : View.VISIBLE);
|
|
|
|
@ -265,8 +255,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
|
|
|
|
|
ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
|
|
|
|
|
int class_mb = am.getMemoryClass();
|
|
|
|
|
|
|
|
|
|
tvCacheListsHint.setText(getString(R.string.title_advanced_cache_list_hint, class_mb + " MB"));
|
|
|
|
|
tvMemoryClass.setText(getString(R.string.title_advanced_memory_class, class_mb + " MB"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setLastCleanup(long time) {
|
|
|
|
|