diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt index 883c591fd2..9dbeb83a3c 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt @@ -26,9 +26,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.rotate import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.clearAndSetSemantics import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.stateDescription import androidx.compose.ui.unit.dp import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons @@ -37,6 +39,7 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.Surface import io.element.android.libraries.designsystem.theme.components.Text +import io.element.android.libraries.ui.strings.CommonStrings private val CORNER_RADIUS = 8.dp @@ -52,6 +55,8 @@ fun GroupHeaderView( val backgroundColor = Color.Transparent val shape = RoundedCornerShape(CORNER_RADIUS) + val expandedStateDescription = stringResource(CommonStrings.a11y_state_expanded) + val collapsedStateDescription = stringResource(CommonStrings.a11y_state_collapsed) Box( modifier = modifier .fillMaxWidth() @@ -62,6 +67,7 @@ fun GroupHeaderView( ) .clearAndSetSemantics { contentDescription = text + stateDescription = if (isExpanded) expandedStateDescription else collapsedStateDescription }, contentAlignment = Alignment.Center ) { diff --git a/libraries/ui-strings/src/main/res/values/temporary.xml b/libraries/ui-strings/src/main/res/values/temporary.xml index c0573cc6c2..2526f254d3 100644 --- a/libraries/ui-strings/src/main/res/values/temporary.xml +++ b/libraries/ui-strings/src/main/res/values/temporary.xml @@ -8,6 +8,8 @@ "Mark as read" "Jump to first unread message" + "Expanded" + "Collapsed" Allow access to local network Your homeserver is on your local network. To connect, Element needs permission to reach other devices on this network. Active diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesViewA11y_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesViewA11y_en.png index b2b3f0b813..f47e74ab7b 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesViewA11y_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesViewA11y_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:02c4892eaa7d27c867266c428374b64e5915ec50ddcdf8b1d532e1cbc6f56462 -size 130436 +oid sha256:5823ae9a382421609200d569799505706180b94c6923f315caa81f8767ac58f8 +size 131340