From 11692f851a0cc4f51f7ff0cf1fa4a15c093eada8 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 2 Sep 2024 17:26:40 +0200 Subject: [PATCH 01/11] Update Supporting Pane to Kotlin 2 --- .../supporting-pane-compose/app/build.gradle | 13 +++++++++---- .../supporting-pane-compose/build.gradle | 2 +- .../supporting-pane-compose/gradle.properties | 1 - 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CanonicalLayouts/supporting-pane-compose/app/build.gradle b/CanonicalLayouts/supporting-pane-compose/app/build.gradle index da859107..c201b9d7 100644 --- a/CanonicalLayouts/supporting-pane-compose/app/build.gradle +++ b/CanonicalLayouts/supporting-pane-compose/app/build.gradle @@ -17,6 +17,8 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" + } android { @@ -52,9 +54,6 @@ android { buildFeatures { compose true } - composeOptions { - kotlinCompilerExtensionVersion '1.3.2' - } packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' @@ -62,10 +61,16 @@ android { } } +composeCompiler { + enableStrongSkippingMode = true + + reportsDestination = layout.buildDirectory.dir("compose_compiler") +} + dependencies { def composeBom = platform('androidx.compose:compose-bom:2024.08.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' diff --git a/CanonicalLayouts/supporting-pane-compose/build.gradle b/CanonicalLayouts/supporting-pane-compose/build.gradle index e18a509a..c54adb6c 100644 --- a/CanonicalLayouts/supporting-pane-compose/build.gradle +++ b/CanonicalLayouts/supporting-pane-compose/build.gradle @@ -16,5 +16,5 @@ plugins { 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 + id 'org.jetbrains.kotlin.android' version '2.0.0' apply false } diff --git a/CanonicalLayouts/supporting-pane-compose/gradle.properties b/CanonicalLayouts/supporting-pane-compose/gradle.properties index a2e90d87..f19c7b9b 100644 --- a/CanonicalLayouts/supporting-pane-compose/gradle.properties +++ b/CanonicalLayouts/supporting-pane-compose/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file From d4da2b47c9d401f04632e22b92f3017c695e4327 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 2 Sep 2024 17:34:15 +0200 Subject: [PATCH 02/11] Update ListDetails to Kotlin 2.0 --- CanonicalLayouts/list-detail-compose/app/build.gradle | 10 +++++++--- CanonicalLayouts/list-detail-compose/build.gradle | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CanonicalLayouts/list-detail-compose/app/build.gradle b/CanonicalLayouts/list-detail-compose/app/build.gradle index 4314c4f8..c78c9ca4 100644 --- a/CanonicalLayouts/list-detail-compose/app/build.gradle +++ b/CanonicalLayouts/list-detail-compose/app/build.gradle @@ -16,6 +16,7 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" } android { @@ -51,9 +52,6 @@ android { buildFeatures { compose true } - composeOptions { - kotlinCompilerExtensionVersion '1.5.8' - } packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' @@ -61,6 +59,12 @@ android { } } +composeCompiler { + enableStrongSkippingMode = true + + reportsDestination = layout.buildDirectory.dir("compose_compiler") +} + dependencies { def composeBom = platform('androidx.compose:compose-bom:2024.08.00') implementation(composeBom) diff --git a/CanonicalLayouts/list-detail-compose/build.gradle b/CanonicalLayouts/list-detail-compose/build.gradle index 1cfdadc2..c54adb6c 100644 --- a/CanonicalLayouts/list-detail-compose/build.gradle +++ b/CanonicalLayouts/list-detail-compose/build.gradle @@ -16,5 +16,5 @@ plugins { 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 + id 'org.jetbrains.kotlin.android' version '2.0.0' apply false } From a62577d1e3e58315b2a3822f0ed8ccaa9858a08f Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 2 Sep 2024 17:45:08 +0200 Subject: [PATCH 03/11] Update Feed to Kotlin 2 --- .../feed-compose/app/build.gradle | 29 +++++++++++-------- .../app/src/main/AndroidManifest.xml | 3 +- CanonicalLayouts/feed-compose/build.gradle | 6 ++-- .../feed-compose/gradle.properties | 4 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/CanonicalLayouts/feed-compose/app/build.gradle b/CanonicalLayouts/feed-compose/app/build.gradle index 2d10cc24..abf3455c 100644 --- a/CanonicalLayouts/feed-compose/app/build.gradle +++ b/CanonicalLayouts/feed-compose/app/build.gradle @@ -17,15 +17,16 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" } android { - compileSdk 33 + compileSdk 35 defaultConfig { applicationId "com.example.feed_compose" minSdk 21 - targetSdk 33 + targetSdk 35 versionCode 1 versionName "1.0" @@ -51,34 +52,38 @@ android { buildFeatures { compose true } - composeOptions { - kotlinCompilerExtensionVersion '1.3.2' - } packagingOptions { resources { excludes += '/META-INF/{AL2.0,LGPL2.1}' } } + namespace 'com.example.feedcompose' +} + +composeCompiler { + enableStrongSkippingMode = true + + reportsDestination = layout.buildDirectory.dir("compose_compiler") } dependencies { - def composeBom = platform('androidx.compose:compose-bom:2022.10.00') + def composeBom = platform('androidx.compose:compose-bom:2024.08.00') implementation(composeBom) androidTestImplementation(composeBom) - implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.core:core-ktx:1.13.1' implementation "androidx.compose.ui:ui" implementation 'androidx.compose.material3:material3' implementation 'androidx.compose.material3:material3-window-size-class' implementation "androidx.compose.ui:ui-tooling-preview" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1' - implementation 'androidx.activity:activity-compose:1.6.1' - implementation 'androidx.navigation:navigation-compose:2.5.3' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4' + implementation 'androidx.activity:activity-compose:1.9.1' + implementation 'androidx.navigation:navigation-compose:2.7.7' implementation 'io.coil-kt:coil-compose:2.2.1' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' androidTestImplementation "androidx.compose.ui:ui-test-junit4" debugImplementation "androidx.compose.ui:ui-tooling" debugImplementation "androidx.compose.ui:ui-test-manifest" diff --git a/CanonicalLayouts/feed-compose/app/src/main/AndroidManifest.xml b/CanonicalLayouts/feed-compose/app/src/main/AndroidManifest.xml index 245d335e..9f0ea582 100644 --- a/CanonicalLayouts/feed-compose/app/src/main/AndroidManifest.xml +++ b/CanonicalLayouts/feed-compose/app/src/main/AndroidManifest.xml @@ -16,8 +16,7 @@ --> + xmlns:tools="http://schemas.android.com/tools"> diff --git a/CanonicalLayouts/feed-compose/build.gradle b/CanonicalLayouts/feed-compose/build.gradle index 13f05740..d1e2cc81 100644 --- a/CanonicalLayouts/feed-compose/build.gradle +++ b/CanonicalLayouts/feed-compose/build.gradle @@ -15,9 +15,9 @@ */ plugins { - id 'com.android.application' version '7.3.1' apply false - id 'com.android.library' version '7.3.1' apply false - id 'org.jetbrains.kotlin.android' version '1.7.20' 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 '2.0.0' apply false id 'com.diffplug.spotless' version '6.9.0' } diff --git a/CanonicalLayouts/feed-compose/gradle.properties b/CanonicalLayouts/feed-compose/gradle.properties index cd0519bb..022338b7 100644 --- a/CanonicalLayouts/feed-compose/gradle.properties +++ b/CanonicalLayouts/feed-compose/gradle.properties @@ -20,4 +20,6 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/CanonicalLayouts/feed-compose/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/feed-compose/gradle/wrapper/gradle-wrapper.properties index bb98ed39..2014ee05 100644 --- a/CanonicalLayouts/feed-compose/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/feed-compose/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Aug 10 10:35:30 JST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 87ea932fdbd28758749c1578c6fb2b56b023273f Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 16:33:40 +0200 Subject: [PATCH 04/11] Update ActivityEmbedding to Kotlin 2.0 --- .../app/build.gradle | 6 +++--- .../app/src/main/res/layout/list_item.xml | 19 ++++++++----------- .../build.gradle | 10 +++------- .../gradle.properties | 1 - 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/CanonicalLayouts/list-detail-activity-embedding/app/build.gradle b/CanonicalLayouts/list-detail-activity-embedding/app/build.gradle index d90d7df8..206adfdd 100644 --- a/CanonicalLayouts/list-detail-activity-embedding/app/build.gradle +++ b/CanonicalLayouts/list-detail-activity-embedding/app/build.gradle @@ -19,12 +19,12 @@ plugins { } android { - compileSdk 34 + compileSdk 35 defaultConfig { applicationId "com.example.activityembedding" minSdk 31 - targetSdk 34 + targetSdk 35 versionCode 1 versionName "1.0" @@ -73,5 +73,5 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-device:1.0.1' androidTestImplementation("androidx.test.ext:junit-ktx:1.2.1") androidTestImplementation("androidx.test.ext:truth:1.6.0") - androidTestImplementation("androidx.test:runner:1.6.1") + androidTestImplementation("androidx.test:runner:1.6.2") } diff --git a/CanonicalLayouts/list-detail-activity-embedding/app/src/main/res/layout/list_item.xml b/CanonicalLayouts/list-detail-activity-embedding/app/src/main/res/layout/list_item.xml index d30ec45e..4a98c336 100644 --- a/CanonicalLayouts/list-detail-activity-embedding/app/src/main/res/layout/list_item.xml +++ b/CanonicalLayouts/list-detail-activity-embedding/app/src/main/res/layout/list_item.xml @@ -1,5 +1,4 @@ - - + app:cardCornerRadius="12dp" + app:cardPreventCornerOverlap="true"> + android:textColor="@color/design_default_color_primary" + tools:text="TextView"> diff --git a/CanonicalLayouts/list-detail-activity-embedding/build.gradle b/CanonicalLayouts/list-detail-activity-embedding/build.gradle index de839cac..6dd3c517 100644 --- a/CanonicalLayouts/list-detail-activity-embedding/build.gradle +++ b/CanonicalLayouts/list-detail-activity-embedding/build.gradle @@ -15,11 +15,7 @@ */ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.5.0' apply false - id 'com.android.library' version '8.5.0' apply false - id 'org.jetbrains.kotlin.android' version '1.7.10' apply false -} - -task clean(type: Delete) { - delete rootProject.buildDir + 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 '2.0.0' apply false } diff --git a/CanonicalLayouts/list-detail-activity-embedding/gradle.properties b/CanonicalLayouts/list-detail-activity-embedding/gradle.properties index 95b3559e..d6dbd9ad 100644 --- a/CanonicalLayouts/list-detail-activity-embedding/gradle.properties +++ b/CanonicalLayouts/list-detail-activity-embedding/gradle.properties @@ -27,5 +27,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file From 9e1d1e755ecfd8046dbe2ef87386430ee5bb67c0 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 16:47:42 +0200 Subject: [PATCH 05/11] Update Feed View to Kotlin 2.0 --- CanonicalLayouts/feed-view/app/build.gradle | 21 ++++++++++--------- .../app/src/main/AndroidManifest.xml | 3 +-- CanonicalLayouts/feed-view/build.gradle | 8 +++---- CanonicalLayouts/feed-view/gradle.properties | 4 +++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/CanonicalLayouts/feed-view/app/build.gradle b/CanonicalLayouts/feed-view/app/build.gradle index 36fb87fa..ed060a60 100644 --- a/CanonicalLayouts/feed-view/app/build.gradle +++ b/CanonicalLayouts/feed-view/app/build.gradle @@ -20,12 +20,12 @@ plugins { } android { - compileSdk 32 + compileSdk 35 defaultConfig { applicationId "com.example.viewbasedfeedlayoutsample" minSdk 21 - targetSdk 32 + targetSdk 35 versionCode 1 versionName "1.0" @@ -48,19 +48,20 @@ android { buildFeatures { viewBinding true } + namespace 'com.example.viewbasedfeedlayoutsample' } dependencies { - implementation 'androidx.core:core-ktx:1.8.0' - implementation 'androidx.appcompat:appcompat:1.4.2' - implementation 'com.google.android.material:material:1.7.0-alpha03' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1' - implementation 'androidx.navigation:navigation-ui-ktx:2.5.1' + implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7' + implementation 'androidx.navigation:navigation-ui-ktx:2.7.7' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.2.1' + implementation 'androidx.recyclerview:recyclerview:1.3.2' implementation 'io.coil-kt:coil:2.1.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } \ No newline at end of file diff --git a/CanonicalLayouts/feed-view/app/src/main/AndroidManifest.xml b/CanonicalLayouts/feed-view/app/src/main/AndroidManifest.xml index e277e76a..2d31bfaa 100644 --- a/CanonicalLayouts/feed-view/app/src/main/AndroidManifest.xml +++ b/CanonicalLayouts/feed-view/app/src/main/AndroidManifest.xml @@ -16,8 +16,7 @@ --> + xmlns:tools="http://schemas.android.com/tools"> diff --git a/CanonicalLayouts/feed-view/build.gradle b/CanonicalLayouts/feed-view/build.gradle index 451b2b59..a146b1b6 100644 --- a/CanonicalLayouts/feed-view/build.gradle +++ b/CanonicalLayouts/feed-view/build.gradle @@ -18,14 +18,14 @@ buildscript { google() } dependencies { - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.1" + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7" } } plugins { - id 'com.android.application' version '7.2.2' apply false - id 'com.android.library' version '7.2.2' apply false - id 'org.jetbrains.kotlin.android' version '1.7.10' 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 '2.0.0' apply false id 'com.diffplug.spotless' version '6.9.0' } diff --git a/CanonicalLayouts/feed-view/gradle.properties b/CanonicalLayouts/feed-view/gradle.properties index cd0519bb..022338b7 100644 --- a/CanonicalLayouts/feed-view/gradle.properties +++ b/CanonicalLayouts/feed-view/gradle.properties @@ -20,4 +20,6 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/CanonicalLayouts/feed-view/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/feed-view/gradle/wrapper/gradle-wrapper.properties index a3c562f9..b63eae95 100644 --- a/CanonicalLayouts/feed-view/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/feed-view/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Aug 03 13:58:14 JST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 35df545578374f8269933f15998544692068caee Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 16:53:04 +0200 Subject: [PATCH 06/11] Update SlidingPane to Kotlin 2.0 --- .../list-detail-sliding-pane/app/build.gradle | 20 +++++++++---------- .../list-detail-sliding-pane/build.gradle | 6 +++--- .../gradle.properties | 4 +++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/CanonicalLayouts/list-detail-sliding-pane/app/build.gradle b/CanonicalLayouts/list-detail-sliding-pane/app/build.gradle index f08a83da..28be6b3c 100644 --- a/CanonicalLayouts/list-detail-sliding-pane/app/build.gradle +++ b/CanonicalLayouts/list-detail-sliding-pane/app/build.gradle @@ -20,12 +20,12 @@ plugins { android { namespace 'com.example.listdetail.slidingpane' - compileSdk 33 + compileSdk 35 defaultConfig { applicationId "com.example.listdetail.slidingpane" minSdk 21 - targetSdk 33 + targetSdk 35 versionCode 1 versionName "1.0" @@ -53,15 +53,15 @@ android { dependencies { - implementation 'androidx.core:core-ktx:1.9.0' - implementation 'androidx.appcompat:appcompat:1.5.1' - implementation 'com.google.android.material:material:1.7.0' - implementation "androidx.activity:activity:1.7.0-alpha02" + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' + implementation "androidx.activity:activity-ktx:1.9.1" implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0" - implementation "androidx.navigation:navigation-fragment-ktx:2.5.3" - implementation "androidx.navigation:navigation-ui-ktx:2.5.3" + implementation "androidx.navigation:navigation-fragment-ktx:2.7.7" + implementation "androidx.navigation:navigation-ui-ktx:2.7.7" testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } \ No newline at end of file diff --git a/CanonicalLayouts/list-detail-sliding-pane/build.gradle b/CanonicalLayouts/list-detail-sliding-pane/build.gradle index bf080db3..e7b77424 100644 --- a/CanonicalLayouts/list-detail-sliding-pane/build.gradle +++ b/CanonicalLayouts/list-detail-sliding-pane/build.gradle @@ -15,7 +15,7 @@ */ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '7.2.1' apply false - id 'com.android.library' version '7.2.1' apply false - id 'org.jetbrains.kotlin.android' version '1.6.21' 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 '2.0.0' apply false } \ No newline at end of file diff --git a/CanonicalLayouts/list-detail-sliding-pane/gradle.properties b/CanonicalLayouts/list-detail-sliding-pane/gradle.properties index 3c5031eb..a2e90d87 100644 --- a/CanonicalLayouts/list-detail-sliding-pane/gradle.properties +++ b/CanonicalLayouts/list-detail-sliding-pane/gradle.properties @@ -20,4 +20,6 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/CanonicalLayouts/list-detail-sliding-pane/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/list-detail-sliding-pane/gradle/wrapper/gradle-wrapper.properties index bd388969..45dc8686 100644 --- a/CanonicalLayouts/list-detail-sliding-pane/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/list-detail-sliding-pane/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed May 25 15:14:50 BST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From f5777da53cf2ed6ca6656076ca1dee1ca7ba9a6e Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 16:58:18 +0200 Subject: [PATCH 07/11] Update Supporting Pane to Kotlin 2.0 --- .../supporting-pane-fragments/app/build.gradle | 18 +++++++++--------- .../supporting-pane-fragments/build.gradle | 6 +++--- .../gradle.properties | 3 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CanonicalLayouts/supporting-pane-fragments/app/build.gradle b/CanonicalLayouts/supporting-pane-fragments/app/build.gradle index bde1dd31..28bfd51b 100644 --- a/CanonicalLayouts/supporting-pane-fragments/app/build.gradle +++ b/CanonicalLayouts/supporting-pane-fragments/app/build.gradle @@ -5,12 +5,12 @@ plugins { android { namespace 'com.google.supporting.pane.fragments' - compileSdk 33 + compileSdk 35 defaultConfig { applicationId "com.google.supporting.pane.fragments" minSdk 21 - targetSdk 33 + targetSdk 35 versionCode 1 versionName "1.0" @@ -38,13 +38,13 @@ android { dependencies { - implementation 'androidx.core:core-ktx:1.8.0' - implementation 'androidx.appcompat:appcompat:1.5.0' - implementation 'com.google.android.material:material:1.6.1' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3' - implementation 'androidx.fragment:fragment-ktx:1.5.2' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + implementation 'androidx.fragment:fragment-ktx:1.8.2' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-fragments/build.gradle b/CanonicalLayouts/supporting-pane-fragments/build.gradle index 464bd5ee..e7b77424 100644 --- a/CanonicalLayouts/supporting-pane-fragments/build.gradle +++ b/CanonicalLayouts/supporting-pane-fragments/build.gradle @@ -15,7 +15,7 @@ */ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '7.2.2' apply false - id 'com.android.library' version '7.2.2' apply false - id 'org.jetbrains.kotlin.android' version '1.7.10' 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 '2.0.0' apply false } \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-fragments/gradle.properties b/CanonicalLayouts/supporting-pane-fragments/gradle.properties index 3c5031eb..f19c7b9b 100644 --- a/CanonicalLayouts/supporting-pane-fragments/gradle.properties +++ b/CanonicalLayouts/supporting-pane-fragments/gradle.properties @@ -20,4 +20,5 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-fragments/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/supporting-pane-fragments/gradle/wrapper/gradle-wrapper.properties index 2fdb4357..1e687926 100644 --- a/CanonicalLayouts/supporting-pane-fragments/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/supporting-pane-fragments/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Aug 17 15:01:41 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 697a6b41e0e07484a1c4b1176bd6392b5ea5c157 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 16:59:03 +0200 Subject: [PATCH 08/11] Update SlidingPane to Kotlin 2.0 --- CanonicalLayouts/list-detail-sliding-pane/gradle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/CanonicalLayouts/list-detail-sliding-pane/gradle.properties b/CanonicalLayouts/list-detail-sliding-pane/gradle.properties index a2e90d87..f19c7b9b 100644 --- a/CanonicalLayouts/list-detail-sliding-pane/gradle.properties +++ b/CanonicalLayouts/list-detail-sliding-pane/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file From 90f5cf97c34ffe884547fa14f55ab88a4676f7ef Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 16:59:54 +0200 Subject: [PATCH 09/11] Update Feed View to Kotlin 2.0 --- CanonicalLayouts/feed-view/gradle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/CanonicalLayouts/feed-view/gradle.properties b/CanonicalLayouts/feed-view/gradle.properties index 022338b7..2a7ec695 100644 --- a/CanonicalLayouts/feed-view/gradle.properties +++ b/CanonicalLayouts/feed-view/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file From 46417e265882e716a31df55d67fa8e22d3ba6487 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Tue, 3 Sep 2024 17:12:16 +0200 Subject: [PATCH 10/11] Update Supporting Pane to Kotlin 2.0 --- .../supporting-pane-views/app/build.gradle | 18 +++++++++--------- .../supporting/pane/views/ContentViewModel.kt | 7 +++---- .../com/google/supporting/pane/views/Data.kt | 4 +++- .../supporting/pane/views/MainActivity.kt | 15 ++++++--------- .../app/src/main/res/layout/item_support.xml | 1 + .../supporting-pane-views/build.gradle | 8 ++++---- .../supporting-pane-views/gradle.properties | 3 ++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/CanonicalLayouts/supporting-pane-views/app/build.gradle b/CanonicalLayouts/supporting-pane-views/app/build.gradle index fa29a56f..8ad26701 100644 --- a/CanonicalLayouts/supporting-pane-views/app/build.gradle +++ b/CanonicalLayouts/supporting-pane-views/app/build.gradle @@ -21,12 +21,12 @@ plugins { android { namespace 'com.google.supporting.pane.views' - compileSdk 33 + compileSdk 35 defaultConfig { applicationId "com.google.supporting.pane.views" minSdk 21 - targetSdk 33 + targetSdk 35 versionCode 1 versionName "1.0" @@ -54,13 +54,13 @@ android { dependencies { - implementation 'androidx.core:core-ktx:1.9.0' - implementation 'androidx.appcompat:appcompat:1.5.1' - implementation 'com.google.android.material:material:1.6.1' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3' - implementation 'androidx.fragment:fragment-ktx:1.5.2' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + implementation 'androidx.fragment:fragment-ktx:1.8.2' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/ContentViewModel.kt b/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/ContentViewModel.kt index 0f684cb9..9723f49e 100644 --- a/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/ContentViewModel.kt +++ b/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/ContentViewModel.kt @@ -21,11 +21,10 @@ import kotlinx.coroutines.flow.MutableStateFlow class ContentViewModel : ViewModel() { - val state = MutableStateFlow(data.keys.first()) - val supportingState = MutableStateFlow(data[state.value].orEmpty()) + val state = MutableStateFlow(State()) fun selectFromSupportingPane(key: String) { - state.value = key - supportingState.value = data[key].orEmpty() + val newState = State(key = key, items = data[key].orEmpty()) + state.value = newState } } \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/Data.kt b/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/Data.kt index 330ffa7d..f46fc15c 100644 --- a/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/Data.kt +++ b/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/Data.kt @@ -23,4 +23,6 @@ val data = mapOf( "backend" to listOf("kotlin", "java"), "java" to listOf("backend", "android", "desktop"), "flutter" to listOf("android", "desktop") -) \ No newline at end of file +) + +data class State(val key: String = data.keys.first(), val items: List = data.values.first()) diff --git a/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/MainActivity.kt b/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/MainActivity.kt index 9f9ec688..411aa5e0 100644 --- a/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/MainActivity.kt +++ b/CanonicalLayouts/supporting-pane-views/app/src/main/java/com/google/supporting/pane/views/MainActivity.kt @@ -16,8 +16,8 @@ package com.google.supporting.pane.views -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle @@ -28,7 +28,7 @@ import kotlinx.coroutines.launch class MainActivity : AppCompatActivity() { private val viewModel = ContentViewModel() - private var binding : ActivityMainBinding? = null + private var binding: ActivityMainBinding? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -41,13 +41,10 @@ class MainActivity : AppCompatActivity() { lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { - viewModel.state.collect { label -> - binding?.mainView?.setText(label) - } - } - repeatOnLifecycle(Lifecycle.State.STARTED) { - viewModel.supportingState.collect { items -> - binding?.supportingView?.updateItems(items) + viewModel.state.collect { state -> + println("Add main content") + binding?.mainView?.setText(state.key) + binding?.supportingView?.updateItems(state.items) } } } diff --git a/CanonicalLayouts/supporting-pane-views/app/src/main/res/layout/item_support.xml b/CanonicalLayouts/supporting-pane-views/app/src/main/res/layout/item_support.xml index a5ef20f5..3c3d515a 100644 --- a/CanonicalLayouts/supporting-pane-views/app/src/main/res/layout/item_support.xml +++ b/CanonicalLayouts/supporting-pane-views/app/src/main/res/layout/item_support.xml @@ -29,6 +29,7 @@ android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" + android:textColor="@color/design_default_color_primary" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/CanonicalLayouts/supporting-pane-views/build.gradle b/CanonicalLayouts/supporting-pane-views/build.gradle index acbb3c0b..44313117 100644 --- a/CanonicalLayouts/supporting-pane-views/build.gradle +++ b/CanonicalLayouts/supporting-pane-views/build.gradle @@ -15,10 +15,10 @@ */ plugins { - id 'com.android.application' version '7.3.0' apply false - id 'com.android.library' version '7.3.0' apply false - id 'org.jetbrains.kotlin.android' version '1.7.10' apply false - id 'com.diffplug.spotless' version '5.7.0' apply true + 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 '2.0.0' apply false + id 'com.diffplug.spotless' version '6.9.0' apply true } subprojects { diff --git a/CanonicalLayouts/supporting-pane-views/gradle.properties b/CanonicalLayouts/supporting-pane-views/gradle.properties index 3c5031eb..f19c7b9b 100644 --- a/CanonicalLayouts/supporting-pane-views/gradle.properties +++ b/CanonicalLayouts/supporting-pane-views/gradle.properties @@ -20,4 +20,5 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/CanonicalLayouts/supporting-pane-views/gradle/wrapper/gradle-wrapper.properties b/CanonicalLayouts/supporting-pane-views/gradle/wrapper/gradle-wrapper.properties index 2fdb4357..1e687926 100644 --- a/CanonicalLayouts/supporting-pane-views/gradle/wrapper/gradle-wrapper.properties +++ b/CanonicalLayouts/supporting-pane-views/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Aug 17 15:01:41 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 956367536b941e66246553f6b353da579bf3dc7c Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Thu, 5 Sep 2024 18:48:56 +0200 Subject: [PATCH 11/11] 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 46b16908..6327d7aa 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(