Merge pull request #1845 from vector-im/feature/bma/sendingStateA11y

Content description: add for sending state and fix other issues.
This commit is contained in:
Benoit Marty 2023-11-22 17:51:48 +01:00 committed by GitHub
commit 68c4f1e6bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 90 additions and 49 deletions

View file

@ -70,7 +70,7 @@ fun RoundedIconAtom(
tint = tint,
resourceId = resourceId,
imageVector = imageVector,
contentDescription = "",
contentDescription = null,
)
}
}

View file

@ -51,7 +51,7 @@ fun BackButton(
@Composable
internal fun BackButtonPreview() = ElementThemedPreview {
Column {
BackButton(onClick = { }, enabled = true, contentDescription = "Back")
BackButton(onClick = { }, enabled = false, contentDescription = "Back")
BackButton(onClick = { }, enabled = true)
BackButton(onClick = { }, enabled = false)
}
}

View file

@ -51,7 +51,7 @@ fun PreferenceIcon(
Icon(
imageVector = icon,
resourceId = iconResourceId,
contentDescription = "",
contentDescription = null,
tint = tintColor ?: enabled.toSecondaryEnabledColor(),
modifier = Modifier
.padding(end = 16.dp)

View file

@ -66,7 +66,7 @@ internal fun FloatingActionButtonPreview() =
private fun ContentToPreview() {
Box(modifier = Modifier.padding(8.dp)) {
FloatingActionButton(onClick = {}) {
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
}
}
}

View file

@ -145,5 +145,5 @@ internal fun IconImageVectorPreview() =
@Composable
private fun ContentToPreview() {
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
}

View file

@ -67,20 +67,20 @@ private fun ContentToPreview() {
CompositionLocalProvider(LocalContentColor provides ElementTheme.colors.iconPrimary) {
Row {
IconButton(onClick = {}) {
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
}
IconButton(enabled = false, onClick = {}) {
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
}
}
}
CompositionLocalProvider(LocalContentColor provides ElementTheme.colors.iconSecondary) {
Row {
IconButton(onClick = {}) {
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
}
IconButton(enabled = false, onClick = {}) {
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
}
}
}

View file

@ -69,7 +69,7 @@ private fun ContentToPreview() {
val icon: @Composable () -> Unit = {
Icon(
imageVector = if (checked) Icons.Default.CheckCircle else Icons.Default.RadioButtonUnchecked,
contentDescription = "IconToggleButton"
contentDescription = null
)
}
IconToggleButton(checked = checked, enabled = true, onCheckedChange = { checked = !checked }, content = icon)
@ -79,7 +79,7 @@ private fun ContentToPreview() {
val icon: @Composable () -> Unit = {
Icon(
imageVector = if (!checked) Icons.Default.CheckCircle else Icons.Default.RadioButtonUnchecked,
contentDescription = "IconToggleButton"
contentDescription = null
)
}
IconToggleButton(checked = !checked, enabled = true, onCheckedChange = { checked = !checked }, content = icon)

View file

@ -43,7 +43,10 @@ internal fun MenuPreview() {
for (i in 0..5) {
val leadingIcon: @Composable (() -> Unit)? = if (i in 2..3) {
@Composable {
Icon(Icons.Filled.Favorite, contentDescription = "Favorite")
Icon(
imageVector = Icons.Filled.Favorite,
contentDescription = null
)
}
} else {
null
@ -53,7 +56,7 @@ internal fun MenuPreview() {
@Composable {
Icon(
resourceId = CommonDrawables.ic_compound_chevron_right,
contentDescription = "Favorite",
contentDescription = null,
)
}
} else {