Skip to content

Commit 0f5c1ad

Browse files
committed
done solivagant-navigation
1 parent 3d6c0d4 commit 0f5c1ad

File tree

1 file changed

+7
-8
lines changed
  • src/main/kotlin/com/hoc081098/kotlin_playground/solivagant

1 file changed

+7
-8
lines changed

src/main/kotlin/com/hoc081098/kotlin_playground/solivagant/main.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fun main() {
5454
}
5555
}
5656

57-
@Stable
57+
@Stable // Should be removed when "strong-skipping mode" is enabled by default.
5858
val Navigator by lazy(NONE) { NavEventNavigator() }
5959

6060
@Composable
@@ -94,9 +94,7 @@ data object FirstRoute : NavRoot {
9494
)
9595
)
9696
}
97-
) {
98-
Text("Go to second route")
99-
}
97+
) { Text("Go to second route") }
10098
}
10199
}
102100
}
@@ -114,16 +112,17 @@ data class SecondRoute(
114112
modifier = modifier.background(Color.Green.copy(alpha = 0.2f)),
115113
contentAlignment = Alignment.Center,
116114
) {
117-
Column(modifier = Modifier.padding(16.dp)) {
115+
Column(
116+
modifier = Modifier.padding(16.dp),
117+
horizontalAlignment = Alignment.CenterHorizontally
118+
) {
118119
Text(
119120
text = route.toString(),
120121
textAlign = TextAlign.Center,
121122
style = MaterialTheme.typography.titleLarge,
122123
)
123124
Spacer(Modifier.height(16.dp))
124-
Button(onClick = Navigator::navigateBack) {
125-
Text("Back to first route")
126-
}
125+
Button(onClick = Navigator::navigateBack) { Text("Back to first route") }
127126
}
128127
}
129128
}

0 commit comments

Comments
 (0)