From 9ef6ea0d62d72e8712de837f16c2743a759be47d Mon Sep 17 00:00:00 2001 From: jameswoo-stripe <99316447+jameswoo-stripe@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:28:19 -0700 Subject: [PATCH] Add small improvements to playground (#7168) --- .../example/samples/ui/shared/MultiToggleButton.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/shared/MultiToggleButton.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/shared/MultiToggleButton.kt index 5babf216423..43e21dfb24c 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/shared/MultiToggleButton.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/shared/MultiToggleButton.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.defaultMinSize import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -40,7 +41,7 @@ fun MultiToggleButton( toggleStates.forEachIndexed { index, toggleState -> val isSelected = currentSelection.lowercase() == toggleState.lowercase() val backgroundTint = if (isSelected) selectedTint else unselectedTint - val textColor = if (isSelected) Color.White else Color.Unspecified + val textColor = if (isSelected) Color.White else MaterialTheme.colors.onBackground val shape = RoundedCornerShape( topStart = if (index == 0) 4.dp else 0.dp, bottomStart = if (index == 0) 4.dp else 0.dp, @@ -78,6 +79,7 @@ fun MultiToggleButton( } ) .padding(vertical = 4.dp, horizontal = 8.dp) + .defaultMinSize(minWidth = 48.dp) ) } }