diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-21 04:23:13 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-21 04:23:13 +0000 |
commit | 4b3e11c62df47977c9696f4c066d32f14b28e6b3 (patch) | |
tree | 30137125270d5657f1b1323bfc019033101a1e33 | |
parent | fbc0006a4fc272e10b242b40f7d5a09814ed9a89 (diff) | |
download | infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.tar infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.tar.gz infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.tar.bz2 infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.tar.lz infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.tar.xz infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.tar.zst infinity-for-reddit-4b3e11c62df47977c9696f4c066d32f14b28e6b3.zip |
Fix https://github.com/Docile-Alligator/Infinity-For-Reddit/issues/667
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java | 4 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java index 3c0dd8e3..cadadd68 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/FilteredPostsActivity.java @@ -93,6 +93,9 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec @Named("current_account") SharedPreferences mCurrentAccountSharedPreferences; @Inject + @Named("nsfw_and_spoiler") + SharedPreferences mNsfwAndSpoilerSharedPreferences; + @Inject CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; @@ -156,6 +159,7 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec postType = getIntent().getIntExtra(EXTRA_POST_TYPE, PostPagingSource.TYPE_FRONT_PAGE); int filter = getIntent().getIntExtra(EXTRA_FILTER, -1000); PostFilter postFilter = new PostFilter(); + postFilter.allowNSFW = !mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false) && mNsfwAndSpoilerSharedPreferences.getBoolean((mAccountName == null || mAccountName.equals("-") ? "" : mAccountName) + SharedPreferencesUtils.NSFW_BASE, false); switch (filter) { case Post.NSFW_TYPE: postFilter.onlyNSFW = true; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java index aaafe2e2..dc8232e3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java @@ -1629,7 +1629,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { @Override public void changePostFilter(PostFilter postFilter) { this.postFilter = postFilter; - postFilter.allowNSFW = !mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false) && mNsfwAndSpoilerSharedPreferences.getBoolean((accountName == null || accountName.equals("-") ? "" : accountName) + SharedPreferencesUtils.NSFW_BASE, false); if (mPostViewModel != null) { mPostViewModel.changePostFilter(postFilter); } |