Skip to content

Commit cf4e54f

Browse files
authored
Merge pull request #5968 from element-hq/feature/bma/a11y/letterAvatar
Ensure that avatars always have a content description.
2 parents 2b826c6 + 0044875 commit cf4e54f

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

codegen/src/main/kotlin/io/element/android/codegen/ContributesNodeProcessor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ContributesNodeProcessor(
9191
.addAnnotation(Binds::class)
9292
.addAnnotation(IntoMap::class)
9393
.addAnnotation(
94-
AnnotationSpec.Companion.builder(ClassName.bestGuess(nodeKeyFqName.asString())).addMember(
94+
AnnotationSpec.builder(ClassName.bestGuess(nodeKeyFqName.asString())).addMember(
9595
CLASS_PLACEHOLDER,
9696
ClassName.bestGuess(ksClass.qualifiedName!!.asString())
9797
).build()

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fun GroupHeaderView(
4949
modifier: Modifier = Modifier
5050
) {
5151
// Ignore isHighlighted for now, we need a design decision on it.
52-
val backgroundColor = Color.Companion.Transparent
52+
val backgroundColor = Color.Transparent
5353
val shape = RoundedCornerShape(CORNER_RADIUS)
5454

5555
Box(

features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private fun RoomHeaderSection(
404404
}.toImmutableList(),
405405
isTombstoned = isTombstoned,
406406
),
407-
contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_room_avatar) },
407+
contentDescription = stringResource(CommonStrings.a11y_room_avatar),
408408
modifier = Modifier
409409
.clickable(
410410
enabled = avatarUrl != null,

features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private fun SpaceInfoSection(
115115
Avatar(
116116
avatarData = AvatarData(roomId.value, name, avatarUrl, AvatarSize.SpaceListItem),
117117
avatarType = AvatarType.Space(),
118-
contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_avatar) },
118+
contentDescription = stringResource(CommonStrings.a11y_avatar),
119119
)
120120
Spacer(Modifier.width(16.dp))
121121
Column {

features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fun UserProfileHeaderSection(
6666
Avatar(
6767
avatarData = AvatarData(userId.value, userName, avatarUrl, AvatarSize.UserHeader),
6868
avatarType = AvatarType.User,
69-
contentDescription = avatarUrl?.let { stringResource(CommonStrings.a11y_user_avatar) },
69+
contentDescription = stringResource(CommonStrings.a11y_user_avatar),
7070
modifier = Modifier
7171
.clip(CircleShape)
7272
.clickable(

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/SelectedIndicatorAtom.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fun SelectedIndicatorAtom(
3434
Icon(
3535
modifier = modifier.toggleable(
3636
value = true,
37-
role = Role.Companion.Checkbox,
37+
role = Role.Checkbox,
3838
enabled = enabled,
3939
onValueChange = {},
4040
),

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/DmAvatars.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fun DmAvatars(
5959
Avatar(
6060
avatarData = userAvatarData,
6161
avatarType = AvatarType.User,
62-
contentDescription = userAvatarData.url?.let { stringResource(CommonStrings.a11y_your_avatar) },
62+
contentDescription = stringResource(CommonStrings.a11y_your_avatar),
6363
modifier = Modifier
6464
.align(Alignment.BottomStart)
6565
.graphicsLayer {
@@ -94,7 +94,7 @@ fun DmAvatars(
9494
Avatar(
9595
avatarData = otherUserAvatarData,
9696
avatarType = AvatarType.User,
97-
contentDescription = otherUserAvatarData.url?.let { stringResource(CommonStrings.a11y_other_user_avatar) },
97+
contentDescription = stringResource(CommonStrings.a11y_other_user_avatar),
9898
modifier = Modifier
9999
.align(Alignment.TopEnd)
100100
.clip(CircleShape)

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/avatar/internal/ImageAvatar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal fun ImageAvatar(
3636
SubcomposeAsyncImage(
3737
model = avatarData,
3838
contentDescription = contentDescription,
39-
contentScale = ContentScale.Companion.Crop,
39+
contentScale = ContentScale.Crop,
4040
modifier = modifier
4141
.size(size)
4242
.clip(avatarShape)

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/NavigationBarItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ object ElementNavigationBarItemDefaults {
5050
selectedTextColor = ElementTheme.colors.textPrimary,
5151
unselectedIconColor = ElementTheme.colors.iconTertiary,
5252
unselectedTextColor = ElementTheme.colors.textDisabled,
53-
selectedIndicatorColor = Color.Companion.Transparent,
53+
selectedIndicatorColor = Color.Transparent,
5454
)
5555
}

tests/testutils/src/main/kotlin/io/element/android/tests/testutils/node/TestParentNode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TestParentNode<Child : Node>(
2727
private val childNodeFactory: (buildContext: BuildContext, plugins: List<Plugin>) -> Child,
2828
) : DependencyInjectionGraphOwner,
2929
Node(
30-
buildContext = BuildContext.Companion.root(savedStateMap = null),
30+
buildContext = BuildContext.root(savedStateMap = null),
3131
plugins = emptyList(),
3232
view = EmptyNodeView,
3333
) {

0 commit comments

Comments
 (0)