From 12333fb453df8f87da63cf038d49304378742cbb Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Wed, 28 Dec 2022 18:13:53 -0800 Subject: Fix gallery image height in PostGalleryTypeImageRecyclerViewAdapter. --- .../adapters/PostGalleryTypeImageRecyclerViewAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java index 97b2ad5f..e3bdae8a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostGalleryTypeImageRecyclerViewAdapter.java @@ -5,6 +5,7 @@ import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.net.Uri; import android.text.TextUtils; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -83,6 +84,7 @@ public class PostGalleryTypeImageRecyclerViewAdapter extends RecyclerView.Adapte public void onBindViewHolder(@NonNull ImageViewHolder holder, int position) { if (ratio < 0) { int height = (int) (400 * mScale); + Log.i("asdfasdf", "asdfadsf"); holder.binding.imageViewItemGalleryImageInPostFeed.setScaleType(ImageView.ScaleType.CENTER_CROP); holder.binding.imageViewItemGalleryImageInPostFeed.getLayoutParams().height = height; } else { @@ -91,8 +93,6 @@ public class PostGalleryTypeImageRecyclerViewAdapter extends RecyclerView.Adapte holder.binding.errorTextViewItemGalleryImageInPostFeed.setVisibility(View.GONE); holder.binding.progressBarItemGalleryImageInPostFeed.setVisibility(View.VISIBLE); - holder.binding.imageViewItemGalleryImageInPostFeed.setRatio(ratio); - holder.binding.imageViewItemGalleryImageInPostFeed.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { -- cgit v1.2.3