• Stars
    star
    145
  • Rank 252,920 (Top 6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PhoneGap plugin to expose mobile accessibility APIs.

phonegap-plugin-mobile-accessibility

==========================================

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

$ cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git

Supported Platforms

  • Amazon Fire OS
  • Android
  • iOS

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

  • MobileAccessibility.isScreenReaderRunning
  • MobileAccessibility.isVoiceOverRunning
  • MobileAccessibility.isTalkBackRunning
  • MobileAccessibility.isChromeVoxActive
  • MobileAccessibility.isClosedCaptioningEnabled
  • MobileAccessibility.isGuidedAccessEnabled
  • MobileAccessibility.isInvertColorsEnabled
  • MobileAccessibility.isMonoAudioEnabled
  • MobileAccessibility.isReduceMotionEnabled
  • MobileAccessibility.isTouchExplorationEnabled
  • MobileAccessibility.getTextZoom
  • MobileAccessibility.setTextZoom
  • MobileAccessibility.updateTextZoom
  • MobileAccessibility.usePreferredTextZoom
  • MobileAccessibility.postNotification
  • MobileAccessibility.speak
  • MobileAccessibility.stop

MobileAccessibility.isScreenReaderRunning(callback)

Makes an asynchronous call to native MobileAccessibility to determine if a screen reader is running.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isScreenReaderRunningCallback(boolean) {
        if (boolean) {
            console.log("Screen reader: ON");
            // Do something to improve the behavior of the application while a screen reader is active.
        } else {
            console.log("Screen reader: OFF");
        }
    }

    MobileAccessibility.isScreenReaderRunning(isScreenReaderRunningCallback);
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS

MobileAccessibility.isVoiceOverRunning(callback)

An iOS-specific proxy for the MobileAccessibility.isScreenReaderRunning method. This method will return false on Android and Amazon Fire OS.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isVoiceOverRunningCallback(boolean) {
        if (boolean) {
            console.log("Screen reader: ON");
            // Do something to improve the behavior of the application while a screen reader is active.
        } else {
            console.log("Screen reader: OFF");
        }
    }

    MobileAccessibility.isVoiceOverRunning(isVoiceOverRunningCallback);
Supported Platforms
  • iOS

MobileAccessibility.isTalkBackRunning(callback)

An Android/Amazon Fire OS-specific proxy for the MobileAccessibility.isScreenReaderRunning method. This method will return false on iOS.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isTalkBackRunningCallback(boolean) {
        if (boolean) {
            console.log("Screen reader: ON");
            // Do something to improve the behavior of the application while a screen reader is active.
        } else {
            console.log("Screen reader: OFF");
        }
    }

    MobileAccessibility.isTalkBackRunning(isTalkBackRunningCallback);
Supported Platforms
  • Amazon Fire OS
  • Android

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.

Returns
  • boolean (Boolean) Returns true if ChromeVox is active and properly initialized with access to the text to speech API in the WebView.
Usage
    MobileAccessibility.isTalkBackRunning(
        function (bool) {
            console.log('Talkback status: ' + bool);
            if (bool) {
                /* Use setTimeout to account for latency in initialization of ChromeVox */
                setTimeout(function() {
                    if (MobileAccessibility.isChromeVoxActive()) {
                        console.log('ChromeVox is active.');
                    } else {
                        console.log('ChromeVox is not active.');

                        /* Notify the user of a potential problem */
                        MobileAccessibility.speak('The ChromeVox screen reader has failed to initialize. You may wish to close and restart this app.');
                    }
                }, 5000);
            }
        });
Supported Platforms
  • Amazon Fire OS
  • Android

MobileAccessibility.isBoldTextEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if Bold Text is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isBoldTextEnabledCallback(boolean) {
        if (boolean) {
            console.log("Bold Text: ON");
            // Do something to improve the behavior of the application while Bold Text is enabled.
        } else {
            console.log("Bold Text: OFF");
        }
    }

    MobileAccessibility.isBoldTextEnabled(isBoldTextEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isClosedCaptioningEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if system-level closed captioning is enabled on the device.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isClosedCaptioningEnabledCallback(boolean) {
        if (boolean) {
            console.log("Closed Captioning: ON");
            // Do something to improve the behavior of the application while closed captioning is enabled.
        } else {
            console.log("Closed Captioning: OFF");
        }
    }

    MobileAccessibility.isClosedCaptioningEnabled(isClosedCaptioningEnabledCallback);
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS

MobileAccessibility.isDarkerSystemColorsEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if Darker System Colors is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isDarkerSystemColorsEnabledCallback(boolean) {
        if (boolean) {
            console.log("Darker System Colors: ON");
            // Do something to improve the behavior of the application while Darker System Colors is enabled.
        } else {
            console.log("Darker System Colors: OFF");
        }
    }

    MobileAccessibility.isDarkerSystemColorsEnabled(isDarkerSystemColorsEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isGrayscaleEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if Grayscale is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isGrayscaleEnabledCallback(boolean) {
        if (boolean) {
            console.log("Grayscale: ON");
            // Do something to improve the behavior of the application while Grayscale is enabled.
        } else {
            console.log("Grayscale: OFF");
        }
    }

    MobileAccessibility.isGrayscaleEnabled(isGrayscaleEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isGuidedAccessEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if Guided Access is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isGuidedAccessEnabledCallback(boolean) {
        if (boolean) {
            console.log("Guided Access: ON");
            // Do something to improve the behavior of the application while Guided Access is enabled.
        } else {
            console.log("Guided Access: OFF");
        }
    }

    MobileAccessibility.isGuidedAccessEnabledEnabled(isGuidedAccessEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isInvertColorsEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if the display colors have been inverted.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isInvertColorsEnabledCallback(boolean) {
        if (boolean) {
            console.log("Invert Colors: ON");
            // Do something to improve the behavior of the application while Invert Colors is enabled.
        } else {
            console.log("Invert Colors: OFF");
        }
    }

    MobileAccessibility.isInvertColorsEnabled(isInvertColorsEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isMonoAudioEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if mono audio is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isMonoAudioEnabledCallback(boolean) {
        if (boolean) {
            console.log("Mono Audio: ON");
            // Do something to improve the behavior of the application while Mono Audio is enabled.
        } else {
            console.log("Mono Audio: OFF");
        }
    }

    MobileAccessibility.isMonoAudioEnabled(isMonoAudioEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isReduceMotionEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if reduce motion is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isReduceMotionEnabledCallback(boolean) {
        if (boolean) {
            console.log("Reduce Motion: ON");
            // Do something to improve the behavior of the application when reduce motion is enabled.
        } else {
            console.log("Reduce Motion: OFF");
        }
    }

    MobileAccessibility.isReduceMotionEnabled(isReduceMotionEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isReduceTransparencyEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if reduce transparency is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isReduceTransparencyEnabledCallback(boolean) {
        if (boolean) {
            console.log("Reduce Transparency: ON");
            // Do something to improve the behavior of the application when reduce transparency is enabled.
        } else {
            console.log("Reduce Transparency: OFF");
        }
    }

    MobileAccessibility.isReduceTransparencyEnabled(isReduceTransparencyEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isSpeakScreenEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if speak screen is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isSpeakScreenEnabledCallback(boolean) {
        if (boolean) {
            console.log("Speak Screen: ON");
            // Do something to improve the behavior of the application when Speak Screen is enabled.
        } else {
            console.log("Speak Screen: OFF");
        }
    }

    MobileAccessibility.isSpeakScreenEnabled(isSpeakScreenEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isSpeakSelectionEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if speak selection is enabled.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isSpeakSelectionEnabledCallback(boolean) {
        if (boolean) {
            console.log("Speak Selection: ON");
            // Do something to improve the behavior of the application when Speak Selection is enabled.
        } else {
            console.log("Speak Selection: OFF");
        }
    }

    MobileAccessibility.isSpeakSelectionEnabled(isSpeakSelectionEnabledCallback);
Supported Platforms
  • iOS

MobileAccessibility.isSwitchControlRunning(callback)

Makes an asynchronous call to native MobileAccessibility to determine if switch control is running.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isSwitchControlRunningCallback(boolean) {
        if (boolean) {
            console.log("Switch Control: ON");
            // Do something to improve the behavior of the application when Switch Control is running.
        } else {
            console.log("Switch Control: OFF");
        }
    }

    MobileAccessibility.isSwitchControlRunning(isSwitchControlRunningCallback);
Supported Platforms
  • iOS

MobileAccessibility.isTouchExplorationEnabled(callback)

Makes an asynchronous call to native MobileAccessibility to determine if Touch Exploration is enabled on Android.

Parameters
  • callback (Function) A callback method to receive the boolean result asynchronously from the native MobileAccessibility plugin.
Usage
    function isTouchExplorationEnabledCallback(boolean) {
        if (boolean) {
            console.log("Touch Exploration: ON");
            // Do something to improve the behavior of the application with Touch Exploration enabled.
        } else {
            console.log("Touch Exploration: OFF");
            // Do something to improve the behavior of the application with Touch Exploration disabled.

        }
    }

    MobileAccessibility.isTouchExplorationEnabled(isTouchExplorationEnabledCallback);
Supported Platforms
  • Amazon Fire OS
  • Android

MobileAccessibility.getTextZoom(callback)

Makes an asynchronous call to native MobileAccessibility to return the current text zoom percent value for the WebView.

Parameters
  • callback (Function) A callback method to receive the text zoom percent value asynchronously from the native MobileAccessibility plugin.
Usage
    function getTextZoomCallback(textZoom) {
        console.log('Current text zoom = ' + textZoom + '%')
    }

    MobileAccessibility.getTextZoom(getTextZoomCallback);
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS

MobileAccessibility.setTextZoom(textZoom, callback)

Makes an asynchronous call to native MobileAccessibility to set the current text zoom percent value for the WebView.

Parameters
  • textZoom (Number) A percentage value by which text in the WebView should be scaled.
  • callback (Function) A callback method to receive the new text zoom percent value asynchronously from the native MobileAccessibility plugin.
Usage
    function setTextZoomCallback(textZoom) {
        console.log('WebView text should be scaled ' + textZoom + '%')
    }

    MobileAccessibility.setTextZoom(200, setTextZoomCallback);
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS

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.

Parameters
  • callback (Function) A callback method to receive the new text zoom percent value asynchronously from the native MobileAccessibility plugin.
Usage
    function updateTextZoomCallback(textZoom) {
        console.log('WebView text should be scaled ' + textZoom + '%')
    }

    MobileAccessibility.updateTextZoom(callback);
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS7+

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.

Parameters
  • boolean (Boolean) A Boolean value which specifies whether to use the preferred text zoom of a default percent value of 100.
Usage
    MobileAccessibility.usePreferredTextZoom(true);

    function getTextZoomCallback(textZoom) {
        console.log('WebView text should be scaled to the preferred value ' + textZoom + '%')
    }

    MobileAccessibility.getTextZoom(getTextZoomCallback);
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS7+

MobileAccessibility.postNotification(mobileAccessibilityNotification, string, callback)

Posts a notification with a string for the screen reader to announce if it is running.

Parameters
  • mobileAccessibilityNotification (uint) A numeric constant for the type of notification to send. Constants are defined in MobileAccessibilityNotifications.
  • string (string) A string to be announced by a screen reader.
  • callback (function) A callback method to receive the asynchronous result from the native MobileAccessibility, when the announcement is finished, the function should expect an object containing the stringValue that was voiced and a boolean indicating that the announcement wasSuccessful.
Constants

The following constants are for sending notifications to the accessibility API using the MobileAccessibility.postNotification method. They correspond to notification constants defined in UIAccessibilityNotifications on iOS.

  • MobileAccessibilityNotifications.SCREEN_CHANGED
  • MobileAccessibilityNotifications.LAYOUT_CHANGED
  • MobileAccessibilityNotifications.ANNOUNCEMENT
  • MobileAccessibilityNotifications.PAGE_SCROLLED
    MobileAccessibility.postNotification(
        MobileAccessibilityNotifications.ANNOUNCEMENT,
        'String to be announced by screen reader.',
        function(info) {
            if (info) {
                console.log("Screen Reader announced \"" + info.stringValue + "\" success : " + info.wasSuccessful);
            }
        });
Supported Platforms
  • iOS

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.

Parameters
  • string (string) A string to be announced by a screen reader.
  • queueMode (Optional number) Valid modes are 0 for flush; 1 for queue.
  • properties (Optional Object) Speech properties to use for this utterance.
    MobileAccessibility.speak('This string will be announced when a screen reader is active on the device.');
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS

MobileAccessibility.stop()

Stops speech.

    MobileAccessibility.stop();
Supported Platforms
  • Amazon Fire OS
  • Android
  • iOS

Events


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.

  • MobileAccessibilityNotifications.BOLD_TEXT_STATUS_CHANGED
  • MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED
  • MobileAccessibilityNotifications.DARKER_SYSTEM_COLORS_STATUS_CHANGED
  • MobileAccessibilityNotifications.GRAYSCALE_STATUS_CHANGED
  • MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED
  • MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED
  • MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED
  • MobileAccessibilityNotifications.REDUCE_MOTION_STATUS_CHANGED
  • MobileAccessibilityNotifications.REDUCE_TRANSPARENCY_STATUS_CHANGED
  • MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED
  • MobileAccessibilityNotifications.SPEAK_SCREEN_STATUS_CHANGED
  • MobileAccessibilityNotifications.SPEAK_SELECTION_STATUS_CHANGED
  • MobileAccessibilityNotifications.SWITCH_CONTROL_STATUS_CHANGED
  • MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED

MobileAccessibilityNotifications.BOLD_TEXT_STATUS_CHANGED (boldtextstatuschanged)

The event fires when Bold Text has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Bold Text is active, info.isBoldTextEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onBoldTextStatusChanged(info) {
        if (info && typeof info.isBoldTextEnabled !== "undefined") {
            if (info.isBoldTextEnabled) {
                console.log("Bold Text: ON");
                // Do something to improve the behavior of the application while Bold Text is enabled.
            } else {
                console.log("Bold Text: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.BOLD_TEXT_STATUS_CHANGED, onBoldTextStatusChanged, false);

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. If closed captioning is active, info.isClosedCaptioningEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onClosedCaptioningStatusChanged(info) {
        if (info && typeof info.isClosedCaptioningEnabled !== "undefined") {
            if (info.isClosedCaptioningEnabled) {
                console.log("Closed Captioning: ON");
                // Do something to improve the behavior of the application while closed captioning is enabled.
            } else {
                console.log("Closed Captioning: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED, onClosedCaptioningStatusChanged, false);

MobileAccessibilityNotifications.DARKER_SYSTEM_COLORS_STATUS_CHANGED (darkersystemcolorsstatuschanged)

The event fires when Darker System Colors has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Darker System Colors is active, info.isDarkerSystemColorsEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onDarkerSystemColorsStatusChanged(info) {
        if (info && typeof info.isDarkerSystemColorsEnabled !== "undefined") {
            if (info.isDarkerSystemColorsEnabled) {
                console.log("Darker System Colors: ON");
                // Do something to improve the behavior of the application while Darker System Colors is enabled.
            } else {
                console.log("Darker System Colors: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.DARKER_SYSTEM_COLORS_STATUS_CHANGED, onDarkerSystemColorsStatusChanged, false);

MobileAccessibilityNotifications.GRAYSCALE_STATUS_CHANGED (grayscalestatuschanged)

The event fires when Grayscale has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Grayscale is active, info.isGrayscaleEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onGrayscaleStatusChanged(info) {
        if (info && typeof info.isGrayscaleEnabled !== "undefined") {
            if (info.isGrayscaleEnabled) {
                console.log("Grayscale: ON");
                // Do something to improve the behavior of the application while Grayscale is enabled.
            } else {
                console.log("Grayscale: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.GRAYSCALE_STATUS_CHANGED, onGrayscaleStatusChanged, false);

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. If Guided Access is active, info.isGuidedAccessEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onGuidedAccessStatusChanged(info) {
        if (info && typeof info.isGuidedAccessEnabled !== "undefined") {
            if (info.isGuidedAccessEnabled) {
                console.log("Guided Access: ON");
                // Do something to improve the behavior of the application while Guided Access is enabled.
            } else {
                console.log("Guided Access: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED, onGuidedAccessStatusChanged, false);

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. If Invert Colors is active, info.isInvertColorsEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onInvertColorsStatusChanged(info) {
        if (info && typeof info.isInvertColorsEnabled !== "undefined") {
            if (info.isInvertColorsEnabled) {
                console.log("Invert Colors: ON");
                // Do something to improve the behavior of the application while Invert Colors is enabled.
            } else {
                console.log("Invert Colors: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED, onInvertColorsStatusChanged, false);

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. If Mono Audio is active, info.isMonoAudioEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onMonoAudioStatusChanged(info) {
        if (info && typeof info.isMonoAudioEnabled !== "undefined") {
            if (info.isMonoAudioEnabled) {
                console.log("Mono Audio: ON");
                // Do something to improve the behavior of the application while Mono Audio is enabled.
            } else {
                console.log("Mono Audio: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED, onMonoAudioStatusChanged, false);

MobileAccessibilityNotifications.REDUCE_MOTION_STATUS_CHANGED (reducemotionstatuschanged)

The event fires when Reduce Motion has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Reduce Motion is active, info.isReduceMotionEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onReduceMotionStatusChanged(info) {
        if (info && typeof info.isReduceMotionEnabled !== "undefined") {
            if (info.isReduceMotionEnabled) {
                console.log("Reduce Motion: ON");
                // Do something to improve the behavior of the application while Reduce Motion is enabled.
            } else {
                console.log("Reduce Motion: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.REDUCE_MOTION_STATUS_CHANGED, onMReduceMotionStatusChanged, false);

MobileAccessibilityNotifications.REDUCE_TRANSPARENCY_STATUS_CHANGED (reducetransparencystatuschanged)

The event fires when Reduce Transparency has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Reduce Transparency is active, info.isReduceTransparencyEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onReduceTransparencyStatusChanged(info) {
        if (info && typeof info.isReduceTransparencyEnabled !== "undefined") {
            if (info.isReduceTransparencyEnabled) {
                console.log("Reduce Transparency: ON");
                // Do something to improve the behavior of the application while Reduce Transparency is enabled.
            } else {
                console.log("Reduce Transparency: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.REDUCE_TRANSPARENCY_STATUS_CHANGED, onReduceTransparencyStatusChanged, false);

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. If a screen reader is active, info.isScreenReaderRunning will equal true.

    // Define a persistent callback method to handle the event
    function onScreenReaderStatusChanged(info) {
        if (info && typeof info.isScreenReaderRunning !== "undefined") {
            if (info.isScreenReaderRunning) {
                console.log("Screen reader: ON");
                // Do something to improve the behavior of the application while a screen reader is active.
            } else {
                console.log("Screen reader: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED, onScreenReaderStatusChanged, false);

MobileAccessibilityNotifications.SPEAK_SCREEN_STATUS_CHANGED (speakscreenstatuschanged)

The event fires when Speak Screen has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Speak Screen is active, info.isSpeakScreenEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onSpeakScreenStatusChanged(info) {
        if (info && typeof info.isSpeakScreenEnabled !== "undefined") {
            if (info.isSpeakScreenEnabled) {
                console.log("Speak Screen: ON");
                // Do something to improve the behavior of the application while Speak Screen is enabled.
            } else {
                console.log("Speak Screen: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.SPEAK_SCREEN_STATUS_CHANGED, onSpeakScreenStatusChanged, false);

MobileAccessibilityNotifications.SPEAK_SELECTION_STATUS_CHANGED (speakselectionstatuschanged)

The event fires when Speak Selection has been enabled on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Speak Selection is active, info.isSpeakSelectionEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onSpeakSelectionStatusChanged(info) {
        if (info && typeof info.isSpeakSelectionEnabled !== "undefined") {
            if (info.isSpeakSelectionEnabled) {
                console.log("Speak Selection: ON");
                // Do something to improve the behavior of the application while Speak Selection is enabled.
            } else {
                console.log("Speak Selection: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.SPEAK_SELECTION_STATUS_CHANGED, onSpeakSelectionStatusChanged, false);

MobileAccessibilityNotifications.SWITCH_CONTROL_STATUS_CHANGED (switchcontrolstatuschanged)

The event fires when Switch Control is running on an iOS device. The event returns an object, info, with the current status of accessibility features on the device. If Switch Control is running, info.isSwitchControlRunning will equal true.

    // Define a persistent callback method to handle the event
    function onSwitchControlStatusChanged(info) {
        if (info && typeof info.isSwitchControlRunning !== "undefined") {
            if (info.isSwitchControlRunning) {
                console.log("Switch Control: ON");
                // Do something to improve the behavior of the application while Switch Control is running.
            } else {
                console.log("Switch Control: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.SWITCH_CONTROL_STATUS_CHANGED, onSwitchControlStatusChanged, false);

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. If Touch Exploration is active, info.isTouchExplorationEnabled will equal true.

    // Define a persistent callback method to handle the event
    function onTouchExplorationChanged(info) {
        if (info && typeof info.isTouchExplorationEnabled !== "undefined") {
            if (info.isTouchExplorationEnabled) {
                console.log("Touch Exploration: ON");
                // Do something to improve the behavior of the application while Touch Exploration is enabled.
            } else {
                console.log("Touch Exploration: OFF");
            }
        }
    }

    // Register the callback method to handle the event
    window.addEventListener(MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED, onTouchExplorationChanged, false);

More Repositories

1

phonegap-start

PhoneGap Hello World app
JavaScript
3,427
star
2

phonegap-app-developer

PhoneGap Developer App
JavaScript
2,001
star
3

phonegap-plugin-push

Register and receive push notifications
Java
1,941
star
4

phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
Objective-C++
1,271
star
5

phonegap-app-desktop

PhoneGap Desktop App
JavaScript
842
star
6

phonegap-cli

PhoneGap and PhoneGap/Build command-line interface
JavaScript
490
star
7

phonegap-plugin-contentsync

Download and cache remotely hosted content
C
206
star
8

phonegap-plugin-fast-canvas

Fast, 2D, mostly-HTML5-canvas-compatible rendering surface for Android.
C
195
star
9

phonegap-docs

PhoneGap Documentation
Pug
121
star
10

build

This is the public repository for PhoneGap Build source and bug tracking
92
star
11

phonegap-community

PhoneGap Community Release Notes
81
star
12

phonegap-template-react-hot-loader

PhoneGap Template using React, ES2015, Webpack, and hot module reloading
JavaScript
79
star
13

phonegap-template-hello-world

PhoneGap Hello World app
JavaScript
72
star
14

node-phonegap-build-api

Node.js REST Client for the PhoneGap Build API
JavaScript
62
star
15

connect-phonegap

Stream a PhoneGap app to any device.
JavaScript
61
star
16

phonegap-app-star-track

The PhoneGap media example app
CSS
54
star
17

phonegap-plugin-pwa

A plugin to provide progressive web app API's
45
star
18

phonegap-template-framework7

A starter template for creating a hybrid app with Framework7.
CSS
43
star
19

phonegap-app-anyconference

AnyConference example app
JavaScript
41
star
20

phonegap-2-style-3

PhoneGap 3.0 project that includes all of the plugins by default
JavaScript
39
star
21

phonegap-plugin-local-notification

An implementation of the Web Notifications API for end-user notifications.
Objective-C
38
star
22

phonegap-webview-ios

Native iOS + PhoneGap Template
Ruby
36
star
23

phonegap-plugin-media-stream

JavaScript
34
star
24

phonegap-template-vue-f7-blank

A blank PhoneGap template using Vue.js and Framework7
JavaScript
32
star
25

phonegap-template-vue-f7-tabs

A TabBar PhoneGap template using Vue.js and Framework7
JavaScript
31
star
26

phonegap-symbian.wrt

Symbian WRT implementation of the PhoneGap API
JavaScript
28
star
27

emulate.phonegap.com

Ripple emulation for PhoneGap's JavaScript environment
JavaScript
28
star
28

node-phonegap-build

PhoneGap Build node module to login, create, and build apps.
JavaScript
25
star
29

phonegap-sample-hybrid-ios

A sample application showing a hybrid application with both native and webview components and communication.
Objective-C
24
star
30

phonegap-sample-hybrid-android

Java
22
star
31

phonegap-app-fast-canvas

Example game using phonegap-fast-canvas-plugin
JavaScript
20
star
32

phonegap.github.io

Main pages for phonegap.com hosted on GitHub pages.
JavaScript
20
star
33

phonegap-plugin-multiview

Spawn multiple cordova enabled webviews in one app
JavaScript
18
star
34

phonegap-template-vue-f7-split-panel

A Split View PhoneGap template using Vue.js and Framework7 that degrades to a Panel View on smaller devices
JavaScript
16
star
35

phonegap-plugin-media-recorder

Objective-C
14
star
36

phonegap-plugin-image-capture

JavaScript
11
star
37

build-bot-model

PhoneGap Build Bot 3D model
11
star
38

phonegap-plugin-template

This repo is a template for starting a new plugin.
JavaScript
10
star
39

phonegap-template-push

A sample application for getting started with push notifications
JavaScript
8
star
40

app

The app showcase found at http://phonegap.github.io/app
HTML
7
star
41

app.phonegap.com

Micro-site for the PhoneGap Developer App and PhoneGap Desktop app.
JavaScript
7
star
42

phonegap-app-anyconference-pgday

AnyConference app for PhoneGap Day
JavaScript
7
star
43

phonegap-app-augmented-reality

CSS
6
star
44

phonegap-template-vue-f7-todos-pwa

A Todo's app template with PWA support using Vue.js and Framework7
JavaScript
6
star
45

adobe-creative-sdk-foundation

OBSOLETE - see README
4
star
46

phonegap-roadmap

Upcoming milestones and projects for PhoneGap
4
star
47

native-plugin-sync-demo

Demo of native-plugin-sync
CSS
4
star
48

phonegap-template-blank

A blank PhoneGap app.
HTML
3
star
49

book

http://phonegap.com/book/
HTML
3
star
50

workshop-plugins

Workshop / lab content covering end to end plugin development
3
star
51

phonegap-plugin-multidex

Enable multidex in a Apache Cordova/PhoneGap application
3
star
52

tool

A collection of 3rd party tools for PhoneGap development.
HTML
3
star
53

cordova-android

DO NOT DELETE - contains the thread-safe bridge code
Java
3
star
54

phonegap-app-stockpile

n. - A storage pile accumulated for future use
JavaScript
3
star
55

phonegap-day

The website for PhoneGap Day
JavaScript
2
star
56

phonegap-app-todo

JavaScript
2
star
57

linting-and-editorconfig

Reference repo for eslint (and other linters) as well as editorconfig settings and info
JavaScript
1
star
58

topcoat-preact

React components implementing Topcoat components
JavaScript
1
star
59

phonegap-template-webvr

PhoneGap template for the WebVR Boilerplate at https://github.com/borismus/webvr-boilerplate
JavaScript
1
star
60

dotfiles

A repo to collect the dot files we use consistently in our other repositories
1
star
61

phonegap-plugin-developer-mode

Utility functions for the Phonegap Developer app
JavaScript
1
star