File tree Expand file tree Collapse file tree
lib-compose/src/main/java/com/what3words/components/compose/maps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1605,27 +1605,20 @@ class W3WMapManager(
16051605 private suspend fun updateRecallButtonColor () {
16061606 withContext(dispatcher) {
16071607 val selectedLatLng = getSelectedAddress()?.center ? : return @withContext
1608-
1609- val markersAtSelectedSquare =
1610- getMarkersAt(selectedLatLng)
1611-
1612- val markerSlashColor = if (markersAtSelectedSquare.size == 1 ) {
1613- markersAtSelectedSquare.first().marker.color.slash
1614- } else {
1615- Color .White
1616- }
1617-
1618- val markerBackgroundColor = if (markersAtSelectedSquare.size == 1 ) {
1619- markersAtSelectedSquare.first().marker.color.background
1620- } else {
1621- Color (0xFFE11F26 ) // TODO: Define name for this color
1608+ val markersAtSelectedSquare = getMarkersAt(selectedLatLng)
1609+ val markerColor = when (markersAtSelectedSquare.size) {
1610+ 0 -> mapConfig?.markerConfig?.selectedZoomOutColor
1611+ 1 -> markersAtSelectedSquare.first().marker.color
1612+ else -> mapConfig?.markerConfig?.defaultMarkerColor
16221613 }
16231614
1624- _buttonState .update {
1625- it.copy(
1626- recallArrowColor = markerSlashColor,
1627- recallBackgroundColor = markerBackgroundColor
1628- )
1615+ markerColor?.let { color ->
1616+ _buttonState .update {
1617+ it.copy(
1618+ recallArrowColor = color.slash,
1619+ recallBackgroundColor = color.background,
1620+ )
1621+ }
16291622 }
16301623 }
16311624 }
You can’t perform that action at this time.
0 commit comments