Skip to content

Commit

Permalink
Don't display empty image preview if thumbnail image is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Otavio Pliger authored and FineFindus committed Nov 2, 2023
1 parent c8122aa commit 022e61b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public void onBind(LinkCardStatusDisplayItem item){
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
Expand Down
4 changes: 2 additions & 2 deletions mastodon/src/main/res/layout/display_item_link_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 022e61b

Please sign in to comment.