Bug 1857533 - [a11y] Fakespot add missing expanded/collapsed states

Expandable sections states in review checker bottom sheet were not
announce when using talkback. This patch adds both the states and
the actions that need to be dictated.
fenix/121.0
DreVla 8 months ago committed by mergify[bot]
parent 2eeb0b29a9
commit 4308dcc474

@ -29,6 +29,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import org.mozilla.fenix.R
@ -64,10 +65,17 @@ fun ReviewQualityCheckExpandableCard(
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier
.fillMaxWidth()
.clickable {
isExpanded = isExpanded.not()
onExpandToggleClick(isExpanded)
}
.clickable(
onClickLabel = if (isExpanded) {
stringResource(R.string.a11y_action_label_collapse)
} else {
stringResource(R.string.a11y_action_label_expand)
},
onClick = {
isExpanded = isExpanded.not()
onExpandToggleClick(isExpanded)
},
)
.padding(defaultCardContentPadding),
verticalAlignment = Alignment.CenterVertically,
) {
@ -85,7 +93,11 @@ fun ReviewQualityCheckExpandableCard(
Icon(
painter = painterResource(id = chevronDrawable),
contentDescription = null,
contentDescription = if (isExpanded) {
stringResource(R.string.a11y_state_label_expanded)
} else {
stringResource(R.string.a11y_state_label_collapsed)
},
tint = FirefoxTheme.colors.iconPrimary,
)
}

@ -2251,8 +2251,12 @@
<!-- Accessibility services actions labels. These will be appended to accessibility actions like "Double tap to.." but not by or applications but by services like Talkback. -->
<!-- Action label for elements that can be collapsed if interacting with them. Talkback will append this to say "Double tap to collapse". -->
<string name="a11y_action_label_collapse">collapse</string>
<!-- Current state for elements that can be collapsed if interacting with them. Talkback will dictate this after a state change. -->
<string name="a11y_state_label_collapsed">collapsed</string>
<!-- Action label for elements that can be expanded if interacting with them. Talkback will append this to say "Double tap to expand". -->
<string name="a11y_action_label_expand">expand</string>
<!-- Current state for elements that can be expanded if interacting with them. Talkback will dictate this after a state change. -->
<string name="a11y_state_label_expanded">expanded</string>
<!-- Action label for links to a website containing documentation about a wallpaper collection. Talkback will append this to say "Double tap to open link to learn more about this collection". -->
<string name="a11y_action_label_wallpaper_collection_learn_more">open link to learn more about this collection</string>
<!-- Action label for links that point to an article. Talkback will append this to say "Double tap to read the article". -->

Loading…
Cancel
Save