{{ message }}
Fix missing TalkBack labels on Check Pronunciation play/record buttons (#21443) - #21451
Merged
criticalAY merged 1 commit intoAug 10, 2026
Merged
Conversation
The play, cancel, and record CardViews in view_audio_play.xml and view_audio_record.xml (New Study Screen's Check Pronunciation feature) had no contentDescription, so TalkBack announced nothing for them. Reused existing string resources (play_recording, dialog_cancel, record_voice, replay_voice) and updated AudioPlayView.changePlayIcon() to switch the description between Play/Replay based on icon state. Verified via mutation testing that removing the description update breaks the test. Fixes ankidroid#21443
Contributor
david-allison
approved these changes
Aug 10, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The play, cancel and record CardViews in view_audio_play.xml and view_audio_record.xml (New Study
Screen's Check Pronunciation feature) didnt have any contentDescription, so TalkBack wasnt
announcing anything for them. reused the existing string resources (play_recording, dialog_cancel,
record_voice, replay_voice) instead of adding new ones, and updated
AudioPlayView.changePlayIcon() so it also switches the description between Play/Replay depending
on which icon state its in.
verified with mutation testing that if you remove the description update it actually breaks the
test, so its a real regression guard not just a happy path check.
Fixes #21443
Purpose / Description
the "Check Pronunciation" feature in New Study Screen (the play/cancel/record buttons) had no
contentDescription set on any of its buttons, so TalkBack user gets literally nothing when they
focus on it. theres an old issue #16320 thats basically the exact same bug, but that one was for
the OLD version of this screen and its already fixed. this feature got rewritten completely in
2025 for New Study Screen and somehow the same gap came back cus its all new files this time
Approach
added android:contentDescription to play_button/cancel_button in view_audio_play.xml and to
recordButton in view_audio_record.xml, reusing strings that already existed (play_recording,
dialog_cancel, record_voice) instead of making new ones. the play button icon changes between play
and replay depending on state so i also updated changePlayIcon() in AudioPlayView.kt to update the
contentDescription along with the icon, otherwise itd just say "Play" forever even when its
actually showing replay
How Has This Been Tested?
wrote AudioPlayViewTest and AudioRecordViewTest (robolectric) that check contentDescription on
each button including when it switches to replay state. all 4 tests failed first (before fix,
contentDescription was null) then passed after i added the fix. also did a mutation test - removed
the description-setting line again on purpose and confirmed the test caught it, then put it back.
ran the whole com.ichi2.anki.ui.windows.reviewer.* package after and nothing broke
Checklist