Remove last references to MaterialTheme (#4038)

This commit is contained in:
David Perez 2024-10-07 12:58:00 -05:00 committed by GitHub
parent f8592f4e17
commit e62dc5dd21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View file

@ -2,7 +2,6 @@ package com.x8bit.bitwarden.ui.platform.components.appbar
import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.RowScope
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MediumTopAppBar import androidx.compose.material3.MediumTopAppBar
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
@ -59,7 +58,7 @@ fun BitwardenMediumTopAppBar(
@Preview(showBackground = true) @Preview(showBackground = true)
@Composable @Composable
private fun BitwardenMediumTopAppBar_preview() { private fun BitwardenMediumTopAppBar_preview() {
MaterialTheme { BitwardenTheme {
BitwardenMediumTopAppBar( BitwardenMediumTopAppBar(
title = "Preview Title", title = "Preview Title",
scrollBehavior = TopAppBarDefaults scrollBehavior = TopAppBarDefaults

View file

@ -9,8 +9,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TimeInput import androidx.compose.material3.TimeInput
@ -144,7 +144,7 @@ private fun TimePickerDialog(
properties = DialogProperties(usePlatformDefaultWidth = false), properties = DialogProperties(usePlatformDefaultWidth = false),
) { ) {
Surface( Surface(
shape = MaterialTheme.shapes.extraLarge, shape = RoundedCornerShape(28.dp),
color = BitwardenTheme.colorScheme.background.primary, color = BitwardenTheme.colorScheme.background.primary,
contentColor = BitwardenTheme.colorScheme.text.primary, contentColor = BitwardenTheme.colorScheme.text.primary,
modifier = Modifier modifier = Modifier

View file

@ -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 "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 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`. - 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.
<details> <details>
<summary>Show example</summary> <summary>Show example</summary>