Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit a14e648

Browse files
authored
Merge pull request #460 from tiwiz/ro_list_detail_alpha09
Update List-Detail sample to Material 3 Adaptive
2 parents 181ebfa + 1261217 commit a14e648

File tree

7 files changed

+37
-542
lines changed

7 files changed

+37
-542
lines changed

CanonicalLayouts/list-detail-compose/app/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,21 @@ android {
6262
}
6363

6464
dependencies {
65-
def composeBom = platform('androidx.compose:compose-bom:2023.10.01')
65+
def composeBom = platform('androidx.compose:compose-bom:2024.03.00')
6666
implementation(composeBom)
6767

6868
implementation "com.google.accompanist:accompanist-adaptive:0.32.0"
6969
implementation 'androidx.core:core-ktx:1.12.0'
7070
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
7171
implementation 'androidx.activity:activity-compose:1.8.2'
72-
implementation "androidx.compose.foundation:foundation:1.6.0-rc01"
73-
implementation "androidx.compose.ui:ui:1.6.0-rc01"
72+
implementation "androidx.compose.foundation:foundation:1.6.4"
73+
implementation "androidx.compose.ui:ui:1.6.4"
7474
implementation "androidx.compose.ui:ui-tooling-preview"
7575
implementation "androidx.window:window:1.2.0"
76-
implementation 'androidx.compose.material3:material3'
77-
implementation "androidx.compose.material3:material3-window-size-class"
76+
implementation 'androidx.compose.material3:material3:1.3.0-alpha03'
77+
implementation 'androidx.compose.material3.adaptive:adaptive:1.0.0-alpha09'
78+
implementation 'androidx.compose.material3.adaptive:adaptive-layout:1.0.0-alpha09'
79+
implementation 'androidx.compose.material3.adaptive:adaptive-navigation:1.0.0-alpha09'
80+
implementation "androidx.compose.material3:material3-window-size-class:1.3.0-alpha03"
7881
testImplementation 'junit:junit:4.13.2'
7982
}

CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/MainActivity.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,17 @@ import androidx.activity.ComponentActivity
2020
import androidx.activity.compose.setContent
2121
import androidx.compose.foundation.layout.fillMaxSize
2222
import androidx.compose.material3.Surface
23-
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
24-
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
2523
import androidx.compose.ui.Modifier
2624
import com.example.listdetailcompose.ui.ListDetailSample
2725
import com.example.listdetailcompose.ui.theme.ListDetailComposeTheme
28-
import com.google.accompanist.adaptive.calculateDisplayFeatures
2926

3027
class MainActivity : ComponentActivity() {
31-
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
3228
override fun onCreate(savedInstanceState: Bundle?) {
3329
super.onCreate(savedInstanceState)
3430
setContent {
3531
ListDetailComposeTheme {
3632
Surface(modifier = Modifier.fillMaxSize()) {
37-
ListDetailSample(
38-
windowSizeClass = calculateWindowSizeClass(this),
39-
displayFeatures = calculateDisplayFeatures(this)
40-
)
33+
ListDetailSample()
4134
}
4235
}
4336
}

0 commit comments

Comments
 (0)