aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-04-08 15:14:50 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-04-08 15:14:50 +0000
commite65944ceb0207044081cc94220c2ba2a53673c74 (patch)
tree380147d08ad5682b459fcae01b6dde9e47cf59e6 /app/src/main/java
parent270f891761cfcdf1266b0cceb629022b7e498216 (diff)
downloadinfinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.tar
infinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.tar.gz
infinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.tar.bz2
infinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.tar.lz
infinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.tar.xz
infinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.tar.zst
infinity-for-reddit-e65944ceb0207044081cc94220c2ba2a53673c74.zip
Don't reset disable nsfw forever option when resetting all settings.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java
index 2f07f10b..f133863d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java
@@ -258,10 +258,15 @@ public class AdvancedPreferenceFragment extends PreferenceFragmentCompat {
.setTitle(R.string.are_you_sure)
.setPositiveButton(R.string.yes, (dialogInterface, i)
-> {
+ boolean disableNsfwForever = mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false);
mSharedPreferences.edit().clear().apply();
mainActivityTabsSharedPreferences.edit().clear().apply();
nsfwAndBlurringSharedPreferences.edit().clear().apply();
+ if (disableNsfwForever) {
+ mSharedPreferences.edit().putBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, true).apply();
+ }
+
Toast.makeText(activity, R.string.reset_all_settings_success, Toast.LENGTH_SHORT).show();
EventBus.getDefault().post(new RecreateActivityEvent());
})