Search code examples
androidaccessibilityaccessibilityservicesamsung-touchwiz

TouchWiz not support scroll/swipe using Android Accessibility


How to make scroll/swipe with TouchWiz using Android Accessibility. Note that common way not works because TouchWiz not support AccessibilityAction.ACTION_SCROLL_FORWARD and AccessibilityAction.ACTION_SCROLL_BACKWARD

Any ideas?


Solution

  • First: Saying that TouchWIZ does not support ACTION_SCROLL_FORWARD and ACTION_SCROLL_BACKWORD is like saying a text view doesn't support ACTION_CLICK. The two actions you refer to only apply to scrollable content within a ScrollView. TouchWIZ uses paging. Meaning, you're not "scrolling" you are swiping in a new view. While the action appears to be scrolling, it is actually paging across. From a conceptual point of view these are the same thing, however, "scrolling" in this sense has a very formal definition within the Android APIs.

    The TouchWIZ developers could implement listeners for these, so that on scroll events, paging occurs, but that would have to happen within the application.

    They could also define the ordering of focusable elements to be such that, paging occurs automatically. Though, again, this is an application side solution, and not one a service an enforce. Though, I believe they do this, IF you're using a keyboard tab key to navigate, and not arrow keys, or gesture navigation.

    Second: When you request touch exploration mode, from an accessibility service, two finger gestures will get passed through as one finger gestures. So, it is fairly easy to page through the TouchWIZ with the default behavior of touch exploration mode, and is what AT users would be use to.

    Third: I believe what you're hinting at is a feature that Google has been working on for some time and that is the ability to pass, from an accessibility service, true hardware gestures. So that a service could create true swipe gestures, from simpler gestures, on the users behalf. This, I don't believe is fully implemented yet. I had thought, from their CSUN presentation in 2016, that it would be available in Android 6, but perhaps it got pushed back to 7 or even 7.1. When this feature is available, I believe it is the solution you are looking for. Until it is available there is no direct way to accomplish what you want.