Skip to content

[Slider] Add new attributes for better accessibility support #2773

Open
@SergLam

Description

@SergLam

Slider does not provide enough configuration parameters for:

  1. Increment / decrement step value configuration for a11y mode - it's hardcoded to 20 percents
    private float calculateStepIncrement(int stepFactor) {

private float calculateStepIncrement(int stepFactor)

  1. There is no VoiceOver response on the value change event. We need to add annonceForAccessibility method call while the slider value is changed after some user interaction.

Solution:

  1. Add the following attributes:

accessibilityStepValue - should be used to determine a step, for which the value of the slider should be changed while the user performs AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD or AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD actions:

private float calculateStepIncrement(int stepFactor) {

private float calculateStepIncrement(int stepFactor)


Those parameters could be used for a proper a11y message creation - e.g.

annonceForAccessibility("Volume value incremented to 65 percent")
annonceForAccessibility("Temperature value decremented to 45 degrees")

Where "Volume", "Temperature" is accessibilityParameterName

And "percent", "degrees" is accessibilityUnitName

Describe alternatives you've considered
There are no alternatives for a slider step value configuration while we a dealing with a continuous slider, not the range slider.

Also, there is no message from a TalkBack when the user changes the slider value with swipe up or down.

In order to get the current slider value after a swipe user needs to perform one more tap - in order to force TalkBack to announce the updated slider value.

Additional context
This feature will simplify slider interaction for people with visual disabilities and will provide a much simpler API for Android Apps developers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions