Skip to content

Commit 3d6c0d4

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

File tree

1 file changed

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

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import androidx.compose.runtime.remember
1818
import androidx.compose.ui.Alignment
1919
import androidx.compose.ui.Modifier
2020
import androidx.compose.ui.graphics.Color
21+
import androidx.compose.ui.text.style.TextAlign
2122
import androidx.compose.ui.unit.dp
2223
import androidx.compose.ui.window.Window
2324
import androidx.compose.ui.window.application
@@ -33,6 +34,7 @@ import com.hoc081098.solivagant.navigation.SavedStateSupport
3334
import com.hoc081098.solivagant.navigation.ScreenDestination
3435
import com.hoc081098.solivagant.navigation.rememberWindowLifecycleOwner
3536
import kotlin.LazyThreadSafetyMode.NONE
37+
import kotlin.random.Random
3638
import kotlinx.collections.immutable.persistentSetOf
3739

3840
@OptIn(ExperimentalSolivagantApi::class)
@@ -87,8 +89,8 @@ data object FirstRoute : NavRoot {
8789
onClick = {
8890
Navigator.navigateTo(
8991
SecondRoute(
90-
id = "123",
91-
otherIds = listOf("456", "789"),
92+
id = Random.nextInt().toString(),
93+
otherIds = List(2) { Random.nextInt().toString() }
9294
)
9395
)
9496
}
@@ -112,10 +114,11 @@ data class SecondRoute(
112114
modifier = modifier.background(Color.Green.copy(alpha = 0.2f)),
113115
contentAlignment = Alignment.Center,
114116
) {
115-
Column {
117+
Column(modifier = Modifier.padding(16.dp)) {
116118
Text(
117119
text = route.toString(),
118-
style = MaterialTheme.typography.displayMedium,
120+
textAlign = TextAlign.Center,
121+
style = MaterialTheme.typography.titleLarge,
119122
)
120123
Spacer(Modifier.height(16.dp))
121124
Button(onClick = Navigator::navigateBack) {

0 commit comments

Comments
 (0)