From cc02c30b8eabaf73ed6f5d451a6c8c8749b2aa78 Mon Sep 17 00:00:00 2001 From: Alex Vanyo Date: Wed, 13 Mar 2024 14:34:28 -0700 Subject: [PATCH] Update material3-adaptive to 1.0.0-alpha08 Change-Id: Ic218c6b061b5cea4e56b544073541421862bc1d0 --- app/build.gradle.kts | 2 ++ .../interests2pane/InterestsListDetailScreen.kt | 17 +++++++++-------- gradle/libs.versions.toml | 8 +++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 12ac3ded3..9e68ffa7d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -90,6 +90,8 @@ dependencies { implementation(libs.androidx.activity.compose) implementation(libs.androidx.compose.material3.adaptive) + implementation(libs.androidx.compose.material3.adaptive.layout) + implementation(libs.androidx.compose.material3.adaptive.navigation) implementation(libs.androidx.compose.material3.windowSizeClass) implementation(libs.androidx.compose.runtime.tracing) implementation(libs.androidx.core.ktx) diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt index 98327923f..b3594b81f 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt +++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/interests2pane/InterestsListDetailScreen.kt @@ -20,11 +20,11 @@ import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Box import androidx.compose.material3.Text import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi -import androidx.compose.material3.adaptive.ListDetailPaneScaffold -import androidx.compose.material3.adaptive.ListDetailPaneScaffoldRole -import androidx.compose.material3.adaptive.PaneAdaptedValue -import androidx.compose.material3.adaptive.ThreePaneScaffoldNavigator -import androidx.compose.material3.adaptive.rememberListDetailPaneScaffoldNavigator +import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffold +import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffoldRole +import androidx.compose.material3.adaptive.layout.PaneAdaptedValue +import androidx.compose.material3.adaptive.navigation.ThreePaneScaffoldNavigator +import androidx.compose.material3.adaptive.navigation.rememberListDetailPaneScaffoldNavigator import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -93,7 +93,8 @@ internal fun InterestsListDetailScreen( } ListDetailPaneScaffold( - scaffoldState = listDetailNavigator.scaffoldState, + value = listDetailNavigator.scaffoldValue, + directive = listDetailNavigator.scaffoldDirective, listPane = { InterestsRoute( onTopicClick = ::onTopicClickShowDetailPane, @@ -129,8 +130,8 @@ internal fun InterestsListDetailScreen( @OptIn(ExperimentalMaterial3AdaptiveApi::class) private fun ThreePaneScaffoldNavigator.isListPaneVisible(): Boolean = - scaffoldState.scaffoldValue[ListDetailPaneScaffoldRole.List] == PaneAdaptedValue.Expanded + scaffoldValue[ListDetailPaneScaffoldRole.List] == PaneAdaptedValue.Expanded @OptIn(ExperimentalMaterial3AdaptiveApi::class) private fun ThreePaneScaffoldNavigator.isDetailPaneVisible(): Boolean = - scaffoldState.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded + scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f3258c70e..13e81df64 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,9 +7,9 @@ androidTools = "31.3.0" androidxActivity = "1.8.0" androidxAppCompat = "1.6.1" androidxBrowser = "1.8.0" -androidxComposeBom = "2024.02.01" +androidxComposeBom = "2024.02.02" androidxComposeCompiler = "1.5.8" -androidxComposeMaterial3Adaptive = "1.0.0-alpha06" +androidxComposeMaterial3Adaptive = "1.0.0-alpha08" androidxComposeRuntimeTracing = "1.0.0-beta01" androidxCore = "1.12.0" androidxCoreSplashscreen = "1.0.1" @@ -71,7 +71,9 @@ androidx-compose-foundation = { group = "androidx.compose.foundation", name = "f androidx-compose-foundation-layout = { group = "androidx.compose.foundation", name = "foundation-layout" } androidx-compose-material-iconsExtended = { group = "androidx.compose.material", name = "material-icons-extended" } androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" } -androidx-compose-material3-adaptive = { group = "androidx.compose.material3", name = "material3-adaptive", version.ref = "androidxComposeMaterial3Adaptive" } +androidx-compose-material3-adaptive = { group = "androidx.compose.material3.adaptive", name = "adaptive", version.ref = "androidxComposeMaterial3Adaptive" } +androidx-compose-material3-adaptive-layout = { group = "androidx.compose.material3.adaptive", name = "adaptive-layout", version.ref = "androidxComposeMaterial3Adaptive" } +androidx-compose-material3-adaptive-navigation = { group = "androidx.compose.material3.adaptive", name = "adaptive-navigation", version.ref = "androidxComposeMaterial3Adaptive" } androidx-compose-material3-windowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" } androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime" } androidx-compose-runtime-tracing = { group = "androidx.compose.runtime", name = "runtime-tracing", version.ref = "androidxComposeRuntimeTracing" }