mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
feat: initial project structure with Settings screen
- Set up Kotlin + Jetpack Compose Android project - Configure Gradle with version catalog and all dependencies - Implement Settings screen for TeslamateApi server configuration - Add Material Design 3 theming with Tesla-inspired colors - Set up Hilt dependency injection - Add DataStore for settings persistence - Include navigation component with Compose integration - Add GPLv3 license 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
44
app/src/main/java/com/matedroid/ui/navigation/NavGraph.kt
Normal file
44
app/src/main/java/com/matedroid/ui/navigation/NavGraph.kt
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.matedroid.ui.navigation
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.matedroid.ui.screens.settings.SettingsScreen
|
||||
|
||||
sealed class Screen(val route: String) {
|
||||
data object Settings : Screen("settings")
|
||||
data object Dashboard : Screen("dashboard")
|
||||
data object Charges : Screen("charges")
|
||||
data object ChargeDetail : Screen("charges/{chargeId}") {
|
||||
fun createRoute(chargeId: Int) = "charges/$chargeId"
|
||||
}
|
||||
data object Drives : Screen("drives")
|
||||
data object DriveDetail : Screen("drives/{driveId}") {
|
||||
fun createRoute(driveId: Int) = "drives/$driveId"
|
||||
}
|
||||
data object Battery : Screen("battery")
|
||||
data object Updates : Screen("updates")
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun NavGraph() {
|
||||
val navController = rememberNavController()
|
||||
|
||||
NavHost(
|
||||
navController = navController,
|
||||
startDestination = Screen.Settings.route
|
||||
) {
|
||||
composable(Screen.Settings.route) {
|
||||
SettingsScreen(
|
||||
onNavigateToDashboard = {
|
||||
navController.navigate(Screen.Dashboard.route) {
|
||||
popUpTo(Screen.Settings.route) { inclusive = true }
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// Dashboard and other screens will be added in subsequent phases
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user