protected void stop() { // Log.i("MobileAccessibility", "MobileAccessibility.stop"); if (mCallbackContext != null) { sendMobileAccessibilityStatusChangedCallback(); mMobileAccessibilityHelper.removeStateChangeListeners(); mCallbackContext = null; } }
protected boolean isTouchExplorationEnabled(final CallbackContext callbackContext) { mTouchExplorationEnabled = mMobileAccessibilityHelper.isTouchExplorationEnabled(); cordova .getThreadPool() .execute( new Runnable() { public void run() { callbackContext.success(mTouchExplorationEnabled ? 1 : 0); } }); return mTouchExplorationEnabled; }
protected boolean isScreenReaderRunning(final CallbackContext callbackContext) { mIsScreenReaderRunning = mMobileAccessibilityHelper.isScreenReaderRunning(); cordova .getThreadPool() .execute( new Runnable() { public void run() { callbackContext.success(mIsScreenReaderRunning ? 1 : 0); } }); return mIsScreenReaderRunning; }
@Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { mMobileAccessibilityHelper = new KitKatMobileAccessibilityHelper(); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { mMobileAccessibilityHelper = new JellyBeanMobileAccessibilityHelper(); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { mMobileAccessibilityHelper = new IceCreamSandwichMobileAccessibilityHelper(); } else { mMobileAccessibilityHelper = new DonutMobileAccessibilityHelper(); } mMobileAccessibilityHelper.initialize(this); }
protected void announceForAccessibility( CharSequence text, final CallbackContext callbackContext) { mMobileAccessibilityHelper.announceForAccessibility(text); if (callbackContext != null) { JSONObject info = new JSONObject(); try { info.put("stringValue", text); info.put("wasSuccessful", mIsScreenReaderRunning); } catch (JSONException e) { e.printStackTrace(); } callbackContext.success(info); } }
protected void start(CallbackContext callbackContext) { // Log.i("MobileAccessibility", "MobileAccessibility.start"); mCallbackContext = callbackContext; mMobileAccessibilityHelper.addStateChangeListeners(); sendMobileAccessibilityStatusChangedCallback(); }
protected boolean isTouchExplorationEnabled() { mTouchExplorationEnabled = mMobileAccessibilityHelper.isTouchExplorationEnabled(); return mTouchExplorationEnabled; }
protected boolean isClosedCaptioningEnabled() { mClosedCaptioningEnabled = mMobileAccessibilityHelper.isClosedCaptioningEnabled(); return mClosedCaptioningEnabled; }
protected boolean isScreenReaderRunning() { mIsScreenReaderRunning = mMobileAccessibilityHelper.isScreenReaderRunning(); return mIsScreenReaderRunning; }