[a11y] Ensure that heading() is applied to all screen titles.

This commit is contained in:
Benoit Marty 2025-07-04 10:32:51 +02:00
parent f3eb0e69cc
commit 70aa31df00
42 changed files with 180 additions and 259 deletions

View file

@ -20,6 +20,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.heading
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import io.element.android.compound.theme.ElementTheme
@ -77,7 +79,11 @@ fun UserProfileHeaderSection(
Spacer(modifier = Modifier.height(24.dp))
if (userName != null) {
Text(
modifier = Modifier.clipToBounds(),
modifier = Modifier
.clipToBounds()
.semantics {
heading()
},
text = userName,
style = ElementTheme.typography.fontHeadingLgBold,
textAlign = TextAlign.Center,