From bb2213ff863b8684eb49268d288ff37ae47bbc5d Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 5 May 2022 11:50:55 +0530 Subject: [PATCH] android: cleanup Destinations class --- .../claw/android/ui/navigation/Destinations.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/navigation/Destinations.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/navigation/Destinations.kt index 50681965..cb0247d7 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/navigation/Destinations.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/navigation/Destinations.kt @@ -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 {