From dc9725735baa027ce68a59648cc810e7daf77ce9 Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Sat, 5 Mar 2022 11:33:07 +0800 Subject: Fix preview issue in PostCompactBaseViewHolder in PostRecyclerViewAdapter. --- .../infinityforreddit/adapters/PostRecyclerViewAdapter.java | 8 +++----- app/src/main/res/layout/item_post_compact.xml | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 773e78f6..6a25642e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -1207,10 +1207,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter imageRequestBuilder = mGlide.load(postCompactThumbnailPreviewUrl) .error(R.drawable.ic_error_outline_black_24dp).listener(((PostCompactBaseViewHolder) holder).requestListener); - if ((post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit())) || post.isSpoiler() && mNeedBlurSpoiler) { + if ((post.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit())) || (post.isSpoiler() && mNeedBlurSpoiler)) { imageRequestBuilder .transform(new BlurTransformation(50, 2)).into(((PostCompactBaseViewHolder) holder).imageView); } else { diff --git a/app/src/main/res/layout/item_post_compact.xml b/app/src/main/res/layout/item_post_compact.xml index 83335fbd..de83f336 100644 --- a/app/src/main/res/layout/item_post_compact.xml +++ b/app/src/main/res/layout/item_post_compact.xml @@ -225,7 +225,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/thumbnail_compact_layout_rounded_edge" - android:scaleType="center" /> + android:scaleType="centerCrop" />