From f8ecbb893633762aa5ba207bfc96a56ad298e961 Mon Sep 17 00:00:00 2001 From: sk Date: Wed, 25 Jan 2023 15:32:51 +0100 Subject: [PATCH] tweak no alt indicator --- .../ui/displayitems/PhotoStatusDisplayItem.java | 9 ++++++--- .../res/drawable/bg_image_no_alt_overlay.xml | 2 +- .../src/main/res/layout/display_item_photo.xml | 17 ++++++++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PhotoStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PhotoStatusDisplayItem.java index 23511fe4c..bbfc7a082 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PhotoStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PhotoStatusDisplayItem.java @@ -43,7 +43,7 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{ private final ImageView noAltTextButton; private final View altTextScroller; private final ImageButton altTextClose; - private final TextView altText; + private final TextView altText, noAltText; private View altOrNoAltButton; private boolean altTextShown; @@ -57,6 +57,7 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{ altTextScroller=findViewById(R.id.alt_text_scroller); altTextClose=findViewById(R.id.alt_text_close); altText=findViewById(R.id.alt_text); + noAltText=findViewById(R.id.no_alt_text); altTextButton.setOnClickListener(this::onShowHideClick); noAltTextButton.setOnClickListener(this::onShowHideClick); @@ -84,19 +85,21 @@ public class PhotoStatusDisplayItem extends ImageStatusDisplayItem{ if (altTextMissing){ if (GlobalUserPreferences.showNoAltIndicator) { noAltTextButton.setVisibility(View.VISIBLE); + noAltText.setVisibility(View.VISIBLE); altTextWrapper.setBackgroundResource(R.drawable.bg_image_no_alt_overlay); altTextButton.setVisibility(View.GONE); - altText.setText(R.string.sk_no_alt_text); - altText.setPadding(V.dp(8), 0, 0, 0); + altText.setVisibility(View.GONE); } else { altTextWrapper.setVisibility(View.GONE); } }else{ if (GlobalUserPreferences.showAltIndicator) { noAltTextButton.setVisibility(View.GONE); + noAltText.setVisibility(View.GONE); altTextWrapper.setBackgroundResource(R.drawable.bg_image_alt_overlay); altTextButton.setVisibility(View.VISIBLE); altTextButton.setText(R.string.sk_alt_button); + altText.setVisibility(View.VISIBLE); altText.setText(item.attachment.description); altText.setPadding(0, 0, 0, 0); } else { diff --git a/mastodon/src/main/res/drawable/bg_image_no_alt_overlay.xml b/mastodon/src/main/res/drawable/bg_image_no_alt_overlay.xml index c3560b056..5cb6f3ada 100644 --- a/mastodon/src/main/res/drawable/bg_image_no_alt_overlay.xml +++ b/mastodon/src/main/res/drawable/bg_image_no_alt_overlay.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/mastodon/src/main/res/layout/display_item_photo.xml b/mastodon/src/main/res/layout/display_item_photo.xml index 5d9784bb6..d3129d379 100644 --- a/mastodon/src/main/res/layout/display_item_photo.xml +++ b/mastodon/src/main/res/layout/display_item_photo.xml @@ -27,14 +27,14 @@ android:layout_height="wrap_content" android:padding="4dp" android:src="@drawable/ic_fluent_important_20_filled" - android:tint="@color/gray_25" /> + android:tint="?colorGray25" /> + +