Impl base structure of bottom-navigation
This commit is contained in:
@@ -39,6 +39,7 @@ dependencies {
|
||||
// Compose
|
||||
implementation(platform(libs.compose.bom))
|
||||
implementation(libs.compose.runtime)
|
||||
implementation("androidx.compose.material:material-icons-extended")
|
||||
// Navigation Compose
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
implementation(libs.androidx.navigation.common)
|
||||
|
||||
@@ -25,6 +25,9 @@ sealed interface AppRoute {
|
||||
@Serializable
|
||||
data object Progress : AppRoute
|
||||
|
||||
@kotlinx.serialization.Serializable
|
||||
data object Settings : AppRoute
|
||||
|
||||
@Serializable
|
||||
data class ScheduleDetails(
|
||||
val lessonId: Long
|
||||
|
||||
@@ -4,19 +4,19 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
enum class TopLevelDestination {
|
||||
SCHEDULE,
|
||||
NEWS,
|
||||
PROGRESS
|
||||
SCHEDULE, NEWS, PROGRESS, SETTINGS
|
||||
}
|
||||
|
||||
fun TopLevelDestination.toRoute(): AppRoute = when (this) {
|
||||
TopLevelDestination.SCHEDULE -> AppRoute.Schedule
|
||||
TopLevelDestination.NEWS -> AppRoute.News
|
||||
TopLevelDestination.PROGRESS -> AppRoute.Progress
|
||||
TopLevelDestination.SETTINGS -> AppRoute.Settings
|
||||
}
|
||||
|
||||
val TOP_LEVEL_DESTINATIONS: List<TopLevelDestination> = listOf(
|
||||
TopLevelDestination.SCHEDULE,
|
||||
TopLevelDestination.NEWS,
|
||||
TopLevelDestination.PROGRESS
|
||||
TopLevelDestination.PROGRESS,
|
||||
TopLevelDestination.SETTINGS
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user