Pass Application context to MapPage and ContentScreen, create MapViewModel for ArcGISMap management, and refactor MapPage to display an interactive map.

This commit is contained in:
2025-11-20 09:32:22 +01:00
parent c05ea2878e
commit 04fd485cf9
4 changed files with 39 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
package de.jadehs.strassenschadenpro2
import android.app.Application
import android.util.Log
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
@@ -25,7 +26,7 @@ import de.jadehs.strassenschadenpro2.pages.MapPage
import de.jadehs.strassenschadenpro2.pages.SettingsPage
@Composable
fun MainScreen(modifier: Modifier = Modifier) {
fun MainScreen(modifier: Modifier = Modifier, application: Application) {
val navItemList = listOf(
NavItem("Karte",Icons.Default.Place),
@@ -52,15 +53,15 @@ fun MainScreen(modifier: Modifier = Modifier) {
}
}) {
innerPadding ->
ContentScreen(modifier = Modifier.padding(innerPadding), selectedIndex)
ContentScreen(modifier = Modifier.padding(innerPadding), selectedIndex, application)
}
}
@Composable
fun ContentScreen(modifier: Modifier = Modifier, selectedIndex: Int) {
fun ContentScreen(modifier: Modifier = Modifier, selectedIndex: Int, application: Application) {
when(selectedIndex) {
0 -> MapPage()
0 -> MapPage(application=application)
1 -> CreatePage()
2 -> ListPage()
3 -> SettingsPage()