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