Prevent usage of hard-coded string for contentDescription, and fix existing issues.
This commit is contained in:
@@ -58,7 +58,7 @@ fun RoomPrivacyOption(
|
||||
Icon(
|
||||
modifier = Modifier.padding(horizontal = 8.dp),
|
||||
resourceId = roomPrivacyItem.icon,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
)
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ private fun PinUnlockHeader(
|
||||
.size(32.dp),
|
||||
tint = ElementTheme.colors.iconPrimary,
|
||||
imageVector = Icons.Filled.Lock,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
@@ -70,7 +70,7 @@ fun RoundedIconAtom(
|
||||
tint = tint,
|
||||
resourceId = resourceId,
|
||||
imageVector = imageVector,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ fun PreferenceIcon(
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
resourceId = iconResourceId,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
tint = tintColor ?: enabled.toSecondaryEnabledColor(),
|
||||
modifier = Modifier
|
||||
.padding(end = 16.dp)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ fun EditableAvatarView(
|
||||
Icon(
|
||||
modifier = Modifier.size(16.dp),
|
||||
resourceId = CommonDrawables.ic_edit,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onPrimary,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ fun UnresolvedUserRow(
|
||||
) {
|
||||
Icon(
|
||||
resourceId = CommonDrawables.ic_compound_error,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.size(18.dp)
|
||||
.align(Alignment.Top)
|
||||
|
||||
@@ -72,7 +72,7 @@ fun UnsavedAvatar(
|
||||
Box(modifier = commonModifier.background(ElementTheme.colors.temporaryColorBgSpecial)) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.AddAPhoto,
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.align(Alignment.Center)
|
||||
.size(40.dp),
|
||||
|
||||
@@ -98,19 +98,19 @@ internal fun FormattingButtonPreview() = ElementPreview {
|
||||
state = FormattingOptionState.Default,
|
||||
onClick = { },
|
||||
imageVector = ImageVector.vectorResource(CommonDrawables.ic_bold),
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
)
|
||||
FormattingOption(
|
||||
state = FormattingOptionState.Selected,
|
||||
onClick = { },
|
||||
imageVector = ImageVector.vectorResource(CommonDrawables.ic_italic),
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
)
|
||||
FormattingOption(
|
||||
state = FormattingOptionState.Disabled,
|
||||
onClick = { },
|
||||
imageVector = ImageVector.vectorResource(CommonDrawables.ic_underline),
|
||||
contentDescription = "",
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,3 +132,7 @@ System\.currentTimeMillis\(\)===1
|
||||
|
||||
### Use `import io.element.android.libraries.ui.strings.CommonStrings` then `CommonStrings.<stringKey>` instead
|
||||
import io\.element\.android\.libraries\.ui\.strings\.R
|
||||
|
||||
# Accessibility
|
||||
### Use string resource for `contentDescription`, or null instead of empty string
|
||||
contentDescription = "
|
||||
|
||||
Reference in New Issue
Block a user