From 86a8865cd1390e6df57051888b96b2876494246a Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 30 Sep 2022 14:04:16 +0100 Subject: [PATCH] updating to latest material3 lib --- dependencies.gradle | 2 +- .../src/main/kotlin/app/dapk/st/design/components/Toolbar.kt | 2 +- .../src/main/kotlin/app/dapk/st/core/ActivityExtensions.kt | 2 +- .../src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 9f09a1f..7fef836 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -108,7 +108,7 @@ ext.Dependencies.with { androidxComposeUi = "androidx.compose.ui:ui:${composeVer}" androidxComposeFoundation = "androidx.compose.foundation:foundation:${composeVer}" - androidxComposeMaterial = "androidx.compose.material3:material3:1.0.0-beta01" + androidxComposeMaterial = "androidx.compose.material3:material3:1.0.0-beta03" androidxComposeIconsExtended = "androidx.compose.material:material-icons-extended:${composeVer}" androidxActivityCompose = "androidx.activity:activity-compose:1.4.0" kotlinCompilerExtensionVersion = "1.3.1" diff --git a/design-library/src/main/kotlin/app/dapk/st/design/components/Toolbar.kt b/design-library/src/main/kotlin/app/dapk/st/design/components/Toolbar.kt index dbcb390..ec0010e 100644 --- a/design-library/src/main/kotlin/app/dapk/st/design/components/Toolbar.kt +++ b/design-library/src/main/kotlin/app/dapk/st/design/components/Toolbar.kt @@ -19,7 +19,7 @@ fun Toolbar( actions: @Composable RowScope.() -> Unit = {} ) { val navigationIcon = foo(onNavigate) - SmallTopAppBar( + TopAppBar( modifier = offset?.let { Modifier.offset(it) } ?: Modifier, colors = TopAppBarDefaults.smallTopAppBarColors( containerColor = MaterialTheme.colorScheme.background diff --git a/domains/android/compose-core/src/main/kotlin/app/dapk/st/core/ActivityExtensions.kt b/domains/android/compose-core/src/main/kotlin/app/dapk/st/core/ActivityExtensions.kt index 8762808..e84d5da 100644 --- a/domains/android/compose-core/src/main/kotlin/app/dapk/st/core/ActivityExtensions.kt +++ b/domains/android/compose-core/src/main/kotlin/app/dapk/st/core/ActivityExtensions.kt @@ -10,7 +10,7 @@ inline fun ComponentActivity.viewModel( ): Lazy { val factoryPromise = object : Factory { @Suppress("UNCHECKED_CAST") - override fun create(modelClass: Class) = when (modelClass) { + override fun create(modelClass: Class) = when (modelClass) { VM::class.java -> factory() as T else -> throw Error() } diff --git a/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt b/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt index ee891ff..9fe5472 100644 --- a/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt +++ b/features/messenger/src/main/kotlin/app/dapk/st/messenger/MessengerScreen.kt @@ -37,7 +37,10 @@ import app.dapk.st.core.LifecycleEffect import app.dapk.st.core.StartObserving import app.dapk.st.core.components.CenteredLoading import app.dapk.st.core.extensions.takeIfContent -import app.dapk.st.design.components.* +import app.dapk.st.design.components.MessengerUrlIcon +import app.dapk.st.design.components.MissingAvatarIcon +import app.dapk.st.design.components.SmallTalkTheme +import app.dapk.st.design.components.Toolbar import app.dapk.st.matrix.common.RoomId import app.dapk.st.matrix.common.UserId import app.dapk.st.matrix.sync.MessageMeta