Probably fix blurred images this time.

This commit is contained in:
Hermes Junior 2020-06-20 21:53:26 +02:00 committed by OHermesJunior
parent b782a90bf3
commit 0fc513cb9d
2 changed files with 12 additions and 12 deletions

View File

@ -1142,9 +1142,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
.into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
} else {
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
imageRequestBuilder.apply(RequestOptions.noTransformation()).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
}
} else if (holder instanceof PostDetailVideoAndGifPreviewHolder) {
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
@ -1170,9 +1170,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
.into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
} else {
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
imageRequestBuilder.apply(RequestOptions.noTransformation()).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
}
} else if (holder instanceof PostDetailLinkViewHolder) {
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
@ -1198,9 +1198,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailLinkViewHolder) holder).mImageView);
.into(((PostDetailLinkViewHolder) holder).mImageView);
} else {
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailLinkViewHolder) holder).mImageView);
imageRequestBuilder.apply(RequestOptions.noTransformation()).into(((PostDetailLinkViewHolder) holder).mImageView);
}
}
}

View File

@ -1147,9 +1147,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
.into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
} else {
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
imageRequestBuilder.apply(RequestOptions.noTransformation()).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
}
} else if (holder instanceof PostVideoAndGifPreviewViewHolder) {
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
@ -1175,9 +1175,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
.into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
} else {
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
imageRequestBuilder.apply(RequestOptions.noTransformation()).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
}
} else if (holder instanceof PostLinkTypeViewHolder) {
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
@ -1203,9 +1203,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostLinkTypeViewHolder) holder).imageView);
.into(((PostLinkTypeViewHolder) holder).imageView);
} else {
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostLinkTypeViewHolder) holder).imageView);
imageRequestBuilder.apply(RequestOptions.noTransformation()).into(((PostLinkTypeViewHolder) holder).imageView);
}
} else if (holder instanceof PostCompactViewHolder) {
String previewUrl = post.getThumbnailPreviewUrl().equals("") ? post.getPreviewUrl() : post.getThumbnailPreviewUrl();