From 9a994ca5312da8269394537dc37e7ea072591a6d Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Fri, 13 May 2022 17:21:41 +0800 Subject: Do not show nsfw gif preview in case the blurring is not working. Fix bugs related to post filter in PostFragment. --- .../adapters/PostDetailRecyclerViewAdapter.java | 5 +- .../adapters/PostRecyclerViewAdapter.java | 191 +++++++++++---------- .../infinityforreddit/fragments/PostFragment.java | 5 +- 3 files changed, 112 insertions(+), 89 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index fca4fd35..1afbf635 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -421,10 +421,13 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter { if (activity != null && !activity.isFinishing() && !activity.isDestroyed() && !isDetached()) { - this.postFilter = postFilter; postFilter.allowNSFW = !mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false) && mNsfwAndSpoilerSharedPreferences.getBoolean(SharedPreferencesUtils.NSFW_BASE, false); this.concatenatedSubredditNames = concatenatedSubredditNames; if (concatenatedSubredditNames == null) { @@ -1019,7 +1021,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { FetchPostFilterReadPostsAndConcatenatedSubredditNames.fetchPostFilterAndConcatenatedSubredditNames(mRedditDataRoomDatabase, mExecutor, new Handler(), multiRedditPath, usage, nameOfUsage, (postFilter, concatenatedSubredditNames) -> { if (activity != null && !activity.isFinishing() && !activity.isDestroyed() && !isDetached()) { - this.postFilter = postFilter; postFilter.allowNSFW = !mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false) && mNsfwAndSpoilerSharedPreferences.getBoolean(SharedPreferencesUtils.NSFW_BASE, false); this.concatenatedSubredditNames = concatenatedSubredditNames; if (concatenatedSubredditNames == null) { -- cgit v1.2.3