From e80585f77e52984bae3b3910cc3898fb317887e8 Mon Sep 17 00:00:00 2001 From: David Perez Date: Thu, 24 Oct 2024 13:21:38 -0500 Subject: [PATCH] PM-13937: Update button padding, remove unused buttons, and rename button (#4151) --- .../button/BitwardenFilledButton.kt | 6 +- .../button/BitwardenFilledTonalButton.kt | 92 ------------------- .../button/BitwardenOutlinedButton.kt | 6 +- .../components/button/BitwardenTextButton.kt | 19 +++- ...nButton.kt => BitwardenTonalIconButton.kt} | 12 +-- .../button/color/BitwardenButtonColors.kt | 11 --- .../button/color/BitwardenIconButtonColors.kt | 22 ++--- .../BitwardenPasswordFieldWithActions.kt | 4 +- .../components/stepper/BitwardenStepper.kt | 6 +- .../theme/color/BitwardenColorScheme.kt | 12 --- .../ui/platform/theme/color/ColorScheme.kt | 18 ---- .../feature/generator/GeneratorScreen.kt | 6 +- .../addedit/VaultAddEditCustomField.kt | 10 +- .../feature/addedit/VaultAddEditLoginItems.kt | 14 +-- .../feature/addedit/VaultAddEditUriItem.kt | 4 +- .../feature/item/VaultItemCardContent.kt | 6 +- .../feature/item/VaultItemCustomField.kt | 6 +- .../feature/item/VaultItemLoginContent.kt | 14 +-- 18 files changed, 77 insertions(+), 191 deletions(-) delete mode 100644 app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledTonalButton.kt rename app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/{BitwardenFilledIconButton.kt => BitwardenTonalIconButton.kt} (86%) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledButton.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledButton.kt index b52858f5a..de4ae9210 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledButton.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledButton.kt @@ -42,8 +42,10 @@ fun BitwardenFilledButton( onClick = onClick, enabled = isEnabled, contentPadding = PaddingValues( - vertical = 10.dp, - horizontal = 24.dp, + top = 10.dp, + bottom = 10.dp, + start = if (icon == null) 24.dp else 16.dp, + end = 24.dp, ), colors = colors, ) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledTonalButton.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledTonalButton.kt deleted file mode 100644 index 1b649ca6e..000000000 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledTonalButton.kt +++ /dev/null @@ -1,92 +0,0 @@ -package com.x8bit.bitwarden.ui.platform.components.button - -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.width -import androidx.compose.material3.Button -import androidx.compose.material3.Icon -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.painter.Painter -import androidx.compose.ui.semantics.semantics -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp -import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.color.bitwardenFilledTonalButtonColors -import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter -import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme - -/** - * A filled tonal button for the Bitwarden UI with a customized appearance. - * - * @param label The text to be displayed on the button. - * @param icon The icon for the button. - * @param onClick A lambda which will be invoked when the button is clicked. - * @param isEnabled Whether or not the button is enabled. - * @param modifier A [Modifier] for this composable, allowing for adjustments to its appearance - * or behavior. This can be used to apply padding, layout, and other Modifiers. - */ -@Composable -fun BitwardenFilledTonalButton( - label: String, - onClick: () -> Unit, - modifier: Modifier = Modifier, - icon: Painter? = null, - isEnabled: Boolean = true, -) { - Button( - modifier = modifier.semantics(mergeDescendants = true) { }, - onClick = onClick, - contentPadding = PaddingValues( - vertical = 10.dp, - horizontal = 24.dp, - ), - enabled = isEnabled, - colors = bitwardenFilledTonalButtonColors(), - ) { - icon?.let { - Icon( - painter = icon, - contentDescription = null, - ) - Spacer(modifier = Modifier.width(8.dp)) - } - Text( - text = label, - style = BitwardenTheme.typography.labelLarge, - ) - } -} - -@Preview(showBackground = true) -@Composable -private fun BitwardenFilledTonalButton_preview() { - Column { - BitwardenFilledTonalButton( - label = "Label", - onClick = {}, - icon = null, - isEnabled = true, - ) - BitwardenFilledTonalButton( - label = "Label", - onClick = {}, - icon = rememberVectorPainter(id = R.drawable.ic_question_circle), - isEnabled = true, - ) - BitwardenFilledTonalButton( - label = "Label", - onClick = {}, - icon = null, - isEnabled = false, - ) - BitwardenFilledTonalButton( - label = "Label", - onClick = {}, - icon = rememberVectorPainter(id = R.drawable.ic_question_circle), - isEnabled = false, - ) - } -} diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenOutlinedButton.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenOutlinedButton.kt index d30a5ba0c..f3bbad1b1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenOutlinedButton.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenOutlinedButton.kt @@ -45,8 +45,10 @@ fun BitwardenOutlinedButton( onClick = onClick, enabled = isEnabled, contentPadding = PaddingValues( - vertical = 10.dp, - horizontal = 24.dp, + top = 10.dp, + bottom = 10.dp, + start = if (icon == null) 24.dp else 16.dp, + end = 24.dp, ), colors = colors.materialButtonColors, border = BorderStroke( diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTextButton.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTextButton.kt index f243e5bf2..1c736c47c 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTextButton.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTextButton.kt @@ -2,11 +2,15 @@ package com.x8bit.bitwarden.ui.platform.components.button import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.width +import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.semantics.semantics import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -19,6 +23,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme * @param label The label for the button. * @param onClick The callback when the button is clicked. * @param modifier The [Modifier] to be applied to the button. + * @param icon The icon for the button. * @param labelTextColor The color for the label text. */ @Composable @@ -26,6 +31,7 @@ fun BitwardenTextButton( label: String, onClick: () -> Unit, modifier: Modifier = Modifier, + icon: Painter? = null, isEnabled: Boolean = true, labelTextColor: Color = BitwardenTheme.colorScheme.outlineButton.foreground, ) { @@ -34,11 +40,20 @@ fun BitwardenTextButton( onClick = onClick, enabled = isEnabled, contentPadding = PaddingValues( - vertical = 10.dp, - horizontal = 24.dp, + top = 10.dp, + bottom = 10.dp, + start = 12.dp, + end = if (icon == null) 12.dp else 16.dp, ), colors = bitwardenTextButtonColors(contentColor = labelTextColor), ) { + icon?.let { + Icon( + painter = icon, + contentDescription = null, + ) + Spacer(modifier = Modifier.width(8.dp)) + } Text( text = label, style = BitwardenTheme.typography.labelLarge, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledIconButton.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTonalIconButton.kt similarity index 86% rename from app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledIconButton.kt rename to app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTonalIconButton.kt index 1f8564e9d..49418d2d9 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenFilledIconButton.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/BitwardenTonalIconButton.kt @@ -8,12 +8,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.semantics.semantics import androidx.compose.ui.tooling.preview.Preview import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.color.bitwardenFilledIconButtonColors +import com.x8bit.bitwarden.ui.platform.components.button.color.bitwardenTonalIconButtonColors import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme /** - * A filled icon button that displays an icon. + * A tonal icon button that displays an icon. * * @param vectorIconRes Icon to display on the button. * @param contentDescription The content description for this icon button. @@ -22,7 +22,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme * @param isEnabled Whether or not the button should be enabled. */ @Composable -fun BitwardenFilledIconButton( +fun BitwardenTonalIconButton( @DrawableRes vectorIconRes: Int, contentDescription: String, onClick: () -> Unit, @@ -32,7 +32,7 @@ fun BitwardenFilledIconButton( FilledIconButton( modifier = modifier.semantics(mergeDescendants = true) {}, onClick = onClick, - colors = bitwardenFilledIconButtonColors(), + colors = bitwardenTonalIconButtonColors(), enabled = isEnabled, ) { Icon( @@ -44,9 +44,9 @@ fun BitwardenFilledIconButton( @Preview(showBackground = true) @Composable -private fun BitwardenFilledIconButton_preview() { +private fun BitwardenTonalIconButton_preview() { BitwardenTheme { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_question_circle, contentDescription = "Sample Icon", onClick = {}, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenButtonColors.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenButtonColors.kt index 804aa05b0..28f673df9 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenButtonColors.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenButtonColors.kt @@ -28,17 +28,6 @@ fun bitwardenFilledErrorButtonColors() = ButtonColors( disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled, ) -/** - * Provides a default set of Bitwarden-styled colors for a tonal button. - */ -@Composable -fun bitwardenFilledTonalButtonColors(): ButtonColors = ButtonColors( - containerColor = BitwardenTheme.colorScheme.tonalButton.background, - contentColor = BitwardenTheme.colorScheme.tonalButton.foreground, - disabledContainerColor = BitwardenTheme.colorScheme.tonalButton.backgroundDisabled, - disabledContentColor = BitwardenTheme.colorScheme.tonalButton.foregroundDisabled, -) - /** * Provides a default set of Bitwarden-styled colors for an outlined button. */ diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenIconButtonColors.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenIconButtonColors.kt index c13ec0e9b..b27d01800 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenIconButtonColors.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/button/color/BitwardenIconButtonColors.kt @@ -5,17 +5,6 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme -/** - * Provides a default set of Bitwarden-styled colors for a filled icon button. - */ -@Composable -fun bitwardenFilledIconButtonColors(): IconButtonColors = IconButtonColors( - containerColor = BitwardenTheme.colorScheme.background.tertiary, - contentColor = BitwardenTheme.colorScheme.filledButton.foregroundReversed, - disabledContainerColor = BitwardenTheme.colorScheme.filledButton.backgroundDisabled, - disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled, -) - /** * Provides a default set of Bitwarden-styled colors for a standard icon button. */ @@ -28,3 +17,14 @@ fun bitwardenStandardIconButtonColors( disabledContainerColor = Color.Transparent, disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled, ) + +/** + * Provides a default set of Bitwarden-styled colors for a filled icon button. + */ +@Composable +fun bitwardenTonalIconButtonColors(): IconButtonColors = IconButtonColors( + containerColor = BitwardenTheme.colorScheme.background.tertiary, + contentColor = BitwardenTheme.colorScheme.filledButton.foregroundReversed, + disabledContainerColor = BitwardenTheme.colorScheme.filledButton.backgroundDisabled, + disabledContentColor = BitwardenTheme.colorScheme.filledButton.foregroundDisabled, +) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt index 058f96d88..42c9eeb03 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/field/BitwardenPasswordFieldWithActions.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.semantics.testTag import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme /** @@ -130,7 +130,7 @@ private fun BitwardenPasswordFieldWithActions_preview() { value = "samplePassword", onValueChange = {}, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_check_mark, contentDescription = "", onClick = {}, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt index 97976021f..101513d90 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/stepper/BitwardenStepper.kt @@ -8,7 +8,7 @@ import androidx.compose.ui.text.input.KeyboardType import com.x8bit.bitwarden.R import com.x8bit.bitwarden.ui.platform.base.util.ZERO_WIDTH_CHARACTER import com.x8bit.bitwarden.ui.platform.base.util.orNullIfBlank -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextFieldWithActions /** @@ -54,7 +54,7 @@ fun BitwardenStepper( value = clampedValue?.toString() ?: ZERO_WIDTH_CHARACTER, actionsTestTag = stepperActionsTestTag, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_minus, contentDescription = "\u2212", onClick = { @@ -68,7 +68,7 @@ fun BitwardenStepper( decreaseButtonTestTag?.let { testTag = it } }, ) - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_plus, contentDescription = "+", onClick = { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/BitwardenColorScheme.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/BitwardenColorScheme.kt index 20409dc46..ce9b26e9a 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/BitwardenColorScheme.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/BitwardenColorScheme.kt @@ -14,7 +14,6 @@ data class BitwardenColorScheme( val icon: IconColors, val filledButton: FilledButtonColors, val outlineButton: OutlineButtonColors, - val tonalButton: TonalButtonColors, val toggleButton: ToggleButtonColors, val sliderButton: SliderButtonColors, val status: StatusColors, @@ -93,17 +92,6 @@ data class BitwardenColorScheme( val foregroundReversed: Color, ) - /** - * Defines all the tonal button colors for the app. - */ - @Immutable - data class TonalButtonColors( - val background: Color, - val backgroundDisabled: Color, - val foreground: Color, - val foregroundDisabled: Color, - ) - /** * Defines all the toggle colors for the app. */ diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/ColorScheme.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/ColorScheme.kt index 5418df77c..15de7e7d6 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/ColorScheme.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/theme/color/ColorScheme.kt @@ -51,12 +51,6 @@ val darkBitwardenColorScheme: BitwardenColorScheme = BitwardenColorScheme( foregroundDisabled = PrimitiveColors.gray900, foregroundReversed = PrimitiveColors.gray1100, ), - tonalButton = BitwardenColorScheme.TonalButtonColors( - background = PrimitiveColors.gray900, - backgroundDisabled = PrimitiveColors.gray900, - foreground = PrimitiveColors.gray200, - foregroundDisabled = PrimitiveColors.gray500, - ), toggleButton = BitwardenColorScheme.ToggleButtonColors( backgroundOn = PrimitiveColors.blue400, backgroundOff = PrimitiveColors.gray900, @@ -125,12 +119,6 @@ val lightBitwardenColorScheme: BitwardenColorScheme = BitwardenColorScheme( foregroundDisabled = PrimitiveColors.gray500, foregroundReversed = PrimitiveColors.gray100, ), - tonalButton = BitwardenColorScheme.TonalButtonColors( - background = PrimitiveColors.blue100, - backgroundDisabled = PrimitiveColors.gray400, - foreground = PrimitiveColors.gray1300, - foregroundDisabled = PrimitiveColors.gray500, - ), toggleButton = BitwardenColorScheme.ToggleButtonColors( backgroundOn = PrimitiveColors.blue500, backgroundOff = PrimitiveColors.gray500, @@ -205,12 +193,6 @@ fun dynamicBitwardenColorScheme( foregroundDisabled = materialColorScheme.onSurface, foregroundReversed = materialColorScheme.inversePrimary, ), - tonalButton = BitwardenColorScheme.TonalButtonColors( - background = materialColorScheme.primary, - backgroundDisabled = materialColorScheme.onSurface.copy(alpha = 0.12f), - foreground = materialColorScheme.onPrimary, - foregroundDisabled = materialColorScheme.onSurface.copy(alpha = 0.38f), - ), toggleButton = BitwardenColorScheme.ToggleButtonColors( backgroundOn = materialColorScheme.primary, backgroundOff = materialColorScheme.surfaceContainerHighest, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt index 043ddbdb6..d700d51d5 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/GeneratorScreen.kt @@ -39,8 +39,8 @@ import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenMediumTopAppBa import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenTopAppBar import com.x8bit.bitwarden.ui.platform.components.appbar.action.BitwardenOverflowActionItem import com.x8bit.bitwarden.ui.platform.components.appbar.action.OverflowMenuItemData -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTextButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.card.BitwardenInfoCalloutCard import com.x8bit.bitwarden.ui.platform.components.dropdown.BitwardenMultiSelectButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordField @@ -374,13 +374,13 @@ private fun GeneratedStringItem( value = generatedText, singleLine = false, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy), onClick = onCopyClick, modifier = Modifier.testTag("CopyValueButton"), ) - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_generate, contentDescription = stringResource(id = R.string.generate_password), onClick = onRegenerateClick, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt index 7b29d7827..55b235cae 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditCustomField.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.semantics import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenSelectionDialog import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenTextEntryDialog import com.x8bit.bitwarden.ui.platform.components.dialog.row.BitwardenBasicDialogRow @@ -155,7 +155,7 @@ private fun CustomFieldBoolean( BitwardenRowOfActions( actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_cog, contentDescription = stringResource(id = R.string.edit), onClick = onEditValue, @@ -190,7 +190,7 @@ private fun CustomFieldHiddenField( singleLine = true, modifier = modifier, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_cog, contentDescription = stringResource(id = R.string.edit), onClick = onEditValue, @@ -217,7 +217,7 @@ private fun CustomFieldTextField( singleLine = true, modifier = modifier, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_cog, contentDescription = stringResource(id = R.string.edit), onClick = onEditValue, @@ -262,7 +262,7 @@ private fun CustomFieldLinkedField( BitwardenRowOfActions( actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_cog, contentDescription = stringResource(id = R.string.edit), onClick = onEditValue, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt index 57ea308b9..ff09160ce 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditLoginItems.kt @@ -18,9 +18,9 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R import com.x8bit.bitwarden.ui.platform.base.util.Text -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton import com.x8bit.bitwarden.ui.platform.components.button.BitwardenOutlinedButton import com.x8bit.bitwarden.ui.platform.components.button.BitwardenStandardIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenTwoButtonDialog import com.x8bit.bitwarden.ui.platform.components.dropdown.BitwardenMultiSelectButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenHiddenPasswordField @@ -124,14 +124,14 @@ fun LazyListScope.vaultAddEditLoginItems( readOnly = true, singleLine = true, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy_totp), onClick = { loginItemTypeHandlers.onCopyTotpKeyClick(loginState.totp) }, ) - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_camera, contentDescription = stringResource(id = R.string.camera), onClick = onTotpSetupClick, @@ -377,7 +377,7 @@ private fun UsernameRow( value = username, onValueChange = loginItemTypeHandlers.onUsernameTextChange, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_generate, contentDescription = stringResource(id = R.string.generate_username), onClick = { @@ -444,13 +444,13 @@ private fun PasswordRow( .fillMaxWidth() .padding(horizontal = 16.dp), ) { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_check_mark, contentDescription = stringResource(id = R.string.check_password), onClick = loginItemTypeHandlers.onPasswordCheckerClick, modifier = Modifier.testTag(tag = "CheckPasswordButton"), ) - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_generate, contentDescription = stringResource(id = R.string.generate_password), onClick = { @@ -513,7 +513,7 @@ private fun PasskeyField( modifier = modifier, actions = { if (canRemovePasskey) { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_minus, contentDescription = stringResource(id = R.string.remove_passkey), onClick = loginItemTypeHandlers.onClearFido2CredentialClick, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditUriItem.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditUriItem.kt index 7d2da048b..e4d8a24e5 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditUriItem.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditUriItem.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenSelectionDialog import com.x8bit.bitwarden.ui.platform.components.dialog.row.BitwardenBasicDialogRow import com.x8bit.bitwarden.ui.platform.components.dialog.row.BitwardenSelectionRow @@ -39,7 +39,7 @@ fun VaultAddEditUriItem( value = uriItem.uri.orEmpty(), onValueChange = { onUriValueChange(uriItem.copy(uri = it)) }, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_cog, contentDescription = stringResource(id = R.string.options), onClick = { shouldShowOptionsDialog = true }, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt index c4c927724..29d25f365 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordFieldWithActions import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField import com.x8bit.bitwarden.ui.platform.components.header.BitwardenListHeaderText @@ -85,7 +85,7 @@ fun VaultItemCardContent( readOnly = true, singleLine = false, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy_number), onClick = vaultCardItemTypeHandlers.onCopyNumberClick, @@ -147,7 +147,7 @@ fun VaultItemCardContent( readOnly = true, singleLine = false, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy_security_code), onClick = vaultCardItemTypeHandlers.onCopySecurityCodeClick, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCustomField.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCustomField.kt index 0c4011377..66cb5be6c 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCustomField.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCustomField.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordFieldWithActions import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextFieldWithActions @@ -47,7 +47,7 @@ fun CustomField( modifier = modifier, actions = { if (customField.isCopyable) { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy), onClick = { onCopyCustomHiddenField(customField.value) }, @@ -82,7 +82,7 @@ fun CustomField( modifier = modifier, actions = { if (customField.isCopyable) { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy), onClick = { onCopyCustomTextField(customField.value) }, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt index eb1e7c87c..308741fb3 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R -import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledIconButton +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTonalIconButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenHiddenPasswordField import com.x8bit.bitwarden.ui.platform.components.field.BitwardenPasswordFieldWithActions import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField @@ -303,7 +303,7 @@ private fun PasswordField( readOnly = true, singleLine = false, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_check_mark, contentDescription = stringResource( id = R.string.check_known_data_breaches_for_this_password, @@ -311,7 +311,7 @@ private fun PasswordField( onClick = onCheckForBreachClick, modifier = Modifier.testTag(tag = "LoginCheckPasswordButton"), ) - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy_password), onClick = onCopyPasswordClick, @@ -377,7 +377,7 @@ private fun TotpField( timeLeftSeconds = totpCodeItemData.timeLeftSeconds, periodSeconds = totpCodeItemData.periodSeconds, ) - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy_totp), onClick = onCopyTotpClick, @@ -416,7 +416,7 @@ private fun UriField( singleLine = false, actions = { if (uriData.isLaunchable) { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_external_link, contentDescription = stringResource(id = R.string.launch), onClick = { onLaunchUriClick(uriData.uri) }, @@ -424,7 +424,7 @@ private fun UriField( ) } if (uriData.isCopyable) { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy), onClick = { onCopyUriClick(uriData.uri) }, @@ -450,7 +450,7 @@ private fun UsernameField( readOnly = true, singleLine = false, actions = { - BitwardenFilledIconButton( + BitwardenTonalIconButton( vectorIconRes = R.drawable.ic_copy, contentDescription = stringResource(id = R.string.copy_username), onClick = onCopyUsernameClick,