From cd2587b1fd27615364479d7c66a357979224198c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Mi=C5=9B?= Date: Mon, 17 Jul 2023 14:20:54 +0200 Subject: [PATCH] feat: improve accessibility (#64) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Label Back button * Mark group section headings as headings Signed-off-by: Patryk Miś --- .../java/app/revanced/manager/ui/component/AppScaffold.kt | 4 +++- .../java/app/revanced/manager/ui/component/GroupHeader.kt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/manager/ui/component/AppScaffold.kt b/app/src/main/java/app/revanced/manager/ui/component/AppScaffold.kt index 0d9e012e..ffb466de 100644 --- a/app/src/main/java/app/revanced/manager/ui/component/AppScaffold.kt +++ b/app/src/main/java/app/revanced/manager/ui/component/AppScaffold.kt @@ -8,7 +8,9 @@ import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.input.nestedscroll.nestedScroll +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import app.revanced.manager.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -47,7 +49,7 @@ fun AppTopBar( IconButton(onClick = onBackClick) { Icon( imageVector = Icons.Default.ArrowBack, - contentDescription = null + contentDescription = stringResource(R.string.back) ) } } diff --git a/app/src/main/java/app/revanced/manager/ui/component/GroupHeader.kt b/app/src/main/java/app/revanced/manager/ui/component/GroupHeader.kt index 2eb25f1a..f7ca27ae 100644 --- a/app/src/main/java/app/revanced/manager/ui/component/GroupHeader.kt +++ b/app/src/main/java/app/revanced/manager/ui/component/GroupHeader.kt @@ -5,6 +5,8 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.semantics.heading +import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp @Composable @@ -16,6 +18,6 @@ fun GroupHeader( text = title, color = MaterialTheme.colorScheme.primary, style = MaterialTheme.typography.labelLarge, - modifier = Modifier.padding(16.dp).then(modifier) + modifier = Modifier.padding(16.dp).semantics { heading() }.then(modifier) ) } \ No newline at end of file