From 2de2af0a8c20f4f9098d7dc8cb903bfe7fd7f690 Mon Sep 17 00:00:00 2001 From: Eva Tatarka Date: Thu, 8 Dec 2022 12:25:59 -0800 Subject: [PATCH] Fix media preview sometimes not showing (#3023) --- .../keylesspalace/tusky/adapter/StatusBaseViewHolder.java | 1 + .../java/com/keylesspalace/tusky/view/MediaPreviewLayout.kt | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index 949ae8515..6b2c6d439 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -457,6 +457,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { final StatusActionListener listener, boolean showingContent, boolean useBlurhash) { + mediaPreview.setVisibility(View.VISIBLE); mediaPreview.setAspectRatios(AttachmentHelper.aspectRatios(attachments)); mediaPreview.forEachIndexed((i, imageView) -> { diff --git a/app/src/main/java/com/keylesspalace/tusky/view/MediaPreviewLayout.kt b/app/src/main/java/com/keylesspalace/tusky/view/MediaPreviewLayout.kt index 802141f7d..af5c93302 100644 --- a/app/src/main/java/com/keylesspalace/tusky/view/MediaPreviewLayout.kt +++ b/app/src/main/java/com/keylesspalace/tusky/view/MediaPreviewLayout.kt @@ -1,7 +1,6 @@ package com.keylesspalace.tusky.view import android.content.Context -import android.graphics.Canvas import android.util.AttributeSet import android.view.View import android.view.ViewGroup @@ -186,10 +185,6 @@ class MediaPreviewLayout(context: Context, attrs: AttributeSet? = null) : action(index, getChildAt(index) as MediaPreviewImageView) } } - - override fun onDraw(canvas: Canvas?) { - super.onDraw(canvas) - } } private fun rowHeight(halfWidth: Int, aspect1: Double, aspect2: Double): Int {