From 9bf90d0d7fb76fe0b9133948879622eaa699c37e Mon Sep 17 00:00:00 2001 From: "Ian G. Clifton" <1033551+IanGClifton@users.noreply.github.com> Date: Sun, 27 Mar 2022 21:15:55 -0700 Subject: [PATCH] [All] Update to Compose 1.2.0-alpha06 (#760) * [All] Update to Compose 1.2.0-alpha06 * Removed unused import * Updated to Accompanist 0.24.5-alpha * Added bug reference for onClickLabel * Suppressed unused parameter warning for onClickLabel Co-authored-by: Ian G. Clifton --- .../androidx/compose/samples/crane/calendar/Calendar.kt | 6 ++++-- .../main/java/com/example/crane/buildsrc/Dependencies.kt | 6 +++--- .../java/com/example/jetnews/ui/components/AppNavRail.kt | 5 +---- JetNews/build.gradle | 4 ++-- .../java/com/example/jetcaster/buildsrc/dependencies.kt | 6 +++--- .../com/example/compose/jetchat/buildsrc/dependencies.kt | 8 ++++---- .../java/com/example/jetsnack/buildsrc/Dependencies.kt | 6 +++--- .../example/compose/jetsurvey/buildsrc/dependencies.kt | 8 ++++---- .../main/java/com/example/owl/buildsrc/Dependencies.kt | 4 ++-- 9 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt index 56ff171c97..e0a98c2c74 100644 --- a/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt +++ b/Crane/app/src/main/java/androidx/compose/samples/crane/calendar/Calendar.kt @@ -185,7 +185,9 @@ private fun DayContainer( onClick: () -> Unit = { }, onClickEnabled: Boolean = true, backgroundColor: Color = Color.Transparent, - onClickLabel: String? = null, + // TODO: Determine the best way to pass the onClickLabel via the updated Surface API + // https://github.com/android/compose-samples/issues/766 + @Suppress("UNUSED_PARAMETER") onClickLabel: String? = null, content: @Composable () -> Unit ) { // What if this doesn't fit the screen? - LayoutFlexible(1f) + LayoutAspectRatio(1f) @@ -206,8 +208,8 @@ private fun DayContainer( ), onClick = onClick, enabled = onClickEnabled, + selected = selected, color = backgroundColor, - onClickLabel = onClickLabel ) { content() } diff --git a/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt b/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt index c2fbf8ce0d..4b57a59365 100644 --- a/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt +++ b/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt @@ -17,7 +17,7 @@ package com.example.crane.buildsrc object Versions { - const val ktLint = "0.44.0" + const val ktLint = "0.45.1" } object Libs { @@ -30,7 +30,7 @@ object Libs { } object Volley { - const val volley = "com.android.volley:volley:1.2.0" + const val volley = "com.android.volley:volley:1.2.1" } object Kotlin { @@ -55,7 +55,7 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.2.0-alpha05" + const val version = "1.2.0-alpha06" const val runtime = "androidx.compose.runtime:runtime:$version" const val runtimeLivedata = "androidx.compose.runtime:runtime-livedata:$version" diff --git a/JetNews/app/src/main/java/com/example/jetnews/ui/components/AppNavRail.kt b/JetNews/app/src/main/java/com/example/jetnews/ui/components/AppNavRail.kt index 97a2d5c98f..3add813509 100644 --- a/JetNews/app/src/main/java/com/example/jetnews/ui/components/AppNavRail.kt +++ b/JetNews/app/src/main/java/com/example/jetnews/ui/components/AppNavRail.kt @@ -40,14 +40,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.stringResource -import androidx.compose.ui.semantics.Role import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.example.jetnews.R import com.example.jetnews.ui.JetnewsDestinations import com.example.jetnews.ui.theme.JetnewsTheme -@OptIn(ExperimentalMaterialApi::class) @Composable fun JetnewsNavRail( modifier: Modifier = Modifier, @@ -70,7 +68,6 @@ fun JetnewsNavRail( } } -@OptIn(ExperimentalMaterialApi::class) @Composable fun AppNavRail( currentRoute: String, @@ -118,10 +115,10 @@ private fun NavRailIcon( ) Surface( + selected = isSelected, color = backgroundColor, onClick = action, shape = CircleShape, - role = Role.Tab, modifier = modifier.size(48.dp) ) { NavigationIcon( diff --git a/JetNews/build.gradle b/JetNews/build.gradle index 693ce11543..608ec79b9b 100644 --- a/JetNews/build.gradle +++ b/JetNews/build.gradle @@ -16,7 +16,7 @@ buildscript { ext.kotlin_version = '1.6.10' - ext.compose_version = '1.2.0-alpha05' + ext.compose_version = '1.2.0-alpha06' ext.coroutines_version = '1.6.0' ext.accompanist_version = '0.24.4-alpha' @@ -48,7 +48,7 @@ subprojects { targetExclude("$buildDir/**/*.kt") targetExclude('bin/**/*.kt') - ktlint("0.44.0") + ktlint("0.45.1") licenseHeaderFile rootProject.file('spotless/copyright.kt') } } diff --git a/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt b/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt index 121ccd00cf..b40ef97d55 100644 --- a/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt +++ b/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt @@ -17,7 +17,7 @@ package com.example.jetcaster.buildsrc object Versions { - const val ktlint = "0.44.0" + const val ktlint = "0.45.1" } object Libs { @@ -25,7 +25,7 @@ object Libs { const val jdkDesugar = "com.android.tools:desugar_jdk_libs:1.1.5" object Accompanist { - const val version = "0.24.4-alpha" + const val version = "0.24.5-alpha" const val pager = "com.google.accompanist:accompanist-pager:$version" } @@ -70,7 +70,7 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.2.0-alpha05" + const val version = "1.2.0-alpha06" @get:JvmStatic val snapshotUrl: String diff --git a/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt b/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt index 3e1b6539c6..3c82bbfde9 100644 --- a/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt +++ b/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt @@ -17,7 +17,7 @@ package com.example.compose.jetchat.buildsrc object Versions { - const val ktlint = "0.44.0" + const val ktlint = "0.45.1" } object Libs { @@ -26,7 +26,7 @@ object Libs { const val junit = "junit:junit:4.13" - const val material3 = "com.google.android.material:material:1.6.0-alpha02" + const val material3 = "com.google.android.material:material:1.6.0-alpha03" object Kotlin { private const val version = "1.6.10" @@ -52,7 +52,7 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.2.0-alpha05" + const val version = "1.2.0-alpha06" const val foundation = "androidx.compose.foundation:foundation:$version" const val layout = "androidx.compose.foundation:foundation-layout:$version" @@ -70,7 +70,7 @@ object Libs { object Material3 { const val snapshot = "" - const val version = "1.0.0-alpha06" + const val version = "1.0.0-alpha08" const val material3 = "androidx.compose.material3:material3:$version" } diff --git a/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt b/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt index d9320056a2..ba7644f1d8 100644 --- a/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt +++ b/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt @@ -17,14 +17,14 @@ package com.example.jetsnack.buildsrc object Versions { - const val ktlint = "0.44.0" + const val ktlint = "0.45.1" } object Libs { const val androidGradlePlugin = "com.android.tools.build:gradle:7.3.0-alpha05" object Accompanist { - const val version = "0.24.4-alpha" + const val version = "0.24.5-alpha" const val systemuicontroller = "com.google.accompanist:accompanist-systemuicontroller:$version" const val flowlayouts = "com.google.accompanist:accompanist-flowlayout:$version" } @@ -49,7 +49,7 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.2.0-alpha05" + const val version = "1.2.0-alpha06" const val foundation = "androidx.compose.foundation:foundation:${version}" const val layout = "androidx.compose.foundation:foundation-layout:${version}" diff --git a/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt b/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt index 59fa8e8953..83c7116e8a 100644 --- a/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt +++ b/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt @@ -17,7 +17,7 @@ package com.example.compose.jetsurvey.buildsrc object Versions { - const val ktlint = "0.44.0" + const val ktlint = "0.45.1" } object Libs { @@ -27,7 +27,7 @@ object Libs { const val junit = "junit:junit:4.13" object Accompanist { - const val version = "0.24.4-alpha" + const val version = "0.24.5-alpha" const val permissions = "com.google.accompanist:accompanist-permissions:$version" } @@ -61,7 +61,7 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.2.0-alpha05" + const val version = "1.2.0-alpha06" @get:JvmStatic val snapshotUrl: String @@ -86,7 +86,7 @@ object Libs { } object Material { - private const val version = "1.6.0-alpha02" + private const val version = "1.6.0-alpha03" const val material = "com.google.android.material:material:$version" } diff --git a/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt b/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt index 61cdf5224b..31d1e6168f 100644 --- a/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt +++ b/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt @@ -17,7 +17,7 @@ package com.example.owl.buildsrc object Versions { - const val ktlint = "0.44.0" + const val ktlint = "0.45.1" } object Libs { @@ -52,7 +52,7 @@ object Libs { object Compose { const val snapshot = "" - const val version = "1.2.0-alpha05" + const val version = "1.2.0-alpha06" const val animation = "androidx.compose.animation:animation:$version" const val foundation = "androidx.compose.foundation:foundation:$version"