mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-14 12:17:11 +01:00
Fix gallery image height in PostGalleryTypeImageRecyclerViewAdapter.
This commit is contained in:
parent
8a6eb8e025
commit
12333fb453
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user