From 7a02ca435fc55211330571631620c89f90985417 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 20 Jul 2023 23:19:47 +0200 Subject: [PATCH] make alt badge more transparent closes sk22#735 --- .../android/ui/displayitems/MediaGridStatusDisplayItem.java | 6 +++--- mastodon/src/main/res/drawable/bg_image_alt_overlay.xml | 2 +- .../src/main/res/drawable/bg_image_alt_text_overlay.xml | 5 +++++ mastodon/src/main/res/layout/alt_text_badge.xml | 2 +- mastodon/src/main/res/layout/overlay_image_alt_text.xml | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 mastodon/src/main/res/drawable/bg_image_alt_text_overlay.xml 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 4dd42b134..bbce46ee1 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 @@ -254,7 +254,7 @@ public class MediaGridStatusDisplayItem extends StatusDisplayItem{ noAltText.setVisibility(!hasAltText && showNoAltIndicator ? View.VISIBLE : View.GONE); altText.setText(att.description); altTextWrapper.setVisibility(View.VISIBLE); - altTextWrapper.setBackgroundResource(hasAltText ? R.drawable.bg_image_alt_overlay : R.drawable.bg_image_no_alt_overlay); + altTextWrapper.setBackgroundResource(hasAltText ? R.drawable.bg_image_alt_text_overlay : R.drawable.bg_image_no_alt_overlay); altTextWrapper.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){ @Override public boolean onPreDraw(){ @@ -365,8 +365,8 @@ public class MediaGridStatusDisplayItem extends StatusDisplayItem{ @Override public void onAnimationEnd(Animator animation){ altTextAnimator=null; - altTextWrapper.setVisibility(View.GONE); - btn.setVisibility(View.VISIBLE); + V.setVisibilityAnimated(altTextWrapper, View.GONE); + V.setVisibilityAnimated(btn, View.VISIBLE); btn.setAlpha(1); } }); diff --git a/mastodon/src/main/res/drawable/bg_image_alt_overlay.xml b/mastodon/src/main/res/drawable/bg_image_alt_overlay.xml index a4c289467..45d950ee0 100644 --- a/mastodon/src/main/res/drawable/bg_image_alt_overlay.xml +++ b/mastodon/src/main/res/drawable/bg_image_alt_overlay.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/bg_image_alt_text_overlay.xml b/mastodon/src/main/res/drawable/bg_image_alt_text_overlay.xml new file mode 100644 index 000000000..b7529b39b --- /dev/null +++ b/mastodon/src/main/res/drawable/bg_image_alt_text_overlay.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/layout/alt_text_badge.xml b/mastodon/src/main/res/layout/alt_text_badge.xml index 60541fdad..4f1cc9c3f 100644 --- a/mastodon/src/main/res/layout/alt_text_badge.xml +++ b/mastodon/src/main/res/layout/alt_text_badge.xml @@ -24,7 +24,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom" android:textAppearance="@style/m3_label_large" - android:textColor="?colorGray25" + android:textColor="?colorM3DarkOnSurface" android:gravity="center" android:includeFontPadding="false" android:paddingHorizontal="6dp" diff --git a/mastodon/src/main/res/layout/overlay_image_alt_text.xml b/mastodon/src/main/res/layout/overlay_image_alt_text.xml index 0af3dcab8..a92cd56d0 100644 --- a/mastodon/src/main/res/layout/overlay_image_alt_text.xml +++ b/mastodon/src/main/res/layout/overlay_image_alt_text.xml @@ -7,7 +7,7 @@ android:layout_gravity="end|bottom" android:layout_margin="12dp" android:importantForAccessibility="noHideDescendants" - android:background="@drawable/bg_image_alt_overlay"> + android:background="@drawable/bg_image_alt_text_overlay">