aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDocile-Alligator <chineseperson5@gmail.com>2022-03-05 03:33:07 +0000
committerDocile-Alligator <chineseperson5@gmail.com>2022-03-05 03:33:07 +0000
commitdc9725735baa027ce68a59648cc810e7daf77ce9 (patch)
tree720be853648ae974e1491c27d4e24477dbccc069 /app
parent023cef76adc930050c8f52174727b5bf1faeb857 (diff)
downloadinfinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.tar
infinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.tar.gz
infinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.tar.bz2
infinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.tar.lz
infinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.tar.xz
infinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.tar.zst
infinity-for-reddit-dc9725735baa027ce68a59648cc810e7daf77ce9.zip
Fix preview issue in PostCompactBaseViewHolder in PostRecyclerViewAdapter.
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java8
-rw-r--r--app/src/main/res/layout/item_post_compact.xml2
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<Post, RecyclerVie
((PostCompactBaseViewHolder) holder).noPreviewPostImageView.setImageResource(R.drawable.ic_gallery_24dp);
}
if (post.getPreviews() != null && !post.getPreviews().isEmpty()) {
- if (post.getPostType() != Post.GIF_TYPE && post.getPostType() != Post.VIDEO_TYPE) {
- ((PostCompactBaseViewHolder) holder).imageView.setVisibility(View.VISIBLE);
- ((PostCompactBaseViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
- }
+ ((PostCompactBaseViewHolder) holder).imageView.setVisibility(View.VISIBLE);
+ ((PostCompactBaseViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
loadImage(holder);
}
}
@@ -1531,7 +1529,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
RequestBuilder<Drawable> 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" />
<ImageView
android:id="@+id/play_button_image_view_item_post_compact"