Skip to content

fix(DeckPicker): improve accessibility of DeckPicker FAB#20334

Open
KT-1114 wants to merge 1 commit intoankidroid:mainfrom
KT-1114:main
Open

fix(DeckPicker): improve accessibility of DeckPicker FAB#20334
KT-1114 wants to merge 1 commit intoankidroid:mainfrom
KT-1114:main

Conversation

@KT-1114
Copy link

@KT-1114 KT-1114 commented Feb 18, 2026

Purpose

This PR improves the accessibility of the Floating Action Menu on the Deck Picker Screen. At present, when the TalkBack is enabled, the Floating Action Menu Button (FAB) does not toggle properly as the FAB is not supported by the accessibility services and also due to focus management issues. This locks out the user from getting shared decks, creating decks and filtered decks the normal way.

Related

Approach

Dynamic State Management: Implemented updateAccessibilityState() which uses ViewCompat.replaceAccessibilityAction to update the ACTION_CLICK label based on the state of FAB menu. It ensures that TalkBack announces the options correctly.

Focus Management: Used .post to set the focus and send a TYPE_VIEW_FOCUSED event to the first menu item (addNoteLabel) when the menu is opened. This ensures that the user gets acknowledgement of the state change.

How Has This Been Tested?

Screen_Recording_20260218_132417_AnkiDroid.hevc.mp4

To test the changes you can follow the following steps:

  1. Turn on the TalkBack accessibility feature.
  2. Open AnkiDroid.
  3. The set the focus on the FAB (single tap).
  4. Double tap to toggle the fab menu.
  5. You can either choose the available options or tap on elements outside the FAB wrapper and then double tap to close the menu.

This test was conducted on a physical device (Samsung Galaxy A54, API 36) .

Learning (can help others)

I read about Making custom views more accessible
and learnt about mimicking the accessibility reader service when using a work around like the FAB menu.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Note

The Google Accessibility Scanner stills shows that the FAB button is unsupported as this solution uses a work around.

@github-actions
Copy link
Contributor

Important

Maintainers: This PR contains Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

@Fandroid745
Copy link
Contributor

Not a review,but I observed that the isFABOpen flag in closeFloatingActionMenu
is set to false in the if-else block and again at the bottom making it redundant

@KT-1114
Copy link
Author

KT-1114 commented Feb 18, 2026

Nice catch @Fandroid745! I have removed the redundant assignment in the latest commit. Lesson learnt. Thanks a lot.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments