Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ dependencies {
implementation(libs.androidx.room.ktx)
implementation(libs.coil.compose)
implementation(libs.coil.network.http)
implementation(libs.androidx.compose.material.icons.extended)
annotationProcessor(libs.androidx.room.compiler)
ksp(libs.androidx.room.compiler)
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
implementation(libs.findLibrary("androidx-constraintlayout").get())
implementation(libs.findLibrary("androidx-appcompat").get())
implementation(libs.findLibrary("android-material").get())
implementation(libs.findLibrary("androidx-compose-material-icons-extended").get())
}
}
}
Expand Down
47 changes: 25 additions & 22 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
[versions]

# ArcGIS Maps SDK for Kotlin version
arcgisMapsKotlinVersion = "300.0.0-4790"
arcgisMapsKotlinVersion = "300.0.0-4810"

### Android versions
androidGradlePlugin = "8.12.1"
lifecycle = "2.9.2"
androidTools = "31.12.1"
androidGradlePlugin = "8.13.2"
lifecycle = "2.10.0"
androidTools = "31.13.2"
appcompat = "1.7.1"
constraintLayoutVersion = "2.2.1"
kotlinxSerializationJson = "1.9.0"
accompanistSystemuicontroller = "0.36.0"
workVersion = "2.10.3"
datastorePreferences = "1.1.7"
roomVersion = "2.7.2"
workVersion = "2.11.0"
datastorePreferences = "1.2.0"
roomVersion = "2.8.4"

### Kotlin versions
kotlinVersion = "2.2.10"
kotlinVersion = "2.2.21"
coreKtx = "1.17.0"
ksp = "2.2.10-2.0.2"
kotlinReflection = "2.2.20"
commonsIoVersion = "2.20.0"
ksp = "2.3.3"
kotlinReflection = "2.2.21"
commonsIoVersion = "2.21.0"

### Compose versions
composeBom = "2025.08.00"
activityCompose = "1.10.1"
material = "1.12.0"
navigationCompose = "2.9.3"
composeBom = "2025.12.00"
activityCompose = "1.12.1"
material = "1.13.0"
navigationCompose = "2.9.6"
materialIconsExt = "1.7.8"

### Testing versions
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"

### Application Verions
versionCode = "2008000"
versionName = "200.8.0"
versionCode = "3000000"
versionName = "300.0.0"
minSdk = "28"
targetSdk = "36"

### Third party libraries
arcore = "1.50.0"
arcore = "1.51.0"
playServicesLocation = "21.3.0"
navigationFragmentKtx = "2.9.3"
navigationUiKtx = "2.9.3"
navigationFragmentKtx = "2.9.6"
navigationUiKtx = "2.9.6"
coil = "3.3.0"

[libraries]

Expand Down Expand Up @@ -76,6 +78,7 @@ androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" }
androidx-compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "materialIconsExt"}

### ArcGIS Maps SDK for Kotlin libs
arcgis-maps-kotlin = { group = "com.esri", name = "arcgis-maps-kotlin", version.ref = "arcgisMapsKotlinVersion" }
Expand All @@ -88,8 +91,8 @@ arcgis-maps-kotlin-toolkit-popup = { group = "com.esri", name = "arcgis-maps-kot
arcgis-maps-kotlin-toolkit-scalebar = { group = "com.esri", name = "arcgis-maps-kotlin-toolkit-scalebar" }

### Third party libraries
coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version = "3.0.0-rc01" }
coil-network-http = { group = "io.coil-kt.coil3", name = "coil-network-okhttp", version = "3.0.0-rc01" }
coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil" }
coil-network-http = { group = "io.coil-kt.coil3", name = "coil-network-okhttp", version.ref = "coil" }
ar-core = { group = "com.google.ar", name = "core", version.ref = "arcore" }
play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "playServicesLocation" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ package com.esri.arcgismaps.sample.sampleslib.components
import android.content.res.Configuration
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -59,7 +59,7 @@ fun DropDownMenuBox(
onValueChange = {},
readOnly = true,
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
modifier = Modifier.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable)
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold
Expand Down Expand Up @@ -269,7 +269,7 @@ fun AttributeDropdown(
enabled = availableValues.isNotEmpty(),
modifier = Modifier
.fillMaxWidth()
.menuAnchor(type = MenuAnchorType.PrimaryNotEditable),
.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable),
value = textValue ?: "",
onValueChange = {},
label = { Text(attributeName) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.Button
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Slider
Expand Down Expand Up @@ -200,7 +200,7 @@ private fun ImageOverlayMenu(
onValueChange = {},
readOnly = true,
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
modifier = Modifier.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable)
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Slider
Expand Down Expand Up @@ -207,7 +207,7 @@ fun HillshadeRendererOptions(
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
modifier = Modifier
.fillMaxWidth()
.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable)
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -146,7 +146,7 @@ private fun LayerPickerBar(
label = { Text("Layers") },
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded) },
modifier = Modifier
.menuAnchor(MenuAnchorType.PrimaryNotEditable)
.menuAnchor(ExposedDropdownMenuAnchorType.PrimaryNotEditable)
.fillMaxWidth()
)
ExposedDropdownMenu(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.rounded.Close
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SheetState
Expand Down Expand Up @@ -268,7 +268,7 @@ private fun ClusterRadiusControls(
onValueChange = {},
readOnly = true,
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
modifier = Modifier.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable)
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down Expand Up @@ -322,7 +322,7 @@ private fun ClusterMaxScaleControls(
onValueChange = {},
readOnly = true,
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
modifier = Modifier.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable)
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import androidx.compose.material3.Button
import androidx.compose.material3.Checkbox
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
Expand Down Expand Up @@ -275,7 +275,7 @@ fun FolderDropdown(
OutlinedTextField(
modifier = Modifier
.fillMaxWidth()
.menuAnchor(type = MenuAnchorType.PrimaryNotEditable),
.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable),
value = label,
onValueChange = { newDescription -> label = newDescription },
label = { Text(text = "Folder:") },
Expand Down Expand Up @@ -340,7 +340,7 @@ fun BasemapDropdown(
OutlinedTextField(
modifier = Modifier
.fillMaxWidth()
.menuAnchor(type = MenuAnchorType.PrimaryNotEditable),
.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable),
value = basemapStyle,
onValueChange = {},
label = { Text(text = "Basemap Style:") },
Expand Down Expand Up @@ -391,7 +391,7 @@ fun LayersDropdown(
OutlinedTextField(
modifier = Modifier
.fillMaxWidth()
.menuAnchor(type = MenuAnchorType.PrimaryNotEditable),
.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable),
value = "Select...",
onValueChange = {},
label = { Text(text = "Operational Layers:") },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material3.Button
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.FilledTonalIconButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
Expand Down Expand Up @@ -285,7 +285,7 @@ fun TrackBrowseOptions(
onValueChange = {},
readOnly = true,
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
modifier = Modifier.menuAnchor(type = MenuAnchorType.PrimaryNotEditable)
modifier = Modifier.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryNotEditable)
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package com.esri.arcgismaps.sample.showpopup.components

import android.app.Application
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.unit.dp
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
Expand All @@ -28,11 +25,13 @@ import com.arcgismaps.geometry.GeometryType
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.PortalItem
import com.arcgismaps.mapping.layers.FeatureLayer
import com.arcgismaps.mapping.popup.Popup
import com.arcgismaps.mapping.view.SingleTapConfirmedEvent
import com.arcgismaps.portal.Portal
import com.arcgismaps.toolkit.geoviewcompose.MapViewProxy
import com.arcgismaps.toolkit.popup.PopupState
import com.esri.arcgismaps.sample.sampleslib.components.MessageDialogViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch

class ShowPopupViewModel(application: Application) : AndroidViewModel(application) {
Expand All @@ -55,9 +54,10 @@ class ShowPopupViewModel(application: Application) : AndroidViewModel(applicatio
}
}

// Popup that gets passed to the main screen composable
var popup: Popup? by mutableStateOf(null)
private set
// PopupState flow that gets passed to the main screen composable
private var _popupState = MutableStateFlow<PopupState?>(null)
val popupState = _popupState.asStateFlow()


// Keep track of the identified feature
private var identifiedFeature: Feature? = null
Expand Down Expand Up @@ -87,11 +87,12 @@ class ShowPopupViewModel(application: Application) : AndroidViewModel(applicatio
tolerance = 12.dp,
returnPopupsOnly = true
).onSuccess { result ->
popup = result.popups.first().also { popup ->
val popup = result.popups.first().also { popup ->
identifiedFeature = (popup.geoElement as Feature).also { identifiedFeature ->
featureLayer.selectFeature(identifiedFeature)
}
}
_popupState.value = PopupState(popup,viewModelScope)
}.onFailure { error ->
messageDialogVM.showMessageDialog(
title = "Failed to identify: ${error.message}",
Expand All @@ -105,7 +106,7 @@ class ShowPopupViewModel(application: Application) : AndroidViewModel(applicatio
* Dismiss the popup and unselect the identified feature.
*/
fun onDismissRequest() {
popup = null
_popupState.value = null
identifiedFeature?.let { featureLayer.unselectFeature(it) }
}
}
Loading
Loading