From 242cc58a7981319c9bfc71ae8b2926ca7b397594 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 2 Sep 2024 16:29:44 +0200 Subject: [PATCH 1/9] Update project to Material Adaptive Library 3 v 1.1.0-alpha01 --- .../list-detail-compose/app/build.gradle | 29 +-- .../listdetailcompose/ui/ListDetailSample.kt | 194 ++++++++++++++---- .../app/src/main/res/drawable/ic_food.xml | 5 + .../app/src/main/res/drawable/ic_no_food.xml | 5 + .../list-detail-compose/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 177 insertions(+), 62 deletions(-) create mode 100644 CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_food.xml create mode 100644 CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_no_food.xml diff --git a/CanonicalLayouts/list-detail-compose/app/build.gradle b/CanonicalLayouts/list-detail-compose/app/build.gradle index 1f3218b5e..4314c4f8d 100644 --- a/CanonicalLayouts/list-detail-compose/app/build.gradle +++ b/CanonicalLayouts/list-detail-compose/app/build.gradle @@ -20,12 +20,12 @@ plugins { android { namespace 'com.example.listdetailcompose' - compileSdk 34 + compileSdk 35 defaultConfig { applicationId "com.example.listdetailcompose" minSdk 21 - targetSdk 34 + targetSdk 35 versionCode 1 versionName "1.0" @@ -62,21 +62,22 @@ android { } dependencies { - def composeBom = platform('androidx.compose:compose-bom:2024.03.00') + def composeBom = platform('androidx.compose:compose-bom:2024.08.00') implementation(composeBom) implementation "com.google.accompanist:accompanist-adaptive:0.32.0" - implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' - implementation 'androidx.activity:activity-compose:1.8.2' - implementation "androidx.compose.foundation:foundation:1.6.4" - implementation "androidx.compose.ui:ui:1.6.4" + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4' + implementation 'androidx.activity:activity-compose:1.9.1' + implementation "androidx.compose.foundation:foundation:1.6.8" + implementation "androidx.compose.ui:ui:1.6.8" implementation "androidx.compose.ui:ui-tooling-preview" - implementation "androidx.window:window:1.2.0" - implementation 'androidx.compose.material3:material3:1.3.0-alpha03' - implementation 'androidx.compose.material3.adaptive:adaptive:1.0.0-alpha09' - implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.0.0-alpha09' - implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.0.0-alpha09' - implementation "androidx.compose.material3:material3-window-size-class:1.3.0-alpha03" + implementation "androidx.window:window:1.3.0" + implementation 'androidx.compose.material3:material3:1.3.0-rc01' + implementation 'androidx.compose.material3.adaptive:adaptive:1.1.0-alpha01' + implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.1.0-alpha01' + implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.1.0-alpha01' + implementation "androidx.compose.material3:material3-window-size-class:1.3.0-rc01" + implementation "androidx.compose.animation:animation:1.7.0-rc01" testImplementation 'junit:junit:4.13.2' } diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index cc17b4eb5..73669cebc 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -14,14 +14,24 @@ * limitations under the License. */ +@file:OptIn(ExperimentalSharedTransitionApi::class) + package com.example.listdetailcompose.ui +import android.annotation.SuppressLint import androidx.activity.compose.BackHandler +import androidx.annotation.DrawableRes +import androidx.compose.animation.AnimatedVisibilityScope +import androidx.compose.animation.ExperimentalSharedTransitionApi +import androidx.compose.animation.SharedTransitionLayout +import androidx.compose.animation.SharedTransitionScope import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.Image import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn @@ -35,9 +45,13 @@ import androidx.compose.material3.CardDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi +import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo +import androidx.compose.material3.adaptive.layout.AnimatedPane 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.layout.PaneExpansionDragHandle +import androidx.compose.material3.adaptive.layout.rememberPaneExpansionState import androidx.compose.material3.adaptive.navigation.rememberListDetailPaneScaffoldNavigator import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -45,8 +59,11 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.window.core.layout.WindowWidthSizeClass import com.example.listdetailcompose.R // Create some simple sample data @@ -56,59 +73,84 @@ private val loremIpsum = """ |Tempus quam pellentesque nec nam aliquam. Praesent semper feugiat nibh sed. Adipiscing elit duis tristique sollicitudin nibh sit. Netus et malesuada fames ac turpis egestas sed tempus urna. Quis varius quam quisque id diam vel quam. Urna duis convallis convallis tellus id interdum velit laoreet. Id eu nisl nunc mi ipsum. Fermentum dui faucibus in ornare. Nunc lobortis mattis aliquam faucibus. Vulputate mi sit amet mauris commodo quis. Porta nibh venenatis cras sed. Vitae tortor condimentum lacinia quis vel eros donec. Eu non diam phasellus vestibulum. """.trimMargin() private val sampleWords = listOf( - "Apple" to loremIpsum, - "Banana" to loremIpsum, - "Cherry" to loremIpsum, - "Date" to loremIpsum, - "Elderberry" to loremIpsum, - "Fig" to loremIpsum, - "Grape" to loremIpsum, - "Honeydew" to loremIpsum, -).map { (word, definition) -> DefinedWord(word, definition) } + "Apple" to R.drawable.ic_food, + "Banana" to R.drawable.ic_no_food, + "Cherry" to R.drawable.ic_food, + "Date" to R.drawable.ic_no_food, + "Elderberry" to R.drawable.ic_food, + "Fig" to R.drawable.ic_no_food, + "Grape" to R.drawable.ic_food, + "Honeydew" to R.drawable.ic_no_food, +).map { (word, icon) -> DefinedWord(word, icon) } private data class DefinedWord( val word: String, - val definition: String + @DrawableRes val icon: Int, + val definition: String = loremIpsum ) +@SuppressLint("UnusedContentLambdaTargetStateParameter") @OptIn(ExperimentalMaterial3AdaptiveApi::class) @Composable fun ListDetailSample() { var selectedWordIndex: Int? by rememberSaveable { mutableStateOf(null) } val navigator = rememberListDetailPaneScaffoldNavigator() + val isCompact = + currentWindowAdaptiveInfo().windowSizeClass.windowWidthSizeClass != WindowWidthSizeClass.EXPANDED BackHandler(enabled = navigator.canNavigateBack()) { navigator.navigateBack() } - ListDetailPaneScaffold( - directive = navigator.scaffoldDirective, - value = navigator.scaffoldValue, - listPane = { - val currentSelectedWordIndex = selectedWordIndex - val isDetailVisible = - navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded - - ListContent( - words = sampleWords.map(DefinedWord::word), - selectionState = if (isDetailVisible && currentSelectedWordIndex != null) { - SelectionVisibilityState.ShowSelection(currentSelectedWordIndex) - } else { - SelectionVisibilityState.NoSelection - }, - onIndexClick = { index -> - selectedWordIndex = index - navigator.navigateTo(ListDetailPaneScaffoldRole.Detail) + SharedTransitionLayout { +// AnimatedContent(targetState = isCompact, label = "simple sample") { + ListDetailPaneScaffold( + directive = navigator.scaffoldDirective, + value = navigator.scaffoldValue, + listPane = { + val currentSelectedWordIndex = selectedWordIndex + val isDetailVisible = + navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded + AnimatedPane { + ListContent( + words = sampleWords, + selectionState = if (isDetailVisible && currentSelectedWordIndex != null) { + SelectionVisibilityState.ShowSelection(currentSelectedWordIndex) + } else { + SelectionVisibilityState.NoSelection + }, + onIndexClick = { index -> + selectedWordIndex = index + navigator.navigateTo(ListDetailPaneScaffoldRole.Detail) + }, + isCompact = isCompact, + isDetailVisible = isDetailVisible, + animatedVisibilityScope = this@AnimatedPane, + sharedTransitionScope = this@SharedTransitionLayout + ) } - ) - }, - detailPane = { - val definedWord = selectedWordIndex?.let(sampleWords::get) - DetailContent( - definedWord = definedWord - ) - } - ) + }, + detailPane = { + val definedWord = selectedWordIndex?.let(sampleWords::get) + val isDetailVisible = + navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded + AnimatedPane { + DetailContent( + definedWord = definedWord, + isCompact = isCompact, + isDetailVisible = isDetailVisible, + animatedVisibilityScope = this@AnimatedPane, + sharedTransitionScope = this@SharedTransitionLayout + ) + } + }, + paneExpansionState = rememberPaneExpansionState(navigator.scaffoldValue), + paneExpansionDragHandle = { state -> + PaneExpansionDragHandle(state, Color.Red) + } + ) + } +// } } /** @@ -137,10 +179,14 @@ sealed interface SelectionVisibilityState { */ @Composable private fun ListContent( - words: List, + words: List, selectionState: SelectionVisibilityState, onIndexClick: (index: Int) -> Unit, - modifier: Modifier = Modifier + modifier: Modifier = Modifier, + isCompact: Boolean, + isDetailVisible: Boolean, + sharedTransitionScope: SharedTransitionScope, + animatedVisibilityScope: AnimatedVisibilityScope ) { LazyColumn( contentPadding = PaddingValues(vertical = 16.dp), @@ -204,12 +250,40 @@ private fun ListContent( .then(interactionModifier) .fillMaxWidth() ) { - Text( - text = word, - modifier = Modifier - .fillMaxWidth() - .padding(8.dp) - ) + Row { + if (isCompact && !isDetailVisible) { + with(sharedTransitionScope) { + val state = rememberSharedContentState(key = word.word) + + println("list-" + word.word + "-" + state.isMatchFound) + + Image( + painter = painterResource(id = word.icon), + contentDescription = word.word, + modifier = Modifier + .padding(horizontal = 8.dp) + .sharedElement( + state, + animatedVisibilityScope = animatedVisibilityScope + ) + ) + } + } else { + Image( + painter = painterResource(id = word.icon), + contentDescription = word.word, + modifier = Modifier + .padding(horizontal = 8.dp) + ) + } + Text( + text = word.word, + modifier = Modifier + .fillMaxWidth() + .padding(8.dp) + ) + } + } } } @@ -222,6 +296,10 @@ private fun ListContent( private fun DetailContent( definedWord: DefinedWord?, modifier: Modifier = Modifier, + isCompact: Boolean, + isDetailVisible: Boolean, + sharedTransitionScope: SharedTransitionScope, + animatedVisibilityScope: AnimatedVisibilityScope ) { Column( modifier = modifier @@ -229,6 +307,32 @@ private fun DetailContent( .padding(vertical = 16.dp) ) { if (definedWord != null) { + + if (isCompact && isDetailVisible) { + with(sharedTransitionScope) { + val state = rememberSharedContentState(key = definedWord.word) + + println("detail-" + definedWord.word + "-" + state.isMatchFound) + + Image( + painter = painterResource(id = definedWord.icon), + contentDescription = definedWord.word, + modifier = Modifier + .padding(horizontal = 8.dp) + .sharedElement( + state, + animatedVisibilityScope = animatedVisibilityScope + ) + ) + } + } else { + Image( + painter = painterResource(id = definedWord.icon), + contentDescription = definedWord.word, + modifier = Modifier + .padding(horizontal = 8.dp) + ) + } Text( text = definedWord.word, style = MaterialTheme.typography.headlineMedium diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_food.xml b/CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_food.xml new file mode 100644 index 000000000..68632b468 --- /dev/null +++ b/CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_food.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_no_food.xml b/CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_no_food.xml new file mode 100644 index 000000000..543584121 --- /dev/null +++ b/CanonicalLayouts/list-detail-compose/app/src/main/res/drawable/ic_no_food.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/CanonicalLayouts/list-detail-compose/build.gradle b/CanonicalLayouts/list-detail-compose/build.gradle index 525604a47..1cfdadc2d 100644 --- a/CanonicalLayouts/list-detail-compose/build.gradle +++ b/CanonicalLayouts/list-detail-compose/build.gradle @@ -14,7 +14,7 @@ * limitations under the License. */ plugins { - id 'com.android.application' version '8.3.2' apply false - id 'com.android.library' version '8.3.2' apply false + id 'com.android.application' version '8.6.0' apply false + id 'com.android.library' version '8.6.0' apply false id 'org.jetbrains.kotlin.android' version '1.9.22' apply false } diff --git a/CanonicalLayouts/list-detail-compose/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/list-detail-compose/gradle/wrapper/gradle-wrapper.properties index 98ab018bc..f9f3c8cbd 100644 --- a/CanonicalLayouts/list-detail-compose/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/list-detail-compose/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed May 25 14:11:15 UTC 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 9212e1cbfc090790e5ce93fb2f3963cb169394b7 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 2 Sep 2024 16:42:04 +0200 Subject: [PATCH 2/9] Restore AnimatedContent --- .../listdetailcompose/ui/ListDetailSample.kt | 93 ++++++++++--------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index 73669cebc..19bb12edf 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -21,6 +21,7 @@ package com.example.listdetailcompose.ui import android.annotation.SuppressLint import androidx.activity.compose.BackHandler import androidx.annotation.DrawableRes +import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedVisibilityScope import androidx.compose.animation.ExperimentalSharedTransitionApi import androidx.compose.animation.SharedTransitionLayout @@ -103,54 +104,54 @@ fun ListDetailSample() { } SharedTransitionLayout { -// AnimatedContent(targetState = isCompact, label = "simple sample") { - ListDetailPaneScaffold( - directive = navigator.scaffoldDirective, - value = navigator.scaffoldValue, - listPane = { - val currentSelectedWordIndex = selectedWordIndex - val isDetailVisible = - navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded - AnimatedPane { - ListContent( - words = sampleWords, - selectionState = if (isDetailVisible && currentSelectedWordIndex != null) { - SelectionVisibilityState.ShowSelection(currentSelectedWordIndex) - } else { - SelectionVisibilityState.NoSelection - }, - onIndexClick = { index -> - selectedWordIndex = index - navigator.navigateTo(ListDetailPaneScaffoldRole.Detail) - }, - isCompact = isCompact, - isDetailVisible = isDetailVisible, - animatedVisibilityScope = this@AnimatedPane, - sharedTransitionScope = this@SharedTransitionLayout - ) - } - }, - detailPane = { - val definedWord = selectedWordIndex?.let(sampleWords::get) - val isDetailVisible = - navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded - AnimatedPane { - DetailContent( - definedWord = definedWord, - isCompact = isCompact, - isDetailVisible = isDetailVisible, - animatedVisibilityScope = this@AnimatedPane, - sharedTransitionScope = this@SharedTransitionLayout - ) + AnimatedContent(targetState = isCompact, label = "simple sample") { + ListDetailPaneScaffold( + directive = navigator.scaffoldDirective, + value = navigator.scaffoldValue, + listPane = { + val currentSelectedWordIndex = selectedWordIndex + val isDetailVisible = + navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded + AnimatedPane { + ListContent( + words = sampleWords, + selectionState = if (isDetailVisible && currentSelectedWordIndex != null) { + SelectionVisibilityState.ShowSelection(currentSelectedWordIndex) + } else { + SelectionVisibilityState.NoSelection + }, + onIndexClick = { index -> + selectedWordIndex = index + navigator.navigateTo(ListDetailPaneScaffoldRole.Detail) + }, + isCompact = isCompact, + isDetailVisible = isDetailVisible, + animatedVisibilityScope = this@AnimatedPane, + sharedTransitionScope = this@SharedTransitionLayout + ) + } + }, + detailPane = { + val definedWord = selectedWordIndex?.let(sampleWords::get) + val isDetailVisible = + navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded + AnimatedPane { + DetailContent( + definedWord = definedWord, + isCompact = isCompact, + isDetailVisible = isDetailVisible, + animatedVisibilityScope = this@AnimatedPane, + sharedTransitionScope = this@SharedTransitionLayout + ) + } + }, + paneExpansionState = rememberPaneExpansionState(navigator.scaffoldValue), + paneExpansionDragHandle = { state -> + PaneExpansionDragHandle(state, Color.Red) } - }, - paneExpansionState = rememberPaneExpansionState(navigator.scaffoldValue), - paneExpansionDragHandle = { state -> - PaneExpansionDragHandle(state, Color.Red) - } - ) + ) + } } -// } } /** From 0a4dc5fd234152c9a0a36d55390f45ce419b5a25 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 2 Sep 2024 17:00:34 +0200 Subject: [PATCH 3/9] Update Supporting Pane to 1.1.0 alpha 01 --- .../supporting-pane-compose/app/build.gradle | 24 +++++++++---------- .../ui/SupportingPaneSample.kt | 9 ++++++- .../supporting-pane-compose/build.gradle | 4 ++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CanonicalLayouts/supporting-pane-compose/app/build.gradle b/CanonicalLayouts/supporting-pane-compose/app/build.gradle index d29e14e4e..da859107b 100644 --- a/CanonicalLayouts/supporting-pane-compose/app/build.gradle +++ b/CanonicalLayouts/supporting-pane-compose/app/build.gradle @@ -21,12 +21,12 @@ plugins { android { namespace 'com.example.supportingpanecompose' - compileSdk 34 + compileSdk 35 defaultConfig { applicationId "com.example.supportingpanecompose" minSdk 21 - targetSdk 34 + targetSdk 35 versionCode 1 versionName "1.0" @@ -63,19 +63,19 @@ android { } dependencies { - def composeBom = platform('androidx.compose:compose-bom:2024.03.00') + def composeBom = platform('androidx.compose:compose-bom:2024.08.00') implementation(composeBom) - implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' - implementation 'androidx.activity:activity-compose:1.8.2' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4' + implementation 'androidx.activity:activity-compose:1.9.1' implementation "androidx.compose.ui:ui" implementation "androidx.compose.ui:ui-tooling-preview" - implementation "androidx.window:window:1.2.0" - implementation 'androidx.compose.material3:material3:1.3.0-alpha03' - implementation 'androidx.compose.material3.adaptive:adaptive:1.0.0-alpha09' - implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.0.0-alpha09' - implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.0.0-alpha09' - implementation "androidx.compose.material3:material3-window-size-class:1.3.0-alpha03" + implementation "androidx.window:window:1.3.0" + implementation 'androidx.compose.material3:material3:1.3.0-rc01' + implementation 'androidx.compose.material3.adaptive:adaptive:1.1.0-alpha01' + implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.1.0-alpha01' + implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.1.0-alpha01' + implementation "androidx.compose.material3:material3-window-size-class:1.3.0-rc01" testImplementation 'junit:junit:4.13.2' } \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-compose/app/src/main/java/com/example/supportingpanecompose/ui/SupportingPaneSample.kt b/CanonicalLayouts/supporting-pane-compose/app/src/main/java/com/example/supportingpanecompose/ui/SupportingPaneSample.kt index 715685d49..18fa78ce1 100644 --- a/CanonicalLayouts/supporting-pane-compose/app/src/main/java/com/example/supportingpanecompose/ui/SupportingPaneSample.kt +++ b/CanonicalLayouts/supporting-pane-compose/app/src/main/java/com/example/supportingpanecompose/ui/SupportingPaneSample.kt @@ -29,8 +29,10 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi import androidx.compose.material3.adaptive.layout.AnimatedPane +import androidx.compose.material3.adaptive.layout.PaneExpansionDragHandle import androidx.compose.material3.adaptive.layout.SupportingPaneScaffold import androidx.compose.material3.adaptive.layout.SupportingPaneScaffoldRole +import androidx.compose.material3.adaptive.layout.rememberPaneExpansionState import androidx.compose.material3.adaptive.navigation.rememberSupportingPaneScaffoldNavigator import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -39,6 +41,7 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.example.supportingpanecompose.R @@ -57,7 +60,7 @@ private val data = mapOf( @Composable fun SupportingPaneSample() { var selectedTopic: String by rememberSaveable { mutableStateOf(data.keys.first()) } - val navigator = rememberSupportingPaneScaffoldNavigator() + val navigator = rememberSupportingPaneScaffoldNavigator() BackHandler(enabled = navigator.canNavigateBack()) { navigator.navigateBack() @@ -128,5 +131,9 @@ fun SupportingPaneSample() { ) } } + }, + paneExpansionState = rememberPaneExpansionState(navigator.scaffoldValue), + paneExpansionDragHandle = { state -> + PaneExpansionDragHandle(state, Color.Red) }) } diff --git a/CanonicalLayouts/supporting-pane-compose/build.gradle b/CanonicalLayouts/supporting-pane-compose/build.gradle index 305709532..e18a509a7 100644 --- a/CanonicalLayouts/supporting-pane-compose/build.gradle +++ b/CanonicalLayouts/supporting-pane-compose/build.gradle @@ -14,7 +14,7 @@ * limitations under the License. */ plugins { - id 'com.android.application' version '8.3.1' apply false - id 'com.android.library' version '8.3.1' apply false + id 'com.android.application' version '8.6.0' apply false + id 'com.android.library' version '8.6.0' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false } diff --git a/CanonicalLayouts/supporting-pane-compose/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/supporting-pane-compose/gradle/wrapper/gradle-wrapper.properties index 98ab018bc..f9f3c8cbd 100644 --- a/CanonicalLayouts/supporting-pane-compose/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/supporting-pane-compose/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed May 25 14:11:15 UTC 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From ba5d63ff8f2788aab28b90ab02976331907bb916 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Wed, 4 Sep 2024 10:18:01 +0200 Subject: [PATCH 4/9] Fix comments --- .../listdetailcompose/ui/ListDetailSample.kt | 82 ++++++++----------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index 19bb12edf..cd7c76138 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -@file:OptIn(ExperimentalSharedTransitionApi::class) +@file:OptIn(ExperimentalSharedTransitionApi::class, ExperimentalSharedTransitionApi::class) package com.example.listdetailcompose.ui @@ -96,7 +96,7 @@ private data class DefinedWord( fun ListDetailSample() { var selectedWordIndex: Int? by rememberSaveable { mutableStateOf(null) } val navigator = rememberListDetailPaneScaffoldNavigator() - val isCompact = + val isSmallerThanExpanded = currentWindowAdaptiveInfo().windowSizeClass.windowWidthSizeClass != WindowWidthSizeClass.EXPANDED BackHandler(enabled = navigator.canNavigateBack()) { @@ -104,7 +104,7 @@ fun ListDetailSample() { } SharedTransitionLayout { - AnimatedContent(targetState = isCompact, label = "simple sample") { + AnimatedContent(targetState = isSmallerThanExpanded, label = "simple sample") { ListDetailPaneScaffold( directive = navigator.scaffoldDirective, value = navigator.scaffoldValue, @@ -124,7 +124,7 @@ fun ListDetailSample() { selectedWordIndex = index navigator.navigateTo(ListDetailPaneScaffoldRole.Detail) }, - isCompact = isCompact, + isSmallerThanExpanded = isSmallerThanExpanded, isDetailVisible = isDetailVisible, animatedVisibilityScope = this@AnimatedPane, sharedTransitionScope = this@SharedTransitionLayout @@ -138,7 +138,7 @@ fun ListDetailSample() { AnimatedPane { DetailContent( definedWord = definedWord, - isCompact = isCompact, + isSmallerThanExpanded = isSmallerThanExpanded, isDetailVisible = isDetailVisible, animatedVisibilityScope = this@AnimatedPane, sharedTransitionScope = this@SharedTransitionLayout @@ -184,7 +184,7 @@ private fun ListContent( selectionState: SelectionVisibilityState, onIndexClick: (index: Int) -> Unit, modifier: Modifier = Modifier, - isCompact: Boolean, + isSmallerThanExpanded: Boolean, isDetailVisible: Boolean, sharedTransitionScope: SharedTransitionScope, animatedVisibilityScope: AnimatedVisibilityScope @@ -252,31 +252,27 @@ private fun ListContent( .fillMaxWidth() ) { Row { - if (isCompact && !isDetailVisible) { - with(sharedTransitionScope) { - val state = rememberSharedContentState(key = word.word) - - println("list-" + word.word + "-" + state.isMatchFound) - - Image( - painter = painterResource(id = word.icon), - contentDescription = word.word, - modifier = Modifier + val imageModifier = + if (isSmallerThanExpanded && !isDetailVisible) { + with(sharedTransitionScope) { + val state = rememberSharedContentState(key = word.word) + Modifier .padding(horizontal = 8.dp) .sharedElement( state, animatedVisibilityScope = animatedVisibilityScope ) - ) + + } + } else { + Modifier.padding(horizontal = 8.dp) } - } else { - Image( - painter = painterResource(id = word.icon), - contentDescription = word.word, - modifier = Modifier - .padding(horizontal = 8.dp) - ) - } + + Image( + painter = painterResource(id = word.icon), + contentDescription = word.word, + modifier = imageModifier + ) Text( text = word.word, modifier = Modifier @@ -297,7 +293,7 @@ private fun ListContent( private fun DetailContent( definedWord: DefinedWord?, modifier: Modifier = Modifier, - isCompact: Boolean, + isSmallerThanExpanded: Boolean, isDetailVisible: Boolean, sharedTransitionScope: SharedTransitionScope, animatedVisibilityScope: AnimatedVisibilityScope @@ -309,31 +305,25 @@ private fun DetailContent( ) { if (definedWord != null) { - if (isCompact && isDetailVisible) { + val imageModifier = if (isSmallerThanExpanded && isDetailVisible) { with(sharedTransitionScope) { val state = rememberSharedContentState(key = definedWord.word) - - println("detail-" + definedWord.word + "-" + state.isMatchFound) - - Image( - painter = painterResource(id = definedWord.icon), - contentDescription = definedWord.word, - modifier = Modifier - .padding(horizontal = 8.dp) - .sharedElement( - state, - animatedVisibilityScope = animatedVisibilityScope - ) - ) + Modifier + .padding(horizontal = 8.dp) + .sharedElement( + state, + animatedVisibilityScope = animatedVisibilityScope + ) } } else { - Image( - painter = painterResource(id = definedWord.icon), - contentDescription = definedWord.word, - modifier = Modifier - .padding(horizontal = 8.dp) - ) + Modifier.padding(horizontal = 8.dp) } + + Image( + painter = painterResource(id = definedWord.icon), + contentDescription = definedWord.word, + modifier = imageModifier + ) Text( text = definedWord.word, style = MaterialTheme.typography.headlineMedium From f1b6f2c99e302d55c1f6704405ca71e3f9c9b345 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Thu, 5 Sep 2024 08:17:14 +0200 Subject: [PATCH 5/9] Fix comments --- .../list-detail-compose/app/build.gradle | 2 +- .../listdetailcompose/ui/ListDetailSample.kt | 36 +++++++++---------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/build.gradle b/CanonicalLayouts/list-detail-compose/app/build.gradle index 4314c4f8d..f69934db4 100644 --- a/CanonicalLayouts/list-detail-compose/app/build.gradle +++ b/CanonicalLayouts/list-detail-compose/app/build.gradle @@ -68,7 +68,7 @@ dependencies { implementation "com.google.accompanist:accompanist-adaptive:0.32.0" implementation 'androidx.core:core-ktx:1.13.1' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4' - implementation 'androidx.activity:activity-compose:1.9.1' + implementation 'androidx.activity:activity-compose:1.9.2' implementation "androidx.compose.foundation:foundation:1.6.8" implementation "androidx.compose.ui:ui:1.6.8" implementation "androidx.compose.ui:ui-tooling-preview" diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index cd7c76138..46b169085 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -252,21 +252,18 @@ private fun ListContent( .fillMaxWidth() ) { Row { - val imageModifier = - if (isSmallerThanExpanded && !isDetailVisible) { - with(sharedTransitionScope) { - val state = rememberSharedContentState(key = word.word) - Modifier - .padding(horizontal = 8.dp) - .sharedElement( - state, - animatedVisibilityScope = animatedVisibilityScope - ) - - } - } else { - Modifier.padding(horizontal = 8.dp) + val imageModifier = Modifier.padding(horizontal = 8.dp) + if (isSmallerThanExpanded && !isDetailVisible) { + with(sharedTransitionScope) { + val state = rememberSharedContentState(key = word.word) + imageModifier.then( + Modifier.sharedElement( + state, + animatedVisibilityScope = animatedVisibilityScope + ) + ) } + } Image( painter = painterResource(id = word.icon), @@ -305,18 +302,17 @@ private fun DetailContent( ) { if (definedWord != null) { - val imageModifier = if (isSmallerThanExpanded && isDetailVisible) { + val imageModifier = Modifier.padding(horizontal = 8.dp) + if (isSmallerThanExpanded && isDetailVisible) { with(sharedTransitionScope) { val state = rememberSharedContentState(key = definedWord.word) - Modifier - .padding(horizontal = 8.dp) - .sharedElement( + imageModifier.then( + Modifier.sharedElement( state, animatedVisibilityScope = animatedVisibilityScope ) + ) } - } else { - Modifier.padding(horizontal = 8.dp) } Image( From 288fdc9369f4afe54983fd95a8fb8e91f7249021 Mon Sep 17 00:00:00 2001 From: Roberto Orgiu Date: Thu, 5 Sep 2024 18:40:33 +0200 Subject: [PATCH 6/9] Update CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt Co-authored-by: Alex Vanyo --- .../listdetailcompose/ui/ListDetailSample.kt | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index 46b169085..26f41b8ef 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -302,18 +302,21 @@ private fun DetailContent( ) { if (definedWord != null) { - val imageModifier = Modifier.padding(horizontal = 8.dp) - if (isSmallerThanExpanded && isDetailVisible) { - with(sharedTransitionScope) { - val state = rememberSharedContentState(key = definedWord.word) - imageModifier.then( - Modifier.sharedElement( - state, - animatedVisibilityScope = animatedVisibilityScope - ) - ) - } - } + val imageModifier = Modifier + .padding(horizontal = 8.dp) + .then( + if (isSmallerThanExpanded && isDetailVisible) { + with(sharedTransitionScope) { + val state = rememberSharedContentState(key = definedWord.word) + Modifier.sharedElement( + state, + animatedVisibilityScope = animatedVisibilityScope + ) + } + } else { + Modifier + } + ) Image( painter = painterResource(id = definedWord.icon), From 2284ca35ae9cc6cc7840c6a9c53004548e49ab6b Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Thu, 5 Sep 2024 18:48:56 +0200 Subject: [PATCH 7/9] Fix comments --- .../listdetailcompose/ui/ListDetailSample.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index 46b169085..6327d7aa8 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -96,15 +96,15 @@ private data class DefinedWord( fun ListDetailSample() { var selectedWordIndex: Int? by rememberSaveable { mutableStateOf(null) } val navigator = rememberListDetailPaneScaffoldNavigator() - val isSmallerThanExpanded = - currentWindowAdaptiveInfo().windowSizeClass.windowWidthSizeClass != WindowWidthSizeClass.EXPANDED + val isListAndDetailVisible = + currentWindowAdaptiveInfo().windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.EXPANDED BackHandler(enabled = navigator.canNavigateBack()) { navigator.navigateBack() } SharedTransitionLayout { - AnimatedContent(targetState = isSmallerThanExpanded, label = "simple sample") { + AnimatedContent(targetState = isListAndDetailVisible, label = "simple sample") { ListDetailPaneScaffold( directive = navigator.scaffoldDirective, value = navigator.scaffoldValue, @@ -124,8 +124,8 @@ fun ListDetailSample() { selectedWordIndex = index navigator.navigateTo(ListDetailPaneScaffoldRole.Detail) }, - isSmallerThanExpanded = isSmallerThanExpanded, - isDetailVisible = isDetailVisible, + isListAndDetailVisible = isListAndDetailVisible, + isListVisible = !isDetailVisible, animatedVisibilityScope = this@AnimatedPane, sharedTransitionScope = this@SharedTransitionLayout ) @@ -138,7 +138,7 @@ fun ListDetailSample() { AnimatedPane { DetailContent( definedWord = definedWord, - isSmallerThanExpanded = isSmallerThanExpanded, + isListAndDetailVisible = isListAndDetailVisible, isDetailVisible = isDetailVisible, animatedVisibilityScope = this@AnimatedPane, sharedTransitionScope = this@SharedTransitionLayout @@ -184,8 +184,8 @@ private fun ListContent( selectionState: SelectionVisibilityState, onIndexClick: (index: Int) -> Unit, modifier: Modifier = Modifier, - isSmallerThanExpanded: Boolean, - isDetailVisible: Boolean, + isListAndDetailVisible: Boolean, + isListVisible: Boolean, sharedTransitionScope: SharedTransitionScope, animatedVisibilityScope: AnimatedVisibilityScope ) { @@ -253,7 +253,7 @@ private fun ListContent( ) { Row { val imageModifier = Modifier.padding(horizontal = 8.dp) - if (isSmallerThanExpanded && !isDetailVisible) { + if (!isListAndDetailVisible && isListVisible) { with(sharedTransitionScope) { val state = rememberSharedContentState(key = word.word) imageModifier.then( @@ -290,7 +290,7 @@ private fun ListContent( private fun DetailContent( definedWord: DefinedWord?, modifier: Modifier = Modifier, - isSmallerThanExpanded: Boolean, + isListAndDetailVisible: Boolean, isDetailVisible: Boolean, sharedTransitionScope: SharedTransitionScope, animatedVisibilityScope: AnimatedVisibilityScope @@ -303,7 +303,7 @@ private fun DetailContent( if (definedWord != null) { val imageModifier = Modifier.padding(horizontal = 8.dp) - if (isSmallerThanExpanded && isDetailVisible) { + if (!isListAndDetailVisible && isDetailVisible) { with(sharedTransitionScope) { val state = rememberSharedContentState(key = definedWord.word) imageModifier.then( From fe89cf675e44e0656982c8d4621e3627b8c41ef5 Mon Sep 17 00:00:00 2001 From: Roberto Orgiu Date: Fri, 6 Sep 2024 11:41:33 +0200 Subject: [PATCH 8/9] Update CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt Co-authored-by: Alex Vanyo --- .../java/com/example/listdetailcompose/ui/ListDetailSample.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt index 1f1926b41..3e55a7252 100644 --- a/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt +++ b/CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt @@ -97,7 +97,7 @@ fun ListDetailSample() { var selectedWordIndex: Int? by rememberSaveable { mutableStateOf(null) } val navigator = rememberListDetailPaneScaffoldNavigator() val isListAndDetailVisible = - currentWindowAdaptiveInfo().windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.EXPANDED + navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded && navigator.scaffoldValue[ListDetailPaneScaffoldRole.List] == PaneAdaptedValue.Expanded BackHandler(enabled = navigator.canNavigateBack()) { navigator.navigateBack() From 23b716f6fe413dedbbf82b33d25f3144c2931c89 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 10 Sep 2024 19:07:28 +0200 Subject: [PATCH 9/9] Update to latest Compose version --- .../list-detail-compose/app/build.gradle | 20 +++++++++---------- .../supporting-pane-compose/app/build.gradle | 16 +++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/build.gradle b/CanonicalLayouts/list-detail-compose/app/build.gradle index f69934db4..b30b0cb05 100644 --- a/CanonicalLayouts/list-detail-compose/app/build.gradle +++ b/CanonicalLayouts/list-detail-compose/app/build.gradle @@ -62,22 +62,22 @@ android { } dependencies { - def composeBom = platform('androidx.compose:compose-bom:2024.08.00') + def composeBom = platform('androidx.compose:compose-bom:2024.09.00') implementation(composeBom) implementation "com.google.accompanist:accompanist-adaptive:0.32.0" implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.5' implementation 'androidx.activity:activity-compose:1.9.2' - implementation "androidx.compose.foundation:foundation:1.6.8" - implementation "androidx.compose.ui:ui:1.6.8" + implementation "androidx.compose.foundation:foundation:1.7.0" + implementation "androidx.compose.ui:ui:1.7.0" implementation "androidx.compose.ui:ui-tooling-preview" implementation "androidx.window:window:1.3.0" - implementation 'androidx.compose.material3:material3:1.3.0-rc01' - implementation 'androidx.compose.material3.adaptive:adaptive:1.1.0-alpha01' - implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.1.0-alpha01' - implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.1.0-alpha01' - implementation "androidx.compose.material3:material3-window-size-class:1.3.0-rc01" - implementation "androidx.compose.animation:animation:1.7.0-rc01" + implementation 'androidx.compose.material3:material3:1.3.0' + implementation 'androidx.compose.material3.adaptive:adaptive:1.1.0-alpha02' + implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.1.0-alpha02' + implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.1.0-alpha02' + implementation "androidx.compose.material3:material3-window-size-class:1.3.0" + implementation "androidx.compose.animation:animation:1.7.0" testImplementation 'junit:junit:4.13.2' } diff --git a/CanonicalLayouts/supporting-pane-compose/app/build.gradle b/CanonicalLayouts/supporting-pane-compose/app/build.gradle index da859107b..4cefe12f0 100644 --- a/CanonicalLayouts/supporting-pane-compose/app/build.gradle +++ b/CanonicalLayouts/supporting-pane-compose/app/build.gradle @@ -63,19 +63,19 @@ android { } dependencies { - def composeBom = platform('androidx.compose:compose-bom:2024.08.00') + def composeBom = platform('androidx.compose:compose-bom:2024.09.00') implementation(composeBom) implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4' - implementation 'androidx.activity:activity-compose:1.9.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.5' + implementation 'androidx.activity:activity-compose:1.9.2' implementation "androidx.compose.ui:ui" implementation "androidx.compose.ui:ui-tooling-preview" implementation "androidx.window:window:1.3.0" - implementation 'androidx.compose.material3:material3:1.3.0-rc01' - implementation 'androidx.compose.material3.adaptive:adaptive:1.1.0-alpha01' - implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.1.0-alpha01' - implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.1.0-alpha01' - implementation "androidx.compose.material3:material3-window-size-class:1.3.0-rc01" + implementation 'androidx.compose.material3:material3:1.3.0' + implementation 'androidx.compose.material3.adaptive:adaptive:1.1.0-alpha02' + implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.1.0-alpha02' + implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.1.0-alpha02' + implementation "androidx.compose.material3:material3-window-size-class:1.3.0" testImplementation 'junit:junit:4.13.2' } \ No newline at end of file