From c8e527d326e4e64b373d363e8f6032de6f73ae4c Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sat, 25 Nov 2023 00:03:11 -0500 Subject: Layout tweaks in ImageAndGifEntry. --- .../markdown/ImageAndGifEntry.java | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifEntry.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifEntry.java index 77e470cd..86287cc0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifEntry.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifEntry.java @@ -3,9 +3,11 @@ package ml.docilealligator.infinityforreddit.markdown; import android.content.SharedPreferences; import android.content.res.ColorStateList; import android.graphics.drawable.Drawable; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -13,7 +15,9 @@ import androidx.annotation.Nullable; import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.RequestManager; import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.MultiTransformation; import com.bumptech.glide.load.engine.GlideException; +import com.bumptech.glide.load.resource.bitmap.CenterInside; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.Target; @@ -21,6 +25,7 @@ import com.bumptech.glide.request.target.Target; import io.noties.markwon.Markwon; import io.noties.markwon.recycler.MarkwonAdapter; import jp.wasabeef.glide.transformations.BlurTransformation; +import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import ml.docilealligator.infinityforreddit.MediaMetadata; import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy; import ml.docilealligator.infinityforreddit.activities.BaseActivity; @@ -83,6 +88,11 @@ public class ImageAndGifEntry extends MarkwonAdapter.Entry imageRequestBuilder; @@ -95,10 +105,20 @@ public class ImageAndGifEntry extends MarkwonAdapter.Entry( + new BlurTransformation(50, 10), + new RoundedCornersTransformation(72, 0)))) .into(holder.binding.imageViewMarkdownImageAndGifBlock); } else { - imageRequestBuilder.centerInside().downsample(saveMemoryCenterInsideDownsampleStrategy).into(holder.binding.imageViewMarkdownImageAndGifBlock); + imageRequestBuilder + .apply(RequestOptions.bitmapTransform( + new MultiTransformation<>( + new CenterInside(), + new RoundedCornersTransformation(16, 0)))) + .downsample(saveMemoryCenterInsideDownsampleStrategy) + .into(holder.binding.imageViewMarkdownImageAndGifBlock); } } @@ -109,6 +129,11 @@ public class ImageAndGifEntry extends MarkwonAdapter.Entry