Prevent usage of hard-coded string for contentDescription, and fix existing issues.

This commit is contained in:
Benoit Marty 2023-11-21 15:36:20 +01:00
parent 2e6803ac41
commit 67ed385e45
12 changed files with 20 additions and 16 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 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)
}
}
}