Skip to content

Commit

Permalink
feat: improve accessibility (#64)
Browse files Browse the repository at this point in the history
* Label Back button
* Mark group section headings as headings

Signed-off-by: Patryk Miś <[email protected]>
  • Loading branch information
PatrykMis authored Jul 17, 2023
1 parent 9720e42 commit 6d8e03d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -47,7 +49,7 @@ fun AppTopBar(
IconButton(onClick = onBackClick) {
Icon(
imageVector = Icons.Default.ArrowBack,
contentDescription = null
contentDescription = stringResource(R.string.back)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
)
}

0 comments on commit 6d8e03d

Please sign in to comment.