android: cleanup Destinations class

This commit is contained in:
Harsh Shandilya 2022-05-05 11:50:55 +05:30
parent 623e5d0144
commit bb2213ff86
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -1,20 +1,20 @@
package dev.msfjarvis.claw.android.ui.navigation package dev.msfjarvis.claw.android.ui.navigation
sealed class Destinations(internal val route: String) { sealed class Destinations {
object Hottest : Destinations("hottest") { object Hottest : Destinations() {
fun getRoute() = route fun getRoute() = "hottest"
} }
object Newest : Destinations("newest") { object Newest : Destinations() {
fun getRoute() = route fun getRoute() = "newest"
} }
object Saved : Destinations("saved") { object Saved : Destinations() {
fun getRoute() = route fun getRoute() = "saved"
} }
object Comments : Destinations("comments/%s") { object Comments : Destinations() {
fun getRoute(postId: String) = route.format(postId) fun getRoute(postId: String) = "comments/$postId"
} }
companion object { companion object {