Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update List-Detail sample to Material 3 Adaptive #460

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions CanonicalLayouts/list-detail-compose/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,21 @@ android {
}

dependencies {
def composeBom = platform('androidx.compose:compose-bom:2023.10.01')
def composeBom = platform('androidx.compose:compose-bom:2024.03.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.0-rc01"
implementation "androidx.compose.ui:ui:1.6.0-rc01"
implementation "androidx.compose.foundation:foundation:1.6.4"
implementation "androidx.compose.ui:ui:1.6.4"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation "androidx.window:window:1.2.0"
implementation 'androidx.compose.material3:material3'
implementation "androidx.compose.material3:material3-window-size-class"
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"
testImplementation 'junit:junit:4.13.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,17 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Surface
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
import androidx.compose.ui.Modifier
import com.example.listdetailcompose.ui.ListDetailSample
import com.example.listdetailcompose.ui.theme.ListDetailComposeTheme
import com.google.accompanist.adaptive.calculateDisplayFeatures

class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ListDetailComposeTheme {
Surface(modifier = Modifier.fillMaxSize()) {
ListDetailSample(
windowSizeClass = calculateWindowSizeClass(this),
displayFeatures = calculateDisplayFeatures(this)
)
ListDetailSample()
}
}
}
Expand Down
Loading
Loading