mirror of
https://github.com/bitwarden/android.git
synced 2025-12-10 00:06:22 -06:00
PM-27271: Update selection button disabled state (#6071)
This commit is contained in:
parent
bb11b17823
commit
c61fec176a
@ -33,6 +33,7 @@ import com.bitwarden.ui.platform.base.util.cardStyle
|
||||
import com.bitwarden.ui.platform.base.util.nullableTestTag
|
||||
import com.bitwarden.ui.platform.components.divider.BitwardenHorizontalDivider
|
||||
import com.bitwarden.ui.platform.components.field.color.bitwardenTextFieldButtonColors
|
||||
import com.bitwarden.ui.platform.components.field.color.bitwardenTextFieldColors
|
||||
import com.bitwarden.ui.platform.components.model.CardStyle
|
||||
import com.bitwarden.ui.platform.components.model.TooltipData
|
||||
import com.bitwarden.ui.platform.components.row.BitwardenRowOfActions
|
||||
@ -163,7 +164,6 @@ fun BitwardenTextSelectionButton(
|
||||
Icon(
|
||||
painter = rememberVectorPainter(id = BitwardenDrawable.ic_chevron_down),
|
||||
contentDescription = null,
|
||||
tint = BitwardenTheme.colorScheme.icon.primary,
|
||||
modifier = Modifier.minimumInteractiveComponentSize(),
|
||||
)
|
||||
actions()
|
||||
@ -172,7 +172,11 @@ fun BitwardenTextSelectionButton(
|
||||
},
|
||||
value = selectedOption.orEmpty(),
|
||||
onValueChange = {},
|
||||
colors = bitwardenTextFieldButtonColors(),
|
||||
colors = if (enabled) {
|
||||
bitwardenTextFieldButtonColors()
|
||||
} else {
|
||||
bitwardenTextFieldColors()
|
||||
},
|
||||
modifier = Modifier
|
||||
.nullableTestTag(tag = textFieldTestTag)
|
||||
.fillMaxWidth(),
|
||||
|
||||
@ -11,10 +11,7 @@ import com.bitwarden.ui.platform.theme.BitwardenTheme
|
||||
*/
|
||||
@Composable
|
||||
fun bitwardenTextFieldButtonColors(): TextFieldColors = bitwardenTextFieldColors(
|
||||
unfocusedBorderColor = Color.Transparent,
|
||||
focusedBorderColor = Color.Transparent,
|
||||
disabledTextColor = BitwardenTheme.colorScheme.text.primary,
|
||||
disabledBorderColor = Color.Transparent,
|
||||
disabledLeadingIconColor = BitwardenTheme.colorScheme.icon.primary,
|
||||
disabledTrailingIconColor = BitwardenTheme.colorScheme.icon.primary,
|
||||
disabledLabelColor = BitwardenTheme.colorScheme.text.secondary,
|
||||
@ -27,18 +24,12 @@ fun bitwardenTextFieldButtonColors(): TextFieldColors = bitwardenTextFieldColors
|
||||
*/
|
||||
@Composable
|
||||
fun bitwardenTextFieldColors(
|
||||
focusedBorderColor: Color = Color.Transparent,
|
||||
unfocusedBorderColor: Color = Color.Transparent,
|
||||
disabledTextColor: Color = BitwardenTheme.colorScheme.outlineButton.foregroundDisabled,
|
||||
disabledBorderColor: Color = Color.Transparent,
|
||||
disabledLeadingIconColor: Color = BitwardenTheme.colorScheme.outlineButton.foregroundDisabled,
|
||||
disabledTrailingIconColor: Color = BitwardenTheme.colorScheme.outlineButton.foregroundDisabled,
|
||||
disabledLabelColor: Color = BitwardenTheme.colorScheme.outlineButton.foregroundDisabled,
|
||||
disabledTextColor: Color = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
disabledLeadingIconColor: Color = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
disabledTrailingIconColor: Color = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
disabledLabelColor: Color = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
disabledPlaceholderColor: Color = BitwardenTheme.colorScheme.text.secondary,
|
||||
disabledSupportingTextColor: Color = BitwardenTheme
|
||||
.colorScheme
|
||||
.outlineButton
|
||||
.foregroundDisabled,
|
||||
disabledSupportingTextColor: Color = BitwardenTheme.colorScheme.filledButton.foregroundDisabled,
|
||||
): TextFieldColors = TextFieldColors(
|
||||
focusedTextColor = BitwardenTheme.colorScheme.text.primary,
|
||||
unfocusedTextColor = BitwardenTheme.colorScheme.text.primary,
|
||||
@ -54,9 +45,9 @@ fun bitwardenTextFieldColors(
|
||||
handleColor = BitwardenTheme.colorScheme.stroke.border,
|
||||
backgroundColor = BitwardenTheme.colorScheme.stroke.border.copy(alpha = 0.4f),
|
||||
),
|
||||
focusedIndicatorColor = focusedBorderColor,
|
||||
unfocusedIndicatorColor = unfocusedBorderColor,
|
||||
disabledIndicatorColor = disabledBorderColor,
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
unfocusedIndicatorColor = Color.Transparent,
|
||||
disabledIndicatorColor = Color.Transparent,
|
||||
errorIndicatorColor = BitwardenTheme.colorScheme.status.error,
|
||||
focusedLeadingIconColor = BitwardenTheme.colorScheme.icon.primary,
|
||||
unfocusedLeadingIconColor = BitwardenTheme.colorScheme.icon.primary,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user