-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to typesafe navigation routes where possible
- Loading branch information
Showing
9 changed files
with
55 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 17 additions & 8 deletions
25
app/src/main/kotlin/com/livetl/android/ui/navigation/Routes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
package com.livetl.android.ui.navigation | ||
|
||
sealed class Route(val id: String) { | ||
data object Home : Route("home") | ||
import kotlinx.serialization.Serializable | ||
|
||
data object StreamInfo : Route("stream") | ||
sealed interface Route { | ||
@Serializable | ||
data object Home : Route | ||
|
||
data object Welcome : Route("welcome") | ||
@Serializable | ||
data class StreamInfo(val urlOrId: String) : Route | ||
|
||
data object Player : Route("player") | ||
@Serializable | ||
data object Welcome : Route | ||
|
||
data object Settings : Route("settings") | ||
@Serializable | ||
data class Player(val urlOrId: String) : Route | ||
|
||
data object About : Route("about") | ||
@Serializable | ||
data object Settings : Route | ||
|
||
data object Licenses : Route("licenses") | ||
@Serializable | ||
data object Licenses : Route | ||
|
||
@Serializable | ||
data object About : Route | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters