init
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
@@ -6,55 +7,67 @@ plugins {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "de.jadehs.strassenschadenpro2"
|
namespace = "de.jadehs.strassenschadenpro2"
|
||||||
compileSdk {
|
compileSdk = libs.versions.compileSdk.get().toInt()
|
||||||
version = release(36)
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "de.jadehs.strassenschadenpro2"
|
applicationId = "de.jadehs.strassenschadenpro2"
|
||||||
minSdk = 29
|
minSdk = libs.versions.minSdk.get().toInt()
|
||||||
targetSdk = 36
|
targetSdk = libs.versions.targetSdk.get().toInt()
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
versionName = "1.0"
|
versionName = "1.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
vectorDrawables {
|
||||||
|
useSupportLibrary = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = false
|
||||||
proguardFiles(
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
||||||
"proguard-rules.pro"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "11"
|
jvmTarget = "17"
|
||||||
}
|
}
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose = true
|
compose = true
|
||||||
}
|
}
|
||||||
|
packaging {
|
||||||
|
resources {
|
||||||
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation(libs.androidx.core.ktx)
|
implementation(libs.androidx.core.ktx)
|
||||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||||
implementation(libs.androidx.activity.compose)
|
implementation(libs.androidx.activity.compose)
|
||||||
implementation(platform(libs.androidx.compose.bom))
|
implementation(platform(libs.androidx.compose.bom))
|
||||||
implementation(libs.androidx.compose.ui)
|
implementation(libs.androidx.ui)
|
||||||
implementation(libs.androidx.compose.ui.graphics)
|
implementation(libs.androidx.ui.graphics)
|
||||||
implementation(libs.androidx.compose.ui.tooling.preview)
|
implementation(libs.androidx.ui.tooling.preview)
|
||||||
implementation(libs.androidx.compose.material3)
|
implementation(libs.androidx.material3)
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
androidTestImplementation(libs.androidx.junit)
|
androidTestImplementation(libs.androidx.junit)
|
||||||
androidTestImplementation(libs.androidx.espresso.core)
|
androidTestImplementation(libs.androidx.espresso.core)
|
||||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||||
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
androidTestImplementation(libs.androidx.ui.test.junit4)
|
||||||
debugImplementation(libs.androidx.compose.ui.tooling)
|
debugImplementation(libs.androidx.ui.tooling)
|
||||||
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
debugImplementation(libs.androidx.ui.test.manifest)
|
||||||
|
|
||||||
|
// ArcGIS Maps for Kotlin - SDK dependency
|
||||||
|
implementation(libs.arcgis.maps.kotlin)
|
||||||
|
// Toolkit dependencies
|
||||||
|
implementation(platform(libs.arcgis.maps.kotlin.toolkit.bom))
|
||||||
|
implementation(libs.arcgis.maps.kotlin.toolkit.geoview.compose)
|
||||||
|
implementation(libs.arcgis.maps.kotlin.toolkit.authentication)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
|
|||||||
@@ -28,11 +28,17 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.modifier.modifierLocalConsumer
|
import androidx.compose.ui.modifier.modifierLocalConsumer
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.arcgismaps.ApiKey
|
||||||
|
import com.arcgismaps.ArcGISEnvironment
|
||||||
|
import com.arcgismaps.httpcore.authentication.OAuthUserConfiguration
|
||||||
|
import com.arcgismaps.toolkit.authentication.AuthenticatorState
|
||||||
|
import com.arcgismaps.toolkit.authentication.DialogAuthenticator
|
||||||
import de.jadehs.strassenschadenpro2.ui.theme.StrassenSchadenPro2Theme
|
import de.jadehs.strassenschadenpro2.ui.theme.StrassenSchadenPro2Theme
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
ArcGISEnvironment.apiKey = ApiKey.create(BuildConfig.ACCESS_TOKEN)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
setContent {
|
setContent {
|
||||||
StrassenSchadenPro2Theme {
|
StrassenSchadenPro2Theme {
|
||||||
@@ -40,4 +46,5 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,24 @@ import androidx.compose.runtime.mutableStateOf
|
|||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.material3.TopAppBar
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import de.jadehs.strassenschadenpro2.pages.CreatePage
|
import de.jadehs.strassenschadenpro2.pages.CreatePage
|
||||||
import de.jadehs.strassenschadenpro2.pages.ListPage
|
import de.jadehs.strassenschadenpro2.pages.ListPage
|
||||||
import de.jadehs.strassenschadenpro2.pages.MapPage
|
import de.jadehs.strassenschadenpro2.pages.MapPage
|
||||||
import de.jadehs.strassenschadenpro2.pages.SettingsPage
|
import de.jadehs.strassenschadenpro2.pages.SettingsPage
|
||||||
|
import com.arcgismaps.mapping.ArcGISMap
|
||||||
|
import com.arcgismaps.mapping.BasemapStyle
|
||||||
|
import com.arcgismaps.mapping.Viewpoint
|
||||||
|
import com.arcgismaps.toolkit.geoviewcompose.MapView
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MainScreen(modifier: Modifier = Modifier) {
|
fun MainScreen(modifier: Modifier = Modifier) {
|
||||||
|
|
||||||
|
val map = remember {
|
||||||
|
createMap()
|
||||||
|
}
|
||||||
|
|
||||||
val navItemList = listOf(
|
val navItemList = listOf(
|
||||||
NavItem("Karte",Icons.Default.Place),
|
NavItem("Karte",Icons.Default.Place),
|
||||||
NavItem("Erstellen",Icons.Default.AddCircle),
|
NavItem("Erstellen",Icons.Default.AddCircle),
|
||||||
@@ -36,7 +46,9 @@ fun MainScreen(modifier: Modifier = Modifier) {
|
|||||||
|
|
||||||
var selectedIndex by remember { mutableStateOf(0) }
|
var selectedIndex by remember { mutableStateOf(0) }
|
||||||
|
|
||||||
Scaffold(modifier = Modifier.fillMaxSize(),
|
Scaffold(
|
||||||
|
//topBar = { TopAppBar(title = { Text(text = stringResource(id = R.string.app_name)) }) },
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
NavigationBar {
|
NavigationBar {
|
||||||
navItemList.forEachIndexed { index, item ->
|
navItemList.forEachIndexed { index, item ->
|
||||||
@@ -52,7 +64,12 @@ fun MainScreen(modifier: Modifier = Modifier) {
|
|||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
innerPadding ->
|
innerPadding ->
|
||||||
ContentScreen(modifier = Modifier.padding(innerPadding), selectedIndex)
|
MapView(
|
||||||
|
modifier = Modifier.fillMaxSize().padding(innerPadding),
|
||||||
|
arcGISMap = map,
|
||||||
|
insets = innerPadding
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,3 +83,13 @@ fun ContentScreen(modifier: Modifier = Modifier, selectedIndex: Int) {
|
|||||||
3 -> SettingsPage()
|
3 -> SettingsPage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun createMap(): ArcGISMap {
|
||||||
|
return ArcGISMap(BasemapStyle.ArcGISTopographic).apply {
|
||||||
|
initialViewpoint = Viewpoint(
|
||||||
|
latitude = 34.0270,
|
||||||
|
longitude = -118.8050,
|
||||||
|
scale = 72000.0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,28 @@
|
|||||||
[versions]
|
[versions]
|
||||||
agp = "8.13.0"
|
arcgisMapsKotlin = "200.8.0"
|
||||||
kotlin = "2.0.21"
|
|
||||||
coreKtx = "1.17.0"
|
# Version numbers added by Android Studio New Project Wizard
|
||||||
|
agp = "8.9.2"
|
||||||
|
kotlin = "2.1.20"
|
||||||
|
coreKtx = "1.16.0"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
junitVersion = "1.3.0"
|
junitVersion = "1.2.1"
|
||||||
espressoCore = "3.7.0"
|
espressoCore = "3.6.1"
|
||||||
lifecycleRuntimeKtx = "2.9.4"
|
lifecycleRuntimeKtx = "2.8.7"
|
||||||
activityCompose = "1.11.0"
|
activityCompose = "1.10.1"
|
||||||
composeBom = "2024.09.00"
|
composeBom = "2025.04.00"
|
||||||
|
|
||||||
|
# Other version numbers
|
||||||
|
compileSdk = "36"
|
||||||
|
minSdk = "28"
|
||||||
|
targetSdk = "36"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
arcgis-maps-kotlin = { group = "com.esri", name = "arcgis-maps-kotlin", version.ref = "arcgisMapsKotlin" }
|
||||||
|
arcgis-maps-kotlin-toolkit-bom = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-bom", version.ref = "arcgisMapsKotlin" }
|
||||||
|
arcgis-maps-kotlin-toolkit-geoview-compose = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-geoview-compose" }
|
||||||
|
arcgis-maps-kotlin-toolkit-authentication = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-authentication" }
|
||||||
|
|
||||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||||
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||||
@@ -17,16 +30,15 @@ androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-co
|
|||||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
||||||
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||||
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||||
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
|
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
|
||||||
androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
||||||
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
||||||
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
||||||
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
||||||
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
||||||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,21 @@ pluginManagement {
|
|||||||
includeGroupByRegex("androidx.*")
|
includeGroupByRegex("androidx.*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url = uri("https://esri.jfrog.io/artifactory/arcgis") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "StrassenSchadenPro2"
|
rootProject.name = "Tutorial"
|
||||||
include(":app")
|
include(":app")
|
||||||
|
|
||||||
Reference in New Issue
Block a user