public class LayoutSonifier
extends java.lang.Object
The LayoutSonifier provides the sonification of a View. When a View is sonified
the user can swipe on it with their finger and receive audio and haptic cues about it.
The View is rendered in audio by uttering (through the Android test to speech synthesizer) the content
description, as per getContentDescription(). Furthermore, if the View is also a TextView
the text is uttered too, right after the content description. Haptic rendering is just a vibration of the device.
A View that is also a ViewGroup is recursively searched in its children until the non ViewGruop
that is under the coordinates of the user touch is found.
The way each View is sonified can be customized by subclassing this class and providing a custom
implementation of SonifyView().
This method is called when the view under the user's finger is found. The content
description (as per View.getContentDesctpion() is uttered if not null, otherwise,
if the View is a text view, the string returned by TextView.getText() is uttered.
A vibration is triggered regardless of the type of the View.
Subclasses can overwrite this method to provide their own sonification of the view touched
by the user. Unless it's an AccessibleSpinner or a AccessibleCheckbox
is never a ViewGroup as if a ViewGroup is met the view it contains
are recursively searched for the one under the user's finger.
Parameters:
v - the view touched by the user
accessibilityService - the accessibility service used to sonify the view