mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +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) {
|
||||
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)
|
||||
.listener(new RequestListener<Drawable>() {
|
||||
@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);
|
||||
} else {
|
||||
if (mImageViewWidth > preview.getPreviewWidth()) {
|
||||
|
Loading…
Reference in New Issue
Block a user