From 3d0dd2996ef95679191d775afa88a9cc6ed381c4 Mon Sep 17 00:00:00 2001 From: David Perez Date: Tue, 24 Sep 2024 16:15:24 -0500 Subject: [PATCH] Replace usages of raw button with BitwardenFilledTonalButton (#3960) --- .../blockautofill/BlockAutoFillScreen.kt | 17 ++++------------- .../ui/tools/feature/send/SendEmpty.kt | 17 ++++------------- .../ui/vault/feature/vault/VaultNoItems.kt | 17 ++++------------- 3 files changed, 12 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/BlockAutoFillScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/BlockAutoFillScreen.kt index 1afbeabc3..573ca2acb 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/BlockAutoFillScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/BlockAutoFillScreen.kt @@ -18,8 +18,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -43,6 +41,7 @@ import com.x8bit.bitwarden.R import com.x8bit.bitwarden.ui.platform.base.util.EventsEffect import com.x8bit.bitwarden.ui.platform.base.util.bottomDivider import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenTopAppBar +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton import com.x8bit.bitwarden.ui.platform.components.fab.BitwardenFloatingActionButton import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter @@ -247,21 +246,13 @@ private fun BlockAutoFillNoItems( Spacer(modifier = Modifier.height(24.dp)) - Button( + BitwardenFilledTonalButton( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), + label = stringResource(id = R.string.new_blocked_uri), onClick = addItemClickAction, - colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.secondaryContainer, - contentColor = MaterialTheme.colorScheme.onSecondaryContainer, - ), - ) { - Text( - text = stringResource(id = R.string.new_blocked_uri), - style = MaterialTheme.typography.labelLarge, - ) - } + ) } } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/send/SendEmpty.kt b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/send/SendEmpty.kt index 9b4ffd37d..16aad11e7 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/send/SendEmpty.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/send/SendEmpty.kt @@ -8,8 +8,6 @@ import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -19,6 +17,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton import com.x8bit.bitwarden.ui.platform.components.text.BitwardenPolicyWarningText /** @@ -56,21 +55,13 @@ fun SendEmpty( Spacer(modifier = Modifier.height(24.dp)) - Button( + BitwardenFilledTonalButton( onClick = onAddItemClick, - colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.secondaryContainer, - contentColor = MaterialTheme.colorScheme.onSecondaryContainer, - ), + label = stringResource(id = R.string.add_a_send), modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), - ) { - Text( - text = stringResource(id = R.string.add_a_send), - style = MaterialTheme.typography.labelLarge, - ) - } + ) Spacer(modifier = Modifier.weight(1F)) Spacer(modifier = Modifier.navigationBarsPadding()) } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt index e6992b1b0..3ca2493da 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt @@ -9,8 +9,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -21,6 +19,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.x8bit.bitwarden.R +import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledTonalButton import com.x8bit.bitwarden.ui.platform.components.text.BitwardenPolicyWarningText import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter @@ -72,21 +71,13 @@ fun VaultNoItems( Spacer(modifier = Modifier.height(24.dp)) - Button( + BitwardenFilledTonalButton( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), + label = buttonText, onClick = addItemClickAction, - colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.secondaryContainer, - contentColor = MaterialTheme.colorScheme.onSecondaryContainer, - ), - ) { - Text( - text = buttonText, - style = MaterialTheme.typography.labelLarge, - ) - } + ) Spacer(modifier = Modifier.weight(1F)) Spacer(modifier = Modifier.navigationBarsPadding())