mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-30 19:34:45 +01:00
Maybe fix nsfw gif cannot be blurred in PostDetailRecyclerViewAdapter.
This commit is contained in:
parent
b36a99da6d
commit
fa11426101
@ -867,7 +867,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
|
|
||||||
private void loadImage(PostDetailBaseViewHolder holder, @NonNull Post.Preview preview) {
|
private void loadImage(PostDetailBaseViewHolder holder, @NonNull Post.Preview preview) {
|
||||||
if (holder instanceof PostDetailImageAndGifAutoplayViewHolder) {
|
if (holder instanceof PostDetailImageAndGifAutoplayViewHolder) {
|
||||||
String url = mPost.getPostType() == Post.IMAGE_TYPE ? preview.getPreviewUrl() : mPost.getUrl();
|
boolean blurImage = (mPost.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(mPost.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || (mPost.isSpoiler() && mNeedBlurSpoiler);
|
||||||
|
String url = mPost.getPostType() == Post.IMAGE_TYPE || blurImage ? preview.getPreviewUrl() : mPost.getUrl();
|
||||||
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(url)
|
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(url)
|
||||||
.listener(new RequestListener<Drawable>() {
|
.listener(new RequestListener<Drawable>() {
|
||||||
@Override
|
@Override
|
||||||
@ -889,7 +890,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if ((mPost.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit()) && !(mPost.getPostType() == Post.GIF_TYPE && mAutoplayNsfwVideos)) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
if (blurImage) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10))).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10))).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
|
||||||
} else {
|
} else {
|
||||||
if (mImageViewWidth > preview.getPreviewWidth()) {
|
if (mImageViewWidth > preview.getPreviewWidth()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user