[media-ui]Centralize volume button accessibility semantics in VolumeScreen - #2742
[media-ui]Centralize volume button accessibility semantics in VolumeScreen#2742dianastefan12 wants to merge 5 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@googlebot I signed it! |
e030efe to
60951cc
Compare
|
Is this a Wear Compose bug? Should we fix there? or is there a tracking bug? |
|
@dianastefan12 did you also ran the media sample to confirm behaviour when talk back is enabled? |
Here is the bug: https://b.corp.google.com/issues/512233745 |
Tested manually: Test Case 1: TalkBack Accessibility Focus & Role Announcement Test Case 2: Double-Tap Interaction under TalkBack Focus |
Removed role = Role.Button inside clearAndSetSemantics for both increaseIcon and decreaseIcon slots so only the outer Stepper button container provides the button role:
…ix-volume-accessibility # Conflicts: # media/audio-ui-material3/src/main/java/com/google/android/horologist/audio/ui/material3/VolumeScreen.kt # media/audio-ui/src/main/java/com/google/android/horologist/audio/ui/VolumeScreen.kt
WHAT
Centralize volume button accessibility semantics inside
VolumeScreenby wrappingincreaseIconanddecreaseIconin containers with explicit button semantics (clearAndSetSemantics).WHY
Screen readers (TalkBack) were not consistently announcing or triggering actions on the volume increase and decrease controls in
VolumeScreen. Explicitly setting accessibility semantics (contentDescription,Role.Button, andonClickactions) directly on the volume button slots ensures reliable accessibility interaction across Wear OS devices.HOW
increaseIconanddecreaseIconslots inStepperinsideBoxlayout containers.Modifier.clearAndSetSemanticsto the icon boxes to configure:contentDescriptionmapped to string resources (horologist_volume_screen_volume_up_content_descriptionandhorologist_volume_screen_volume_down_content_description).role = Role.Buttonto indicate button behavior to accessibility services.onClickaction handlers executingincreaseVolume()anddecreaseVolume().Checklist 📋