Merge pull request #6827 from element-hq/feature/bma/a11y/roomNameHeading
[a11y] Improve accessibility of screen headers.
This commit is contained in:
commit
c3a4d64ec6
7 changed files with 55 additions and 25 deletions
|
|
@ -55,6 +55,8 @@ import androidx.compose.ui.layout.onVisibilityChanged
|
|||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.clearAndSetSemantics
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.heading
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
|
|
@ -495,14 +497,20 @@ private fun MediaViewerTopBar(
|
|||
TopAppBar(
|
||||
title = {
|
||||
if (senderName != null && dateSent != null) {
|
||||
val description = stringResource(
|
||||
CommonStrings.a11y_sent_by_sender_at_date,
|
||||
senderName,
|
||||
dateSent,
|
||||
)
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clearAndSetSemantics {
|
||||
heading()
|
||||
contentDescription = description
|
||||
},
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.semantics {
|
||||
heading()
|
||||
},
|
||||
text = senderName,
|
||||
style = ElementTheme.typography.fontBodyMdMedium,
|
||||
color = ElementTheme.colors.textPrimary,
|
||||
|
|
|
|||
|
|
@ -50,12 +50,15 @@
|
|||
<string name="a11y_room_avatar">"Room avatar"</string>
|
||||
<string name="a11y_send_files">"Send files"</string>
|
||||
<string name="a11y_sender_location">"Sender location"</string>
|
||||
<string name="a11y_sent_by_sender_at_date">"Sent by %1$s at %2$s"</string>
|
||||
<string name="a11y_session_verification_time_limited_action_required">"Time limited action required, you have one minute to verify"</string>
|
||||
<string name="a11y_settings_with_required_action">"Settings, action required"</string>
|
||||
<string name="a11y_show_password">"Show password"</string>
|
||||
<string name="a11y_start_call">"Start a call"</string>
|
||||
<string name="a11y_start_video_call">"Start a video call"</string>
|
||||
<string name="a11y_start_voice_call">"Start a voice call"</string>
|
||||
<string name="a11y_thread_in_room">"Thread in %1$s"</string>
|
||||
<string name="a11y_threads_in_room">"Threads in %1$s"</string>
|
||||
<string name="a11y_tombstoned_room">"Tombstoned room"</string>
|
||||
<string name="a11y_user_avatar">"User avatar"</string>
|
||||
<string name="a11y_user_menu">"User menu"</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue