Skip to content

Commit b759e9f

Browse files
Add default button color, default content description, string resource
1 parent 5a3bb56 commit b759e9f

File tree

6 files changed

+236
-119
lines changed

6 files changed

+236
-119
lines changed

lib-compose/src/main/java/com/what3words/components/compose/maps/W3WMapComponent.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ internal fun W3WMapContent(
316316
buttonConfig = mapConfig.buttonConfig,
317317
buttonState = buttonState,
318318
isLocationEnabled = mapState.isMyLocationEnabled,
319-
isDarkMode = mapState.isDarkMode,
320319
onMapTypeClicked = onMapTypeClicked,
321320
onMyLocationClicked = onMyLocationClicked,
322321
onRecallClicked = onRecallClicked,

lib-compose/src/main/java/com/what3words/components/compose/maps/buttons/MapSwitchButton.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ import com.what3words.map.components.compose.R
2424
*
2525
* @param modifier The modifier for the button.
2626
* @param w3wMapType The current map type.
27+
* @param contentDescription The content description for the button.
2728
* @param onMapTypeChange The callback function to be invoked when the map type is changed.
2829
*/
2930
@Composable
3031
fun MapSwitchButton(
3132
modifier: Modifier = Modifier,
3233
w3wMapType: W3WMapType = W3WMapType.NORMAL,
34+
contentDescription: W3WMapButtonsDefault.ContentDescription = W3WMapButtonsDefault.defaultContentDescription(),
3335
onMapTypeChange: (W3WMapType) -> Unit
3436
) {
3537
var mapType by remember { mutableStateOf(w3wMapType) }
@@ -55,7 +57,7 @@ fun MapSwitchButton(
5557
else -> R.drawable.ic_map_satellite
5658
}
5759
),
58-
contentDescription = null, // TODO: Add content description later
60+
contentDescription = contentDescription.mapSwitchButtonDescription,
5961
)
6062
}
6163
}

0 commit comments

Comments
 (0)