From 0ef30f82a77c47ca190fd1568790f9cdeac71714 Mon Sep 17 00:00:00 2001 From: sk Date: Fri, 7 Apr 2023 17:16:45 +0200 Subject: [PATCH] fix disappearing no-alt indicator closes sk22#484 --- .../ui/displayitems/MediaGridStatusDisplayItem.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java index 87e27e2ad..eb0fb9056 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/MediaGridStatusDisplayItem.java @@ -249,8 +249,12 @@ public class MediaGridStatusDisplayItem extends StatusDisplayItem{ View btn=controllers.get(altTextIndex).btnsWrap; int i=0; for(MediaAttachmentViewController c:controllers){ - if(c.btnsWrap!=null && c.btnsWrap!=btn && !TextUtils.isEmpty(item.attachments.get(i).description)) - c.btnsWrap.setVisibility(View.VISIBLE); + boolean hasAltText = !TextUtils.isEmpty(item.attachments.get(i).description); + if(c.btnsWrap!=null + && c.btnsWrap!=btn + && ((hasAltText && GlobalUserPreferences.showAltIndicator) + || (!hasAltText && GlobalUserPreferences.showNoAltIndicator)) + ) c.btnsWrap.setVisibility(View.VISIBLE); i++; }