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
sealed class Destinations(internal val route: String) {
object Hottest : Destinations("hottest") {
fun getRoute() = route
sealed class Destinations {
object Hottest : Destinations() {
fun getRoute() = "hottest"
}
object Newest : Destinations("newest") {
fun getRoute() = route
object Newest : Destinations() {
fun getRoute() = "newest"
}
object Saved : Destinations("saved") {
fun getRoute() = route
object Saved : Destinations() {
fun getRoute() = "saved"
}
object Comments : Destinations("comments/%s") {
fun getRoute(postId: String) = route.format(postId)
object Comments : Destinations() {
fun getRoute(postId: String) = "comments/$postId"
}
companion object {