From 204993397f97050f0673fa70c17789be0605c1ec Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 12 Jun 2024 14:27:52 +0930 Subject: [PATCH] Fix OutlineButton disabled state --- app/src/main/java/org/thoughtcrime/securesms/ui/Colors.kt | 2 ++ .../java/org/thoughtcrime/securesms/ui/components/Button.kt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/Colors.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/Colors.kt index 4c8e651cab..1b1cd9e153 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/Colors.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/Colors.kt @@ -60,6 +60,8 @@ const val oceanLight7 = 0xffFCFFFF val session_accent = Color(0xFF31F196) val ocean_accent = Color(0xff57C9FA) +val Colors.disabled @Composable get() = onSurface.copy(alpha = ContentAlpha.disabled) + val oceanLights = arrayOf(oceanLight0, oceanLight1, oceanLight2, oceanLight3, oceanLight4, oceanLight5, oceanLight6, oceanLight7) val oceanDarks = arrayOf(oceanDark0, oceanDark1, oceanDark2, oceanDark3, oceanDark4, oceanDark5, oceanDark6, oceanDark7) val classicLights = arrayOf(classicLight0, classicLight1, classicLight2, classicLight3, classicLight4, classicLight5, classicLight6) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt index 3a3edabfa7..423f78edf8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/Button.kt @@ -47,6 +47,7 @@ import org.thoughtcrime.securesms.ui.LocalButtonColor import org.thoughtcrime.securesms.ui.baseBold import org.thoughtcrime.securesms.ui.colorDestructive import org.thoughtcrime.securesms.ui.contentDescription +import org.thoughtcrime.securesms.ui.disabled import org.thoughtcrime.securesms.ui.extraSmall val LocalButtonSize = staticCompositionLocalOf { mediumButton } @@ -103,7 +104,7 @@ fun OutlineButton( enabled = enabled, interactionSource = interactionSource, onClick = onClick, - border = BorderStroke(1.dp, LocalButtonColor.current), + border = BorderStroke(1.dp, if (enabled) LocalButtonColor.current else MaterialTheme.colors.disabled), colors = ButtonDefaults.outlinedButtonColors( contentColor = if (enabled) LocalButtonColor.current else Color.Unspecified, backgroundColor = Color.Unspecified