Skip to content

fix(android): announce position info for ChoiceSet radio/checkbox items#657

Open
hggzm wants to merge 1 commit intomicrosoft:mainfrom
hggzm:clean/fix-choiceset-position-89
Open

fix(android): announce position info for ChoiceSet radio/checkbox items#657
hggzm wants to merge 1 commit intomicrosoft:mainfrom
hggzm:clean/fix-choiceset-position-89

Conversation

@hggzm
Copy link
Copy Markdown
Collaborator

@hggzm hggzm commented Mar 18, 2026

Fork-based PR (no Azure Pipelines CI). When ready for CI, push branch to upstream as users/hggzm/clean/fix-choiceset-position-89 and recreate.

History: upstream PRs #626 (closed)

Summary

TalkBack was not announcing position information (e.g. "1 of 3") for radio buttons and checkboxes in expanded ChoiceSet inputs. This is because the container views (ValidatedCheckBoxLayout extending LinearLayout, and ValidatedRadioGroup) do not automatically provide collection semantics that TalkBack needs for position announcements.

Changes

  • ChoiceSetInputRenderer.java:
    • Added CollectionInfo accessibility metadata on parent containers (CheckBoxLayout and RadioGroup) via AccessibilityDelegateCompat
    • Added CollectionItemInfo on each child CheckBox and RadioButton with their position index

Before

TalkBack announces: "Red, check box, not checked"

After

TalkBack announces: "Red, check box, not checked, 1 of 3"

Testing

  1. Open a card with an expanded ChoiceSet (radio or checkbox style)
  2. Enable TalkBack
  3. Navigate through the items with swipe gestures
  4. Verify each item announces its position (e.g. "1 of 3", "2 of 3")

TalkBack was not announcing position information (e.g. '1 of 3') for
radio buttons and checkboxes in expanded ChoiceSet inputs. This is
because RadioGroup and LinearLayout-based CheckBox containers do not
automatically provide collection semantics to TalkBack.

Added CollectionInfo on the parent containers and CollectionItemInfo
on each child item via AccessibilityDelegateCompat, so TalkBack now
announces items like: 'Red, radio button, 1 of 3, not checked'.

Fixes microsoft#89
@hggzm
Copy link
Copy Markdown
Collaborator Author

hggzm commented Mar 20, 2026

TalkBack Validation Automated A11y Pipeline

Verified via automated accessibility screenshot pipeline (API 29, google_apis, TalkBack enabled).

ChoiceSet position info InputForm.json

This fix adds position info (e.g. 1 of 3) for ChoiceSet radio/checkbox items in TalkBack.

Validated with the accessibility-driven A11yNavigator which navigates cards using only accessibility identifiers (contentDescription, text) no view IDs or coordinates.

Pipeline: CI run 23364637091
Tests: 9 screenshot tests + 4 A11yNavigator tests all passing
Recording: 179s TalkBack screen recording in artifact
A11y tree: 414 nodes captured across 9 scenarios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants