Don't display empty image preview if thumbnail image is null

This commit is contained in:
Otavio Pliger 2023-07-22 16:06:56 +07:00 committed by FineFindus
parent c8122aa65b
commit 022e61b2d0
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
2 changed files with 5 additions and 2 deletions

View File

@ -87,7 +87,10 @@ public class LinkCardStatusDisplayItem extends StatusDisplayItem{
crossfadeDrawable.setBlurhashDrawable(card.blurhashPlaceholder);
crossfadeDrawable.setCrossfadeAlpha(item.status.spoilerRevealed ? 0f : 1f);
photo.setImageDrawable(crossfadeDrawable);
photo.setVisibility(View.VISIBLE);
didClear=false;
} else {
photo.setVisibility(View.GONE);
}
// if there's no image, we don't want to cover the inset borders

View File

@ -8,14 +8,14 @@
<org.joinmastodon.android.ui.views.MaxWidthFrameLayout
android:id="@+id/inner"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:foreground="?android:selectableItemBackground"
android:maxWidth="@dimen/layout_max_width">
<ImageView
android:id="@+id/photo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="250dp"
android:scaleType="centerCrop"
tools:src="#0f0"/>
<LinearLayout