Skip to content

Conversation

@BartoszKlonowski
Copy link
Member

This pull request closes #265
It delivers the overridden onTouchEvent which announce the "disabled" state of the Slider if a blind user tries to interact with disabled component.


The implementation is simple:
Override the onTouchEvent and check if Slider is already disabled and if the ACTION_DOWN was performed on the Slider.
If both conditions are met send the accessibility message saying that "slider disabled" so that user knows that:

  • he reached/touched or tried to interact with a Slider component
  • the component is disabled

It's necessary to react only on the ACTION_DOWN event, omitting the ACTION_UP, to avoid spamming blind user with too many messages and because a Slider is not a button, and user will most probably try to drag it instead of clicking on it.
We allow the taptoSeek but it will still fall into the ACTION_DOWN category.

NOTE:
There's no PerformClick() override, even though the docs suggests to do it. The reason for not implementing it is that there cannot be a click event's reaction on a disabled component, and if it's enabled there's still the onValueChange which will announce the new value and units.

We are only to announce "disabled" if a Slider receives the onHover
event and is disabled.
Otherwise we do nothing to avoid spamming user with too many redundant
messages.

Also the Slider should return true as the event has been handled.
The docs for this:
https://developer.android.com/reference/android/view/View#onHoverEvent(android.view.MotionEvent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: Android Issue related to Android platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slider Accessibility: Does it announce "disabled" or Checked/Unchecked State

2 participants