mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +01:00
Try another possible solution for blurry image problem.
This commit is contained in:
parent
354529ca88
commit
b782a90bf3
@ -36,6 +36,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.bumptech.glide.RequestBuilder;
|
import com.bumptech.glide.RequestBuilder;
|
||||||
import com.bumptech.glide.RequestManager;
|
import com.bumptech.glide.RequestManager;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.bumptech.glide.load.DataSource;
|
||||||
|
import com.bumptech.glide.load.DecodeFormat;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.bumptech.glide.request.RequestListener;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
@ -1141,9 +1142,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
|
|
||||||
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
|
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
|
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailImageAndGifAutoplayViewHolder) holder).mImageView);
|
||||||
}
|
}
|
||||||
} else if (holder instanceof PostDetailVideoAndGifPreviewHolder) {
|
} else if (holder instanceof PostDetailVideoAndGifPreviewHolder) {
|
||||||
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
|
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
|
||||||
@ -1169,9 +1170,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
|
|
||||||
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
|
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
|
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailVideoAndGifPreviewHolder) holder).mImageView);
|
||||||
}
|
}
|
||||||
} else if (holder instanceof PostDetailLinkViewHolder) {
|
} else if (holder instanceof PostDetailLinkViewHolder) {
|
||||||
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
|
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(mPost.getPreviewUrl())
|
||||||
@ -1197,9 +1198,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
|
|
||||||
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
if ((mPost.isNSFW() && mNeedBlurNsfw) || (mPost.isSpoiler() && mNeedBlurSpoiler)) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostDetailLinkViewHolder) holder).mImageView);
|
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailLinkViewHolder) holder).mImageView);
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostDetailLinkViewHolder) holder).mImageView);
|
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostDetailLinkViewHolder) holder).mImageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.bumptech.glide.RequestBuilder;
|
import com.bumptech.glide.RequestBuilder;
|
||||||
import com.bumptech.glide.RequestManager;
|
import com.bumptech.glide.RequestManager;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.bumptech.glide.load.DataSource;
|
||||||
|
import com.bumptech.glide.load.DecodeFormat;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.bumptech.glide.request.RequestListener;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
@ -1146,9 +1147,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
|
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
|
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostImageAndGifAutoplayViewHolder) holder).imageView);
|
||||||
}
|
}
|
||||||
} else if (holder instanceof PostVideoAndGifPreviewViewHolder) {
|
} else if (holder instanceof PostVideoAndGifPreviewViewHolder) {
|
||||||
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
|
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
|
||||||
@ -1174,9 +1175,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
|
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
|
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostVideoAndGifPreviewViewHolder) holder).imageView);
|
||||||
}
|
}
|
||||||
} else if (holder instanceof PostLinkTypeViewHolder) {
|
} else if (holder instanceof PostLinkTypeViewHolder) {
|
||||||
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
|
RequestBuilder<Drawable> imageRequestBuilder = mGlide.load(post.getPreviewUrl()).listener(new RequestListener<Drawable>() {
|
||||||
@ -1202,9 +1203,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
||||||
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
imageRequestBuilder.apply(RequestOptions.bitmapTransform(new BlurTransformation(50, 10)))
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostLinkTypeViewHolder) holder).imageView);
|
.format(DecodeFormat.PREFER_ARGB_8888).into(((PostLinkTypeViewHolder) holder).imageView);
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostLinkTypeViewHolder) holder).imageView);
|
imageRequestBuilder.format(DecodeFormat.PREFER_ARGB_8888).into(((PostLinkTypeViewHolder) holder).imageView);
|
||||||
}
|
}
|
||||||
} else if (holder instanceof PostCompactViewHolder) {
|
} else if (holder instanceof PostCompactViewHolder) {
|
||||||
String previewUrl = post.getThumbnailPreviewUrl().equals("") ? post.getPreviewUrl() : post.getThumbnailPreviewUrl();
|
String previewUrl = post.getThumbnailPreviewUrl().equals("") ? post.getPreviewUrl() : post.getThumbnailPreviewUrl();
|
||||||
@ -1224,10 +1225,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
});
|
});
|
||||||
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
if ((post.isNSFW() && mNeedBlurNSFW) || post.isSpoiler() && mNeedBlurSpoiler) {
|
||||||
imageRequestBuilder
|
imageRequestBuilder
|
||||||
.transform(new BlurTransformation(50, 2))
|
.transform(new BlurTransformation(50, 2)).into(((PostCompactViewHolder) holder).imageView);
|
||||||
.override(Target.SIZE_ORIGINAL).into(((PostCompactViewHolder) holder).imageView);
|
|
||||||
} else {
|
} else {
|
||||||
imageRequestBuilder.override(Target.SIZE_ORIGINAL).into(((PostCompactViewHolder) holder).imageView);
|
imageRequestBuilder.into(((PostCompactViewHolder) holder).imageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user