Skip to content

Fix custom accessibility actions vanishing after rebind - #1376

Open
codeofdusk wants to merge 1 commit into
QuantumBadger:masterfrom
codeofdusk:fix-a11y-hint-collision
Open

Fix custom accessibility actions vanishing after rebind#1376
codeofdusk wants to merge 1 commit into
QuantumBadger:masterfrom
codeofdusk:fix-a11y-hint-collision

Conversation

@codeofdusk

Copy link
Copy Markdown
Contributor

Custom accessibility actions whose label matches the configured click/long-click hint (such as collapse with the default click action) intermittently disappear from the accessibility actions list. Androidx's ViewCompat.addAccessibilityAction reuses the id of any existing action that has a matching label, and the click/long-click hints (#1047) are labelled standard actions that removeAllActions never cleared. So on every other rebind the custom action gets attached to ACTION_CLICK's id and is then destroyed when the hint is re-set. This PR clears the hints in removeAllActions before deleting tracked actions; callers reset them when re-registering. Tested on a Pixel 6A (Bluejay); actions and hints consistently appear as expected.

@codeofdusk

Copy link
Copy Markdown
Contributor Author

CC @QuantumBadger.

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.

1 participant