Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ artifactoryPassword=""
# when building the toolkit locally, typically from Android Studio.
# You will need to specify the build version in local.properties.
# Example:
# sdkBuildNumber=4446
sdkBuildNumber=9999
# When building the toolkit with CI, these versions are obtained from command line provided properties,
# see sdkVersionNumber in settings.gradle.kts.
sdkVersionNumber=200.7.0
sdkVersionNumber=200.8.0
21 changes: 20 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ junit = "4.13.2"
kotlin = "2.1.0"
ksp = "2.1.0-1.0.29"
media3Exoplayer = "1.5.0"
minSdk = "26"
minSdk = "28"
mlkitBarcodeScanning = "17.3.0"
kotlinxCoroutinesTest = "1.8.0"
kotlinxSerializationJson = "1.8.0"
Expand All @@ -36,8 +36,27 @@ truth = "1.4.4"
uiautomator = "2.3.0"
arcore = "1.47.0"
playServicesLocation = "21.3.0"
okhttpBom = "4.12.0"
kotlinVersion="2.1.20"
ktx="1.16.0"
coroutinesAndroid="1.10.1"
coroutines="1.10.1"
jsonSerialization="1.8.0"
lifecycle="2.8.7"
securityCrypto="1.0.0"

[libraries]
okhttp = { module = "com.squareup.okhttp3:okhttp" }
okhttp-bom = { group = "com.squareup.okhttp3", name = "okhttp-bom", version.ref = "okhttpBom" }
okhttp-url-connection = { module = "com.squareup.okhttp3:okhttp-urlconnection" }
okhttp-tls = { module = "com.squareup.okhttp3:okhttp-tls" }
kotlin-std-lib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlinVersion" }
ktx-core = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutinesAndroid" }
coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "jsonSerialization" }
lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common", version.ref = "lifecycle" }
security = { group = "androidx.security", name = "security-crypto", version.ref = "securityCrypto" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose"}
androidx-browser = { group = "androidx.browser", name = "browser", version.ref = "androidXBrowser"}
androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "androidxCamera" }
Expand Down
2 changes: 1 addition & 1 deletion kdoc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ dependencies {
// Puts the version in the KDoc
dokkaPlugin(libs.dokka.versioning)
// put exposed dependencies in dokka's classpath
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
}
Expand Down
1 change: 1 addition & 0 deletions mapsSdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
2 changes: 2 additions & 0 deletions mapsSdk/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file("libs/arcgis-maps-kotlin-200.8.0-9999.aar"))
2 changes: 1 addition & 1 deletion microapps/ArTabletopApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies {
implementation(project(":microapps-lib"))
implementation(project(":ar"))
implementation(libs.arcore)
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/ArWorldScaleApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies {
implementation(project(":microapps-lib"))
implementation(project(":ar"))
implementation(libs.arcore)
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/AuthenticationApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":authentication"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/BasemapGalleryApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
implementation(project(":basemapgallery"))
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/CompassApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ dependencies {
implementation(project(":compass"))
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/FeatureFormsApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
implementation(project(":featureforms"))
implementation(project(":geoview-compose"))
// sdk
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
// hilt
implementation(libs.hilt.android.core)
implementation(libs.androidx.hilt.navigation.compose)
Expand Down
2 changes: 1 addition & 1 deletion microapps/FloorFilterApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
implementation(project(":indoors"))
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/LegendApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
implementation(project(":legend"))
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/MapViewCalloutApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/MapViewGeometryEditorApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.tooling.preview.Preview
import com.arcgismaps.ApiKey
import com.arcgismaps.ArcGISEnvironment
import com.arcgismaps.mapping.view.geometryeditor.GeometryEditor
import com.arcgismaps.mapping.view.geometryeditor.ProgrammaticReticleTool
import com.arcgismaps.toolkit.mapviewgeometryeditorapp.screens.MainScreen
import com.esri.microappslib.theme.MicroAppTheme

Expand All @@ -43,7 +46,9 @@ class MainActivity : ComponentActivity() {

@Composable
fun MapViewGeometryEditorApp() {
MainScreen()
// the geometry editor used to manage the editing session
val geometryEditor = remember { GeometryEditor() }
MainScreen(geometryEditor)
}

@Preview(showBackground = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material3.Button
import androidx.compose.ui.Alignment
import androidx.compose.foundation.layout.offset
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
Expand All @@ -35,8 +38,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.arcgismaps.Color
import com.arcgismaps.geometry.Geometry
import com.arcgismaps.geometry.GeometryType
Expand All @@ -49,8 +54,12 @@ import com.arcgismaps.mapping.symbology.SimpleLineSymbolStyle
import com.arcgismaps.mapping.view.Graphic
import com.arcgismaps.mapping.view.GraphicsOverlay
import com.arcgismaps.mapping.view.geometryeditor.GeometryEditor
import com.arcgismaps.mapping.view.geometryeditor.ProgrammaticReticleTool
import com.arcgismaps.mapping.view.geometryeditor.VertexTool
import com.arcgismaps.toolkit.geoviewcompose.MapView
import com.arcgismaps.toolkit.geoviewcompose.MapViewProxy
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch

// line symbol of the graphic sketched on the map
private val lineSymbol: SimpleLineSymbol by lazy {
Expand Down Expand Up @@ -78,12 +87,13 @@ private val fillSymbol: SimpleFillSymbol by lazy {
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MainScreen() {
fun MainScreen(geometryEditor: GeometryEditor) {
val mapViewProxy = remember { MapViewProxy() }
val coroutineScope = rememberCoroutineScope()

val arcGISMap by remember { mutableStateOf(ArcGISMap(BasemapStyle.ArcGISStreets)) }
// the list of graphics overlays used by the MapView
var graphicsOverlays by remember { mutableStateOf(emptyList<GraphicsOverlay>()) }
// the geometry editor used to manage the editing session
val geometryEditor = remember { GeometryEditor() }
// track the status if geometry editor is started or stopped
var isDrawingEnabled by remember { mutableStateOf(false) }

Expand Down Expand Up @@ -112,11 +122,22 @@ fun MainScreen() {
} else {
// on checked change, start the geometry editor
startGeometryEditor(geometryEditor)
geometryEditor.tool = ProgrammaticReticleTool()
// set isDrawingEnabled to true
true
}
})

Button(enabled = isDrawingEnabled,
onClick = {
if (geometryEditor.hoveredElement.value != null && geometryEditor.pickedUpElement.value == null) {
(geometryEditor.tool as ProgrammaticReticleTool).selectElementAtReticle()
(geometryEditor.tool as ProgrammaticReticleTool).pickUpSelectedElement()
} else if (geometryEditor.hoveredElement.value == null)
(geometryEditor.tool as ProgrammaticReticleTool).placeElementAtReticle()
})
{ Text("Do Action") }

var actionsExpanded by remember { mutableStateOf(false) }
IconButton(onClick = { actionsExpanded = !actionsExpanded }) {
Icon(Icons.Default.MoreVert, "More")
Expand All @@ -143,7 +164,21 @@ fun MainScreen() {
.padding(innerPadding)
.fillMaxSize(),
geometryEditor = geometryEditor,
graphicsOverlays = graphicsOverlays
graphicsOverlays = graphicsOverlays,
mapViewProxy = mapViewProxy,
onSingleTapConfirmed = {
(geometryEditor.tool as ProgrammaticReticleTool).placeElementAtReticle()
},
onLongPress = {
coroutineScope.launch {
val result = mapViewProxy.identifyGeometryEditor(it.screenCoordinate, 15.dp)
result.onSuccess {
result.getOrNull()?.elements?.firstOrNull()?.let {
mapViewProxy.setViewpointGeometry(it.extent as Geometry)
}
}
}
}
)
}
}
Expand All @@ -160,7 +195,7 @@ fun GeometryEditorDropDownMenu(
onResetAllGraphics: () -> Unit = {}
) {
val items = remember {
listOf("Clear sketch", "Undo sketch", "Redo sketch", "Reset all graphics")
listOf("Cancel move", "Clear sketch", "Undo sketch", "Redo sketch", "Reset all graphics")
}
DropdownMenu(
expanded = expanded,
Expand All @@ -172,6 +207,10 @@ fun GeometryEditorDropDownMenu(
text = { Text(text = it) },
onClick = {
when {
it.contains("Cancel move") -> {
geometryEditor.cancelCurrentAction()
}

it.contains("Clear sketch") -> {
clearGeometryEditor(geometryEditor)
}
Expand Down
2 changes: 1 addition & 1 deletion microapps/MapViewIdentifyApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/MapViewInsetsApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/MapViewLocationDisplayApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/MapViewSetViewpointApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/PopupApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ android {

dependencies {
implementation(project(":geoview-compose"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(project(":popup"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
Expand Down
2 changes: 1 addition & 1 deletion microapps/ScalebarApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
implementation(project(":scalebar"))
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/SceneViewCalloutApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/SceneViewLightingOptionsApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
2 changes: 1 addition & 1 deletion microapps/SceneViewSetViewpointApp/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ android {
dependencies {
implementation(project(":geoview-compose"))
implementation(project(":microapps-lib"))
implementation(arcgis.mapsSdk)
implementation(project(":mapsSdk"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.bundles.composeCore)
implementation(libs.bundles.core)
Expand Down
Loading