Fix some contentDescription.

This commit is contained in:
Benoit Marty 2023-11-21 14:44:38 +01:00
parent b62f1ebb05
commit 88a7cc9740
6 changed files with 15 additions and 9 deletions

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

@ -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 {