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

Marked Screen, ContainerScreen and NavigationContainer as Stable #46

Merged
merged 2 commits into from
May 20, 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
2 changes: 2 additions & 0 deletions config/lint/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
<lint>
<issue id="NewerVersionAvailable" severity="informational"/>
<issue id="GradleDependency" severity="informational"/>
<issue id="UnknownIssueId" severity="informational"/>
<issue id="UsingMaterialAndMaterial3Libraries" severity="ignore"/>

Check notice

Code scanning / Android Lint

Unknown Lint Issue Id Note

Unknown issue id "UsingMaterialAndMaterial3Libraries"

Check notice

Code scanning / Android Lint

Unknown Lint Issue Id Note

Unknown issue id "UsingMaterialAndMaterial3Libraries"

Check notice

Code scanning / Android Lint

Unknown Lint Issue Id Note

Unknown issue id "UsingMaterialAndMaterial3Libraries"
</lint>
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -13,6 +14,7 @@ fun interface ReducerAction<State : NavigationState> : NavigationAction<State> {
fun reduce(oldState: State): State
}

@Stable
abstract class ContainerScreen<State : NavigationState, Action : NavigationAction<State>>(
private val navModel: NavModel<State, Action>
) : Screen, NavigationContainer<State, Action> by navModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -29,6 +30,7 @@ fun interface NavigationReducer<State : NavigationState, Action : NavigationActi
* @param State - type of state that is managed by container.
* @param Action - type for actions that can be sent to [dispatch] to request state updates.
*/
@Stable
interface NavigationContainer<State : NavigationState, in Action : NavigationAction<State>> {
val navigationState: State

Expand Down
2 changes: 2 additions & 0 deletions modo-compose/src/main/java/com/github/terrakok/modo/Screen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand All @@ -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.
Expand Down