Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / appstore / src / main / java / com / vayunmathur / appstore / Route.kt
Route.kt43 lines · 1.8 KiBRaw
| 1 | package com.vayunmathur.appstore |
| 2 | |
| 3 | import com.vayunmathur.library.util.NavKey |
| 4 | import kotlinx.serialization.Serializable |
| 5 | |
| 6 | @Serializable |
| 7 | /** Navigation destinations for the phone store UI. */ |
| 8 | sealed interface Route : NavKey { |
| 9 | /** Tab destination showing the store home page. */ |
| 10 | @Serializable data object Home : Route |
| 11 | /** Tab destination showing store search. */ |
| 12 | @Serializable data object Search : Route |
| 13 | /** Tab destination showing available updates. */ |
| 14 | @Serializable data object Updates : Route |
| 15 | /** Tab destination showing the installed-app library. */ |
| 16 | @Serializable data object Library : Route |
| 17 | /** Tab destination showing store sources. */ |
| 18 | @Serializable data object Sources : Route |
| 19 | /** Destination showing one app's detail page, named by its package. */ |
| 20 | @Serializable data class Detail(val packageName: String) : Route |
| 21 | /** Destination browsing one home-page section by its ID. */ |
| 22 | @Serializable data class Browse(val sectionId: String) : Route |
| 23 | |
| 24 | /** |
| 25 | * Full-screen screenshot viewer (#918). Carries its own URL list rather than reading the |
| 26 | * selected app back out of the view model, so a restored back stack still has its images. |
| 27 | */ |
| 28 | @Serializable |
| 29 | data class Screenshots(val appName: String, val urls: List<String>, val index: Int) : Route |
| 30 | |
| 31 | /** Uninstall confirmation dialog for the app named by [packageName]. */ |
| 32 | @Serializable |
| 33 | data class UninstallDialog(val packageName: String, val appName: String) : Route |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Five tabs and two pushed screens. |
| 38 | * |
| 39 | * Sources used to be behind the gear on the home bar, which spent a settings icon on a |
| 40 | * screen opened perhaps once. It is now a tab of its own, and search — previously a text |
| 41 | * field wedged above the browse list — has its own tab so browsing and searching no |
| 42 | * longer fight over the same screen. |
| 43 | */ |