From 1e62ab2c16d440d9d1768c4cff671f0d09069d2c Mon Sep 17 00:00:00 2001 From: ikarenkov Date: Thu, 16 May 2024 18:36:37 +0300 Subject: [PATCH 1/2] Marked Screen, ContainerScreen and NavigationContainer as Stable --- config/lint/lint.xml | 1 + gradle/libs.versions.toml | 2 +- .../src/main/java/com/github/terrakok/modo/ContainerScreen.kt | 2 ++ .../src/main/java/com/github/terrakok/modo/ModoModels.kt | 2 ++ modo-compose/src/main/java/com/github/terrakok/modo/Screen.kt | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/lint/lint.xml b/config/lint/lint.xml index f6fcd84..2b0e3dc 100644 --- a/config/lint/lint.xml +++ b/config/lint/lint.xml @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3685d81..1a584d6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] leakcanaryAndroid = "2.14" -modo = "0.9.0-dev8" +modo = "0.9.0-dev9" androidGradlePlugin = "8.4.0" detektComposeVersion = "0.3.20" detektVersion = "1.23.6" diff --git a/modo-compose/src/main/java/com/github/terrakok/modo/ContainerScreen.kt b/modo-compose/src/main/java/com/github/terrakok/modo/ContainerScreen.kt index 9f9ceb9..f43b202 100644 --- a/modo-compose/src/main/java/com/github/terrakok/modo/ContainerScreen.kt +++ b/modo-compose/src/main/java/com/github/terrakok/modo/ContainerScreen.kt @@ -4,6 +4,7 @@ import android.os.Parcel import android.os.Parcelable import androidx.compose.runtime.Composable import androidx.compose.runtime.ProvidedValue +import androidx.compose.runtime.Stable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.Modifier @@ -13,6 +14,7 @@ fun interface ReducerAction : NavigationAction { fun reduce(oldState: State): State } +@Stable abstract class ContainerScreen>( private val navModel: NavModel ) : Screen, NavigationContainer by navModel { diff --git a/modo-compose/src/main/java/com/github/terrakok/modo/ModoModels.kt b/modo-compose/src/main/java/com/github/terrakok/modo/ModoModels.kt index 4841a96..2bc405c 100644 --- a/modo-compose/src/main/java/com/github/terrakok/modo/ModoModels.kt +++ b/modo-compose/src/main/java/com/github/terrakok/modo/ModoModels.kt @@ -1,6 +1,7 @@ package com.github.terrakok.modo import android.os.Parcelable +import androidx.compose.runtime.Stable /** * State of navigation used in [NavigationContainer]. Can be any type. @@ -29,6 +30,7 @@ fun interface NavigationReducer> { val navigationState: State diff --git a/modo-compose/src/main/java/com/github/terrakok/modo/Screen.kt b/modo-compose/src/main/java/com/github/terrakok/modo/Screen.kt index 9ecfb08..6b2faea 100644 --- a/modo-compose/src/main/java/com/github/terrakok/modo/Screen.kt +++ b/modo-compose/src/main/java/com/github/terrakok/modo/Screen.kt @@ -2,6 +2,7 @@ package com.github.terrakok.modo import android.os.Parcelable import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.ui.Modifier /** @@ -11,6 +12,7 @@ import androidx.compose.ui.Modifier * @see ContainerScreen * @see DialogScreen */ +@Stable interface Screen : Parcelable { // TODO: https://issuetracker.google.com/issues/239435908 - support default valuer for the modifier param. From 4f0a6c293126f528ac448afee7bf5a3698fa6ce0 Mon Sep 17 00:00:00 2001 From: ikarenkov Date: Sat, 18 May 2024 16:51:43 +0300 Subject: [PATCH 2/2] Marked Screen, ContainerScreen and NavigationContainer as Stable --- config/lint/lint.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/lint/lint.xml b/config/lint/lint.xml index 2b0e3dc..5eab7c7 100644 --- a/config/lint/lint.xml +++ b/config/lint/lint.xml @@ -2,5 +2,6 @@ + \ No newline at end of file