Documentation layout adjustments

This commit is contained in:
Michael Jordan 2014-03-25 20:51:28 -04:00
parent f0ef1528a6
commit 59a53049b8

View File

@ -22,26 +22,25 @@ limitations under the License.
This plugin exposes information on the status of various accessibility features of mobile operating systems, including, for example, whether a screen reader is running, invert colors is enabled, and the preferred scaling for text. It also allows an application to send a string to be spoken by the screen reader, or a command to stop the screen reader from speaking.
## Installation
---------------
## Installation
$ cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git
## Supported Platforms
----------------------
## Supported Platforms
- Amazon Fire OS
- Android
- iOS
## MobileAccessibility
----------------------
## MobileAccessibility
The `MobileAccessibility` object, exposed by `window.MobileAccessibility`, provides methods for determining the status of accessibility features active on the user's device, methods changing the text zoom of the Cordova web view and for using the user's preferred text zoom as set in the operating system settings, and methods for sending a string to be spoken by the screen reader or to stop the screen reader from speaking.
### Methods
-----------
### Methods
- MobileAccessibility.isScreenReaderRunning
- MobileAccessibility.isVoiceOverRunning
@ -60,9 +59,8 @@ The `MobileAccessibility` object, exposed by `window.MobileAccessibility`, provi
- MobileAccessibility.speak
- MobileAccessibility.stop
#### MobileAccessibility.isScreenReaderRunning(callback)
--------------------------------------------------------
#### MobileAccessibility.isScreenReaderRunning(callback)
Makes an asynchronous call to native `MobileAccessibility` to determine if a screen reader is running.
@ -91,9 +89,9 @@ Makes an asynchronous call to native `MobileAccessibility` to determine if a scr
- Android
- iOS
#### MobileAccessibility.isVoiceOverRunning(callback)
-----------------------------------------------------
#### MobileAccessibility.isVoiceOverRunning(callback)
An iOS-specific proxy for the `MobileAccessibility.isScreenReaderRunning` method. This method will return `false` on Android and Amazon Fire OS.
@ -120,9 +118,9 @@ An iOS-specific proxy for the `MobileAccessibility.isScreenReaderRunning` method
- iOS
#### MobileAccessibility.isTalkBackRunning(callback)
----------------------------------------------------
#### MobileAccessibility.isTalkBackRunning(callback)
An Android/Amazon Fire OS-specific proxy for the `MobileAccessibility.isScreenReaderRunning` method. This method will return `false` on iOS.
@ -150,9 +148,9 @@ An Android/Amazon Fire OS-specific proxy for the `MobileAccessibility.isScreenRe
- Amazon Fire OS
- Android
#### MobileAccessibility.isChromeVoxActive()
----------------------------------------------------
#### MobileAccessibility.isChromeVoxActive()
On Android, this method returns `true` if ChromeVox is active and properly initialized with access to the text to speech API in the WebView.
If TalkBack is running but ChromeVox is not active, this method is useful to alert the user of a potential problem.
@ -188,9 +186,9 @@ If TalkBack is running but ChromeVox is not active, this method is useful to ale
- Amazon Fire OS
- Android
#### MobileAccessibility.isClosedCaptioningEnabled(callback)
------------------------------------------------------------
#### MobileAccessibility.isClosedCaptioningEnabled(callback)
Makes an asynchronous call to native `MobileAccessibility` to determine if system-level closed captioning is enabled on the device.
@ -219,9 +217,9 @@ Makes an asynchronous call to native `MobileAccessibility` to determine if syste
- Android
- iOS
#### MobileAccessibility.isGuidedAccessEnabled(callback)
--------------------------------------------------------
#### MobileAccessibility.isGuidedAccessEnabled(callback)
Makes an asynchronous call to native `MobileAccessibility` to determine if Guided Access is enabled.
@ -248,8 +246,9 @@ Makes an asynchronous call to native `MobileAccessibility` to determine if Guide
- iOS
#### MobileAccessibility.isInvertColorsEnabled(callback)
--------------------------------------------------------
#### MobileAccessibility.isInvertColorsEnabled(callback)
Makes an asynchronous call to native `MobileAccessibility` to determine if the display colors have been inverted.
@ -276,9 +275,8 @@ Makes an asynchronous call to native `MobileAccessibility` to determine if the d
- iOS
#### MobileAccessibility.isMonoAudioEnabled(callback)
-----------------------------------------------------
#### MobileAccessibility.isMonoAudioEnabled(callback)
Makes an asynchronous call to native `MobileAccessibility` to determine if mono audio is enabled.
@ -305,9 +303,8 @@ Makes an asynchronous call to native `MobileAccessibility` to determine if mono
- iOS
#### MobileAccessibility.isTouchExplorationEnabled(callback)
------------------------------------------------------------
#### MobileAccessibility.isTouchExplorationEnabled(callback)
Makes an asynchronous call to native `MobileAccessibility` to determine if Touch Exploration is enabled on Android.
@ -337,9 +334,8 @@ Makes an asynchronous call to native `MobileAccessibility` to determine if Touch
- Amazon Fire OS
- Android
#### MobileAccessibility.getTextZoom(callback)
--------------------------------------------------------
#### MobileAccessibility.getTextZoom(callback)
Makes an asynchronous call to native `MobileAccessibility` to return the current text zoom percent value for the WebView.
@ -362,9 +358,8 @@ Makes an asynchronous call to native `MobileAccessibility` to return the current
- Android
- iOS
#### MobileAccessibility.setTextZoom(textZoom, callback)
--------------------------------------------------------
#### MobileAccessibility.setTextZoom(textZoom, callback)
Makes an asynchronous call to native `MobileAccessibility` to set the current text zoom percent value for the WebView.
@ -389,9 +384,8 @@ Makes an asynchronous call to native `MobileAccessibility` to set the current te
- Android
- iOS
#### MobileAccessibility.updateTextZoom(callback)
-------------------------------------------------
#### MobileAccessibility.updateTextZoom(callback)
Makes an asynchronous call to native `MobileAccessibility` to retrieve the user's preferred text zoom from system settings and apply it to the application WebView.
@ -415,9 +409,8 @@ Makes an asynchronous call to native `MobileAccessibility` to retrieve the user'
- Android
- iOS7+
#### MobileAccessibility.usePreferredTextZoom(boolean)
------------------------------------------------------
#### MobileAccessibility.usePreferredTextZoom(boolean)
Specifies whether or not the application should use the user's preferred text zoom from system settings to scale text within the WebView.
When set to `true`, this method calls `MobileAccessibility.updateTextZoom()` to apply new text zoom settings to the application WebView. When set to `false`, the application WebView text zoom will be reset to the default value of `100` percent. The plugin uses local storage to retain the preference and will call `MobileAccessibility.updateTextZoom()` after a Cordova `resume` event.
@ -444,9 +437,8 @@ When set to `true`, this method calls `MobileAccessibility.updateTextZoom()` to
- Android
- iOS7+
#### MobileAccessibility.postNotification(mobileAccessibilityNotification, string, callback)
--------------------------------------------------------------------------------------------
#### MobileAccessibility.postNotification(mobileAccessibilityNotification, string, callback)
Posts a notification with a string for the screen reader to announce if it is running.
@ -480,8 +472,9 @@ The following constants are for sending notifications to the accessibility API u
- iOS
#### MobileAccessibility.speak(string, queueMode, properties)
-------------------------------------------------------------
#### MobileAccessibility.speak(string, queueMode, properties)
Speaks a given string through the screenreader. On Android, if ChromeVox is active, it will use the specified queueMode and properties.
@ -501,8 +494,8 @@ Speaks a given string through the screenreader. On Android, if ChromeVox is acti
- Android
- iOS
#### MobileAccessibility.stop()
-------------------------------
#### MobileAccessibility.stop()
Stops speech.
@ -516,11 +509,11 @@ Stops speech.
- Android
- iOS
### Events
----------
### Events
#### Constants
--------------
#### Constants
The following event constants are for `window` events, to which an application can listen for notification of changes in the status of the accessibility features on the device.
@ -531,8 +524,8 @@ The following event constants are for `window` events, to which an application c
- MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED
- MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED
#### MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED (screenreaderstatuschanged)
----------------------------------------------------------------------------------------------
#### MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED (screenreaderstatuschanged)
The event fires when a screen reader on the device turns on or off.
The event returns an object, `info`, with the current status of accessibility features on the device.
@ -555,9 +548,8 @@ If a screen reader is active, `info.isScreenReaderRunning` will equal `true`.
window.addEventListener(MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED, onScreenReaderStatusChanged, false);
```
#### MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED (closedcaptioningstatuschanged)
------------------------------------------------------------------------------------------------------
#### MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED (closedcaptioningstatuschanged)
The event fires when system-level closed captioning on the device turns on or off.
The event returns an object, `info`, with the current status of accessibility features on the device.
@ -580,9 +572,8 @@ If a screen reader is active, `info.isClosedCaptioningEnabled` will equal `true`
window.addEventListener(MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED, onClosedCaptioningStatusChanged, false);
```
#### MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED (guidedaccessstatuschanged)
----------------------------------------------------------------------------------------------
#### MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED (guidedaccessstatuschanged)
The event fires when Guided Access has been enabled on an iOS device.
The event returns an object, `info`, with the current status of accessibility features on the device.
@ -605,9 +596,8 @@ If a screen reader is active, `info.isGuidedAccessEnabled` will equal `true`.
window.addEventListener(MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED, onGuidedAccessStatusChanged, false);
```
#### MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED (invertcolorsstatuschanged)
----------------------------------------------------------------------------------------------
#### MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED (invertcolorsstatuschanged)
The event fires when Invert Colors has been enabled on an iOS device.
The event returns an object, `info`, with the current status of accessibility features on the device.
@ -630,9 +620,8 @@ If a screen reader is active, `info.isInvertColorsEnabled` will equal `true`.
window.addEventListener(MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED, onInvertColorsStatusChanged, false);
```
#### MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED (monoaudiostatuschanged)
----------------------------------------------------------------------------------------
#### MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED (monoaudiostatuschanged)
The event fires when Mono Audio has been enabled on an iOS device.
The event returns an object, `info`, with the current status of accessibility features on the device.
@ -655,9 +644,8 @@ If a screen reader is active, `info.isMonoAudioEnabled` will equal `true`.
window.addEventListener(MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED, onMonoAudioStatusChanged, false);
```
#### MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED (touchexplorationstatuschanged)
------------------------------------------------------------------------------------------------------
#### MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED (touchexplorationstatuschanged)
The event fires when Touch Exploration has been enabled on an Android device.
The event returns an object, `info`, with the current status of accessibility features on the device.