11 Commits

Author SHA1 Message Date
Michael Jordan
435745aa91 Remove licensing notice from README.md 2015-09-25 09:06:32 -04:00
Michael Jordan
3256a29085 Bump version and reorder package.json
Trying to ensure that README.md data appears on npmjs.com
2015-09-25 08:50:33 -04:00
Michael Jordan
e9af64bc44 Issue 22: Please add package.json
Add package.json file and rename package id to follow npm convention.
2015-09-25 08:10:39 -04:00
Michael Jordan
3efce21dfd Merge pull request #18 from ajyong/master
Restore compatibility with Cordova Android 4.0+
2015-06-26 09:23:37 -04:00
Aaron Yong
37a7d11251 Restore compatibility with Cordova Android 4.0+
Fixes #17 and #13.  The WebView object is now accessed via a `getView()` method call on `CordovaWebView` objects.
2015-06-25 15:29:49 -06:00
Michael Jordan
b35a21f724 Merge pull request #14 from rromerogar/master
Fix issue 13
2015-04-30 09:27:17 -04:00
Raúl Romero García
852cec5240 Fix issue 13 2015-04-30 15:22:33 +02:00
Shazron Abdullah
2fb3aa4c2b Updated version to 0.1.3
This is for the dependency plugin rename
2015-04-20 10:55:08 -07:00
Shazron Abdullah
b8f90d3841 Merge pull request #9 from EddyVerbruggen/dependency-failure
Failed to load dependent plugins
2015-04-20 00:20:18 -07:00
EddyVerbruggen
d0db5b05b5 Failed to load dependent plugins 2015-04-19 21:28:13 +02:00
EddyVerbruggen
c924261c26 Failed to load dependent plugins 2015-04-19 21:13:33 +02:00
7 changed files with 70 additions and 34 deletions

View File

@@ -1,23 +1,4 @@
<!--
The following copyright message should appear at the top of all
source files. This file can be removed from your repository.
Copyright (c) 2013-2014 Adobe Systems Incorporated. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# com.phonegap.plugin.mobile-accessibility
# 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.

37
package.json Normal file
View File

@@ -0,0 +1,37 @@
{
"name": "phonegap-plugin-mobile-accessibility",
"description": "PhoneGap Mobile Accessibility Plugin",
"version": "1.0.0",
"homepage": "http://github.com/phonegap/phonegap-mobile-accessibility#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/phonegap/phonegap-mobile-accessibility.git"
},
"bugs": {
"url": "https://github.com/phonegap/phonegap-mobile-accessibility/issues"
},
"cordova": {
"id": "phonegap-plugin-mobile-accessibility",
"platforms": [
"ios",
"android",
"windows"
]
},
"keywords": [
"phonegap",
"mobile accessibility",
"ecosystem:cordova",
"cordova-ios",
"cordova-android",
"cordova-windows"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
}
],
"author": "Adobe PhoneGap Team",
"license": "Apache 2.0"
}

View File

@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugin.mobile-accessibility"
version="0.1.2">
id="phonegap-plugin-mobile-accessibility"
version="1.0.0">
<name>Mobile Accessibility</name>
<description>PhoneGap Mobile Accessibility Plugin</description>
<license>Apache 2.0</license>
@@ -21,8 +20,8 @@
<clobbers target="MobileAccessibilityNotifications" />
</js-module>
<dependency id="org.apache.cordova.device" url="https://github.com/apache/cordova-plugin-device.git" />
<dependency id="org.apache.cordova.network-information" url="https://github.com/apache/cordova-plugin-network-information.git" />
<dependency id="cordova-plugin-device" url="https://github.com/apache/cordova-plugin-device.git" />
<dependency id="cordova-plugin-network-information" url="https://github.com/apache/cordova-plugin-network-information.git" />
<!-- ios -->
<platform name="ios">

View File

@@ -38,7 +38,12 @@ public class DonutMobileAccessibilityHelper extends
@Override
public void initialize(MobileAccessibility mobileAccessibility) {
mMobileAccessibility = mobileAccessibility;
mWebView = mobileAccessibility.webView;
try {
mWebView = (WebView) mobileAccessibility.webView;
} catch (ClassCastException ce) { // cordova-android 4.0+
mWebView = (WebView) mobileAccessibility.webView.getView();
}
mAccessibilityManager = (AccessibilityManager) mMobileAccessibility.cordova.getActivity().getSystemService(Context.ACCESSIBILITY_SERVICE);
}

View File

@@ -26,6 +26,7 @@ import com.phonegap.plugin.mobileaccessibility.MobileAccessibility;
import android.annotation.TargetApi;
import android.os.Build;
import android.view.accessibility.AccessibilityEvent;
import android.webkit.WebView;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public class JellyBeanMobileAccessibilityHelper extends
@@ -33,8 +34,14 @@ public class JellyBeanMobileAccessibilityHelper extends
@Override
public void initialize(MobileAccessibility mobileAccessibility) {
WebView view;
super.initialize(mobileAccessibility);
mParent = mobileAccessibility.webView.getParentForAccessibility();
try {
view = (WebView) mobileAccessibility.webView;
} catch (ClassCastException ce) { // cordova android 4.0+
view = (WebView) mobileAccessibility.webView.getView();
}
mParent = view.getParentForAccessibility();
}
@Override

View File

@@ -31,6 +31,7 @@ import org.json.JSONException;
import org.json.JSONObject;
import android.os.Build;
import android.webkit.WebView;
/**
* This class provides information on the status of native accessibility services to JavaScript.
@@ -132,9 +133,15 @@ public class MobileAccessibility extends CordovaPlugin {
stop();
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
webView.reload();
}
});
WebView view;
try {
view = (WebView) webView;
} catch(ClassCastException ce) { // cordova-android 4.0+
view = (WebView) webView.getView();
}
view.reload();
}
});
}
}

View File

@@ -22,10 +22,10 @@
var argscheck = require('cordova/argscheck'),
utils = require('cordova/utils'),
exec = require('cordova/exec'),
device = require('org.apache.cordova.device.device'),
network = require('org.apache.cordova.network-information.network'),
connection = require('org.apache.cordova.network-information.Connection'),
MobileAccessibilityNotifications = require('com.phonegap.plugin.mobile-accessibility.MobileAccessibilityNotifications');
device = require('cordova-plugin-device.device'),
network = require('cordova-plugin-network-information.network'),
connection = require('cordova-plugin-network-information.Connection'),
MobileAccessibilityNotifications = require('phonegap-plugin-mobile-accessibility.MobileAccessibilityNotifications');
var MobileAccessibility = function() {
this._isScreenReaderRunning = false;