From e62dc5dd2107cdf52a41f5c1e514a2bc260632ce Mon Sep 17 00:00:00 2001 From: David Perez Date: Mon, 7 Oct 2024 12:58:00 -0500 Subject: [PATCH] Remove last references to MaterialTheme (#4038) --- .../ui/platform/components/appbar/BitwardenMediumTopAppBar.kt | 3 +-- .../platform/components/dialog/BitwardenTimePickerDialog.kt | 4 ++-- docs/ARCHITECTURE.md | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt index 708cfed84..1ac2d234d 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt @@ -2,7 +2,6 @@ package com.x8bit.bitwarden.ui.platform.components.appbar import androidx.compose.foundation.layout.RowScope import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MediumTopAppBar import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults @@ -59,7 +58,7 @@ fun BitwardenMediumTopAppBar( @Preview(showBackground = true) @Composable private fun BitwardenMediumTopAppBar_preview() { - MaterialTheme { + BitwardenTheme { BitwardenMediumTopAppBar( title = "Preview Title", scrollBehavior = TopAppBarDefaults diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/BitwardenTimePickerDialog.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/BitwardenTimePickerDialog.kt index a62ba48a8..dfbf38ff2 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/BitwardenTimePickerDialog.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/dialog/BitwardenTimePickerDialog.kt @@ -9,8 +9,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TimeInput @@ -144,7 +144,7 @@ private fun TimePickerDialog( properties = DialogProperties(usePlatformDefaultWidth = false), ) { Surface( - shape = MaterialTheme.shapes.extraLarge, + shape = RoundedCornerShape(28.dp), color = BitwardenTheme.colorScheme.background.primary, contentColor = BitwardenTheme.colorScheme.text.primary, modifier = Modifier diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 8a7cb469f..22321beb2 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -277,7 +277,7 @@ The following shows off the basic structure of a composable `...Screen` implemen - The VM "state" is consumed using `viewModel.stateFlow.collectAsStateWithLifecycle()`. This will cause the composable to "recompose" and update whenever updates are pushed to the `viewModel.stateFlow`. - The VM "events" are consumed using an [EventsEffect](../app/src/main/java/com/x8bit/bitwarden/ui/platform/base/util/EventsEffect.kt) and demonstrate how the `onNavigateToNextScreen` may be triggered. - The current state of the text, switch, and button are hoisted to the VM and pulled out from the `state`. User interactions with the switch and button result in "actions" being sent to the VM using `viewModel.trySendAction`. -- Reusable components (`BitwardenLoadingDialog`, `BitwardenSwitch`, and `BitwardenFilledButton`) are used where possibe in order to build the screen using the correct theming and reduce code duplication. When this is not possible (such as when rending the `Text` composable) all colors and styles are pulled from the [MaterialTheme](https://developer.android.com/reference/kotlin/androidx/compose/material/MaterialTheme) object. +- Reusable components (`BitwardenLoadingDialog`, `BitwardenSwitch`, and `BitwardenFilledButton`) are used where possible in order to build the screen using the correct theming and reduce code duplication. When this is not possible (such as when rending the `Text` composable) all colors and styles are pulled from the BitwardenTheme object.
Show example