Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1605,27 +1605,20 @@ class W3WMapManager(
private suspend fun updateRecallButtonColor() {
withContext(dispatcher) {
val selectedLatLng = getSelectedAddress()?.center ?: return@withContext

val markersAtSelectedSquare =
getMarkersAt(selectedLatLng)

val markerSlashColor = if (markersAtSelectedSquare.size == 1) {
markersAtSelectedSquare.first().marker.color.slash
} else {
Color.White
}

val markerBackgroundColor = if (markersAtSelectedSquare.size == 1) {
markersAtSelectedSquare.first().marker.color.background
} else {
Color(0xFFE11F26) // TODO: Define name for this color
val markersAtSelectedSquare = getMarkersAt(selectedLatLng)
val markerColor = when (markersAtSelectedSquare.size) {
0 -> mapConfig?.markerConfig?.selectedZoomOutColor
1 -> markersAtSelectedSquare.first().marker.color
else -> mapConfig?.markerConfig?.defaultMarkerColor
}

_buttonState.update {
it.copy(
recallArrowColor = markerSlashColor,
recallBackgroundColor = markerBackgroundColor
)
markerColor?.let { color ->
_buttonState.update {
it.copy(
recallArrowColor = color.slash,
recallBackgroundColor = color.background,
)
}
}
}
}
Expand Down
Loading