From ec3921d923b8bbd7d0a0f65920436cbc161c50e6 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sat, 14 Dec 2024 19:33:37 +0100 Subject: [PATCH] show the warning icon again when there is media without description (#4806) Regression from the Material 3 redesign --- .../tusky/components/compose/ComposeActivity.kt | 8 ++------ app/src/main/res/layout/activity_compose.xml | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt index 8e2910bb81..9b12b39786 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt @@ -843,12 +843,8 @@ class ComposeActivity : ) ) - var oneMediaWithoutDescription = false - for (media in viewModel.media.value) { - if (media.description.isNullOrEmpty()) { - oneMediaWithoutDescription = true - break - } + val oneMediaWithoutDescription = viewModel.media.value.any { media -> + media.description.isNullOrEmpty() } binding.descriptionMissingWarningButton.visibility = if (oneMediaWithoutDescription) View.VISIBLE else View.GONE } diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index aa5160ade8..77f39aaa57 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -28,8 +28,8 @@ android:layout_width="52dp" android:layout_height="wrap_content" android:layout_gravity="end" - android:padding="0dp" android:contentDescription="@string/description_post_language" + android:padding="0dp" android:textColor="?android:attr/textColorTertiary" android:textSize="?attr/status_text_large" android:textStyle="bold" @@ -67,10 +67,10 @@ android:layout_gravity="end" android:contentDescription="@string/hint_media_description_missing" android:padding="8dp" - app:srcCompat="@drawable/ic_missing_description_24dp" - app:tint="@color/tusky_orange_light" - app:tooltipText="@string/hint_media_description_missing" - android:visibility="invisible" /> + app:icon="@drawable/ic_missing_description_24dp" + app:iconTint="@color/tusky_orange_light" + app:tooltipText="@string/hint_media_description_missing" /> +