feat: improve accessibility (#64)

* Label Back button
* Mark group section headings as headings

Signed-off-by: Patryk Miś <foss@patrykmis.com>
This commit is contained in:
Patryk Miś 2023-07-17 14:20:54 +02:00 committed by GitHub
parent 879884a9fa
commit cd2587b1fd
2 changed files with 6 additions and 2 deletions

View File

@ -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)
)
}
}

View File

@ -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)
)
}