diff --git a/dhis2_android_maps/src/main/java/org/dhis2/maps/views/MapSelectorViewModel.kt b/dhis2_android_maps/src/main/java/org/dhis2/maps/views/MapSelectorViewModel.kt index be7a2e02cc..a2b50d83ad 100644 --- a/dhis2_android_maps/src/main/java/org/dhis2/maps/views/MapSelectorViewModel.kt +++ b/dhis2_android_maps/src/main/java/org/dhis2/maps/views/MapSelectorViewModel.kt @@ -23,6 +23,7 @@ import org.dhis2.maps.layer.types.FEATURE_PROPERTY_PLACES import org.dhis2.maps.location.LocationState import org.dhis2.maps.location.LocationState.FIXED import org.dhis2.maps.location.LocationState.NOT_FIXED +import org.dhis2.maps.location.LocationState.OFF import org.dhis2.maps.model.AccuracyRange import org.dhis2.maps.model.MapData import org.dhis2.maps.model.MapSelectorScreenState @@ -449,7 +450,8 @@ class MapSelectorViewModel( private fun canCaptureWithSwipe() = featureType == FeatureType.POINT && _screenState.value.isManualCaptureEnabled && - _screenState.value.selectedLocation !is SelectedLocation.None + (_screenState.value.selectedLocation !is SelectedLocation.None || + _screenState.value.captureMode.isManual()) fun canCaptureManually(): Boolean { return _screenState.value.isManualCaptureEnabled @@ -477,7 +479,11 @@ class MapSelectorViewModel( else -> { updateScreenState( - captureMode = if (locationState == FIXED) CaptureMode.GPS else _screenState.value.captureMode, + captureMode = when (locationState) { + FIXED -> CaptureMode.GPS + OFF -> CaptureMode.MANUAL + else -> _screenState.value.captureMode + }, locationState = locationState, ) }