Prevent usage of hard-coded string for contentDescription, and fix existing issues.
This commit is contained in:
parent
ef7315d6c6
commit
5f8e85edc6
12 changed files with 20 additions and 16 deletions
|
|
@ -58,7 +58,7 @@ fun RoomPrivacyOption(
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.padding(horizontal = 8.dp),
|
modifier = Modifier.padding(horizontal = 8.dp),
|
||||||
resourceId = roomPrivacyItem.icon,
|
resourceId = roomPrivacyItem.icon,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
tint = MaterialTheme.colorScheme.secondary,
|
tint = MaterialTheme.colorScheme.secondary,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ private fun PinUnlockHeader(
|
||||||
.size(32.dp),
|
.size(32.dp),
|
||||||
tint = ElementTheme.colors.iconPrimary,
|
tint = ElementTheme.colors.iconPrimary,
|
||||||
imageVector = Icons.Filled.Lock,
|
imageVector = Icons.Filled.Lock,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ fun RoundedIconAtom(
|
||||||
tint = tint,
|
tint = tint,
|
||||||
resourceId = resourceId,
|
resourceId = resourceId,
|
||||||
imageVector = imageVector,
|
imageVector = imageVector,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ fun PreferenceIcon(
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = icon,
|
imageVector = icon,
|
||||||
resourceId = iconResourceId,
|
resourceId = iconResourceId,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
tint = tintColor ?: enabled.toSecondaryEnabledColor(),
|
tint = tintColor ?: enabled.toSecondaryEnabledColor(),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(end = 16.dp)
|
.padding(end = 16.dp)
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ internal fun FloatingActionButtonPreview() =
|
||||||
private fun ContentToPreview() {
|
private fun ContentToPreview() {
|
||||||
Box(modifier = Modifier.padding(8.dp)) {
|
Box(modifier = Modifier.padding(8.dp)) {
|
||||||
FloatingActionButton(onClick = {}) {
|
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
|
@Composable
|
||||||
private fun ContentToPreview() {
|
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) {
|
CompositionLocalProvider(LocalContentColor provides ElementTheme.colors.iconPrimary) {
|
||||||
Row {
|
Row {
|
||||||
IconButton(onClick = {}) {
|
IconButton(onClick = {}) {
|
||||||
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
|
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
|
||||||
}
|
}
|
||||||
IconButton(enabled = false, onClick = {}) {
|
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) {
|
CompositionLocalProvider(LocalContentColor provides ElementTheme.colors.iconSecondary) {
|
||||||
Row {
|
Row {
|
||||||
IconButton(onClick = {}) {
|
IconButton(onClick = {}) {
|
||||||
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = "")
|
Icon(resourceId = CommonDrawables.ic_compound_close, contentDescription = null)
|
||||||
}
|
}
|
||||||
IconButton(enabled = false, onClick = {}) {
|
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(
|
Icon(
|
||||||
modifier = Modifier.size(16.dp),
|
modifier = Modifier.size(16.dp),
|
||||||
resourceId = CommonDrawables.ic_edit,
|
resourceId = CommonDrawables.ic_edit,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
tint = MaterialTheme.colorScheme.onPrimary,
|
tint = MaterialTheme.colorScheme.onPrimary,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ fun UnresolvedUserRow(
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
resourceId = CommonDrawables.ic_compound_error,
|
resourceId = CommonDrawables.ic_compound_error,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(18.dp)
|
.size(18.dp)
|
||||||
.align(Alignment.Top)
|
.align(Alignment.Top)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ fun UnsavedAvatar(
|
||||||
Box(modifier = commonModifier.background(ElementTheme.colors.temporaryColorBgSpecial)) {
|
Box(modifier = commonModifier.background(ElementTheme.colors.temporaryColorBgSpecial)) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Outlined.AddAPhoto,
|
imageVector = Icons.Outlined.AddAPhoto,
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.Center)
|
.align(Alignment.Center)
|
||||||
.size(40.dp),
|
.size(40.dp),
|
||||||
|
|
|
||||||
|
|
@ -98,19 +98,19 @@ internal fun FormattingButtonPreview() = ElementPreview {
|
||||||
state = FormattingOptionState.Default,
|
state = FormattingOptionState.Default,
|
||||||
onClick = { },
|
onClick = { },
|
||||||
imageVector = ImageVector.vectorResource(CommonDrawables.ic_bold),
|
imageVector = ImageVector.vectorResource(CommonDrawables.ic_bold),
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
FormattingOption(
|
FormattingOption(
|
||||||
state = FormattingOptionState.Selected,
|
state = FormattingOptionState.Selected,
|
||||||
onClick = { },
|
onClick = { },
|
||||||
imageVector = ImageVector.vectorResource(CommonDrawables.ic_italic),
|
imageVector = ImageVector.vectorResource(CommonDrawables.ic_italic),
|
||||||
contentDescription = "",
|
contentDescription = null,
|
||||||
)
|
)
|
||||||
FormattingOption(
|
FormattingOption(
|
||||||
state = FormattingOptionState.Disabled,
|
state = FormattingOptionState.Disabled,
|
||||||
onClick = { },
|
onClick = { },
|
||||||
imageVector = ImageVector.vectorResource(CommonDrawables.ic_underline),
|
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
|
### Use `import io.element.android.libraries.ui.strings.CommonStrings` then `CommonStrings.<stringKey>` instead
|
||||||
import io\.element\.android\.libraries\.ui\.strings\.R
|
import io\.element\.android\.libraries\.ui\.strings\.R
|
||||||
|
|
||||||
|
# Accessibility
|
||||||
|
### Use string resource for `contentDescription`, or null instead of empty string
|
||||||
|
contentDescription = "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue