Skip to content

[RangeSlider] Thumbs are not accessible to UiAutomator2Β #4968

@jmcdale-owlet

Description

@jmcdale-owlet

Description: The thumbs of the RangeSlider are no longer accessible in the view tree used by UiAutomator2

Expected behavior: The thumbs should appear in the view tree available to UiAutomator2 so that automated tests can continue to manipulate sliders.

Source code:
I narrowed it down to the changes in ab52e6a

  @Override
  public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    // Setting visible to user to false prevents duplicate announcements by making only our virtual
    // view accessible, not the parent container.
    info.setVisibleToUser(false);
  }

Android API version: N/A

Material Library version: 1.13.0

Device: Pixel 8 Pro

Workaround:
We can create our own RangeSlider and override onInitializeAccessibilityNodeInfo to info.setVisibleToUser(true).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions