diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt index 63bd8f7af..477875aa6 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordgenerator/MasterPasswordGeneratorScreen.kt @@ -12,7 +12,6 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.SnackbarDuration -import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults @@ -37,6 +36,7 @@ import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledButtonWi import com.x8bit.bitwarden.ui.platform.components.button.BitwardenTextButton import com.x8bit.bitwarden.ui.platform.components.field.BitwardenTextField import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold +import com.x8bit.bitwarden.ui.platform.components.snackbar.BitwardenSnackbarHost import com.x8bit.bitwarden.ui.platform.components.text.BitwardenClickableText import com.x8bit.bitwarden.ui.platform.components.util.nonLetterColorVisualTransformation import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter @@ -100,7 +100,7 @@ fun MasterPasswordGeneratorScreen( ) }, snackbarHost = { - SnackbarHost(hostState = snackbarHostState) + BitwardenSnackbarHost(hostState = snackbarHostState) }, ) { innerPadding -> Column( diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/snackbar/BitwardenSnackbarHost.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/snackbar/BitwardenSnackbarHost.kt new file mode 100644 index 000000000..fae7e0a7c --- /dev/null +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/snackbar/BitwardenSnackbarHost.kt @@ -0,0 +1,34 @@ +package com.x8bit.bitwarden.ui.platform.components.snackbar + +import androidx.compose.material3.Snackbar +import androidx.compose.material3.SnackbarHost +import androidx.compose.material3.SnackbarHostState +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme + +/** + * A custom Bitwarden-themed snackbar. + * + * @param hostState The state of this snackbar. + * @param modifier The [Modifier] to be applied to this radio button. + */ +@Composable +fun BitwardenSnackbarHost( + hostState: SnackbarHostState, + modifier: Modifier = Modifier, +) { + SnackbarHost( + hostState = hostState, + modifier = modifier, + ) { + Snackbar( + snackbarData = it, + containerColor = BitwardenTheme.colorScheme.background.alert, + contentColor = BitwardenTheme.colorScheme.text.reversed, + actionColor = BitwardenTheme.colorScheme.background.alert, + actionContentColor = BitwardenTheme.colorScheme.icon.reversed, + dismissActionContentColor = BitwardenTheme.colorScheme.icon.reversed, + ) + } +} 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 5fc07dd5a..0cb709c3d 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 @@ -13,7 +13,6 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.SnackbarDuration -import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarScrollBehavior @@ -52,6 +51,7 @@ import com.x8bit.bitwarden.ui.platform.components.header.BitwardenListHeaderText import com.x8bit.bitwarden.ui.platform.components.model.TooltipData import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold import com.x8bit.bitwarden.ui.platform.components.slider.BitwardenSlider +import com.x8bit.bitwarden.ui.platform.components.snackbar.BitwardenSnackbarHost import com.x8bit.bitwarden.ui.platform.components.stepper.BitwardenStepper import com.x8bit.bitwarden.ui.platform.components.toggle.BitwardenWideSwitch import com.x8bit.bitwarden.ui.platform.components.util.nonLetterColorVisualTransformation @@ -215,7 +215,7 @@ fun GeneratorScreen( } }, snackbarHost = { - SnackbarHost(hostState = snackbarHostState) + BitwardenSnackbarHost(hostState = snackbarHostState) }, modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection), ) { innerPadding ->