mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-19 06:07:01 +05:30
Revert "app: remove now uneeded navigation code"
This reverts commit 41c64f4b02
.
This commit is contained in:
parent
3d5ad28eb0
commit
72d51d5c52
4 changed files with 143 additions and 0 deletions
|
@ -0,0 +1,26 @@
|
|||
package dev.msfjarvis.lobsters.ui.navigation
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import dev.msfjarvis.lobsters.R
|
||||
|
||||
/**
|
||||
* Destinations for navigation within the app.
|
||||
*/
|
||||
enum class Destination(
|
||||
val route: String,
|
||||
@StringRes val labelRes: Int,
|
||||
@DrawableRes val badgeRes: Int,
|
||||
) {
|
||||
Hottest("hottest", R.string.hottest_posts, R.drawable.ic_whatshot_24px),
|
||||
Saved("saved", R.string.saved_posts, R.drawable.ic_favorite_24px),
|
||||
;
|
||||
|
||||
companion object {
|
||||
val startDestination = Hottest
|
||||
|
||||
fun getDestinationFromRoute(route: String): Destination {
|
||||
return values().firstOrNull { it.route == route } ?: error("Incorrect route passed")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue