mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
[a11y] Improve accessibility of media controller
This commit is contained in:
+8
-2
@@ -181,20 +181,26 @@ fun MediaPlayerControllerView(
|
|||||||
style = ElementTheme.typography.fontBodyXsMedium,
|
style = ElementTheme.typography.fontBodyXsMedium,
|
||||||
)
|
)
|
||||||
if (state.canMute) {
|
if (state.canMute) {
|
||||||
|
val a11yUnmute = stringResource(CommonStrings.common_unmute)
|
||||||
|
val a11yMute = stringResource(CommonStrings.common_mute)
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = onToggleMute,
|
onClick = onToggleMute,
|
||||||
|
modifier = Modifier
|
||||||
|
.semantics {
|
||||||
|
stateDescription = if (state.isMuted) a11yUnmute else a11yMute
|
||||||
|
},
|
||||||
) {
|
) {
|
||||||
if (state.isMuted) {
|
if (state.isMuted) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = CompoundIcons.VolumeOffSolid(),
|
imageVector = CompoundIcons.VolumeOffSolid(),
|
||||||
tint = ElementTheme.colors.iconPrimary,
|
tint = ElementTheme.colors.iconPrimary,
|
||||||
contentDescription = stringResource(CommonStrings.common_unmute)
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = CompoundIcons.VolumeOnSolid(),
|
imageVector = CompoundIcons.VolumeOnSolid(),
|
||||||
tint = ElementTheme.colors.iconPrimary,
|
tint = ElementTheme.colors.iconPrimary,
|
||||||
contentDescription = stringResource(CommonStrings.common_mute)
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user