Merge pull request #5968 from element-hq/feature/bma/a11y/letterAvatar
Ensure that avatars always have a content description.
This commit is contained in:
@@ -91,7 +91,7 @@ class ContributesNodeProcessor(
|
||||
.addAnnotation(Binds::class)
|
||||
.addAnnotation(IntoMap::class)
|
||||
.addAnnotation(
|
||||
AnnotationSpec.Companion.builder(ClassName.bestGuess(nodeKeyFqName.asString())).addMember(
|
||||
AnnotationSpec.builder(ClassName.bestGuess(nodeKeyFqName.asString())).addMember(
|
||||
CLASS_PLACEHOLDER,
|
||||
ClassName.bestGuess(ksClass.qualifiedName!!.asString())
|
||||
).build()
|
||||
|
||||
@@ -49,7 +49,7 @@ fun GroupHeaderView(
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
// Ignore isHighlighted for now, we need a design decision on it.
|
||||
val backgroundColor = Color.Companion.Transparent
|
||||
val backgroundColor = Color.Transparent
|
||||
val shape = RoundedCornerShape(CORNER_RADIUS)
|
||||
|
||||
Box(
|
||||
|
||||
@@ -404,7 +404,7 @@ private fun RoomHeaderSection(
|
||||
}.toImmutableList(),
|
||||
isTombstoned = isTombstoned,
|
||||
),
|
||||
contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_room_avatar) },
|
||||
contentDescription = stringResource(CommonStrings.a11y_room_avatar),
|
||||
modifier = Modifier
|
||||
.clickable(
|
||||
enabled = avatarUrl != null,
|
||||
|
||||
@@ -115,7 +115,7 @@ private fun SpaceInfoSection(
|
||||
Avatar(
|
||||
avatarData = AvatarData(roomId.value, name, avatarUrl, AvatarSize.SpaceListItem),
|
||||
avatarType = AvatarType.Space(),
|
||||
contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_avatar) },
|
||||
contentDescription = stringResource(CommonStrings.a11y_avatar),
|
||||
)
|
||||
Spacer(Modifier.width(16.dp))
|
||||
Column {
|
||||
|
||||
@@ -66,7 +66,7 @@ fun UserProfileHeaderSection(
|
||||
Avatar(
|
||||
avatarData = AvatarData(userId.value, userName, avatarUrl, AvatarSize.UserHeader),
|
||||
avatarType = AvatarType.User,
|
||||
contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_user_avatar) },
|
||||
contentDescription = stringResource(CommonStrings.a11y_user_avatar),
|
||||
modifier = Modifier
|
||||
.clip(CircleShape)
|
||||
.clickable(
|
||||
|
||||
@@ -34,7 +34,7 @@ fun SelectedIndicatorAtom(
|
||||
Icon(
|
||||
modifier = modifier.toggleable(
|
||||
value = true,
|
||||
role = Role.Companion.Checkbox,
|
||||
role = Role.Checkbox,
|
||||
enabled = enabled,
|
||||
onValueChange = {},
|
||||
),
|
||||
|
||||
@@ -59,7 +59,7 @@ fun DmAvatars(
|
||||
Avatar(
|
||||
avatarData = userAvatarData,
|
||||
avatarType = AvatarType.User,
|
||||
contentDescription = userAvatarData.url?.let { stringResource(CommonStrings.a11y_your_avatar) },
|
||||
contentDescription = stringResource(CommonStrings.a11y_your_avatar),
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomStart)
|
||||
.graphicsLayer {
|
||||
@@ -94,7 +94,7 @@ fun DmAvatars(
|
||||
Avatar(
|
||||
avatarData = otherUserAvatarData,
|
||||
avatarType = AvatarType.User,
|
||||
contentDescription = otherUserAvatarData.url?.let { stringResource(CommonStrings.a11y_other_user_avatar) },
|
||||
contentDescription = stringResource(CommonStrings.a11y_other_user_avatar),
|
||||
modifier = Modifier
|
||||
.align(Alignment.TopEnd)
|
||||
.clip(CircleShape)
|
||||
|
||||
@@ -36,7 +36,7 @@ internal fun ImageAvatar(
|
||||
SubcomposeAsyncImage(
|
||||
model = avatarData,
|
||||
contentDescription = contentDescription,
|
||||
contentScale = ContentScale.Companion.Crop,
|
||||
contentScale = ContentScale.Crop,
|
||||
modifier = modifier
|
||||
.size(size)
|
||||
.clip(avatarShape)
|
||||
|
||||
@@ -50,6 +50,6 @@ object ElementNavigationBarItemDefaults {
|
||||
selectedTextColor = ElementTheme.colors.textPrimary,
|
||||
unselectedIconColor = ElementTheme.colors.iconTertiary,
|
||||
unselectedTextColor = ElementTheme.colors.textDisabled,
|
||||
selectedIndicatorColor = Color.Companion.Transparent,
|
||||
selectedIndicatorColor = Color.Transparent,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestParentNode<Child : Node>(
|
||||
private val childNodeFactory: (buildContext: BuildContext, plugins: List<Plugin>) -> Child,
|
||||
) : DependencyInjectionGraphOwner,
|
||||
Node(
|
||||
buildContext = BuildContext.Companion.root(savedStateMap = null),
|
||||
buildContext = BuildContext.root(savedStateMap = null),
|
||||
plugins = emptyList(),
|
||||
view = EmptyNodeView,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user