mirror of
https://gitee.com/shuto-github/phonegap-mobile-accessibility.git
synced 2026-05-26 00:00:06 +08:00
Add support for adjusting text in the WebView to the preferred zoom scale on Android.
More robust iOS support is forthcoming, but currently works with iOS7
Dynamic Type Fonts by setting the following css on the body and using
relatively sized fonts sizing for child containers, for example:
body {
font: -apple-system-body;
}
body > .app {
font-family: 'HelveticaNeue-Light', 'HelveticaNeue', Helvetica,
Arial, sans-serif;
font-size:0.75em;
font-weight: 200;
}
This commit is contained in:
+13
@@ -3,6 +3,7 @@ package com.phonegap.plugin.mobileaccessibility;
|
||||
import android.accessibilityservice.AccessibilityServiceInfo;
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
|
||||
@@ -29,6 +30,18 @@ public class IceCreamSandwichMobileAccessibilityHelper extends
|
||||
mAccessibilityStateChangeListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextZoom() {
|
||||
return mWebView.getSettings().getTextZoom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextZoom(int textZoom) {
|
||||
final int zoom = textZoom;
|
||||
//Log.i("MobileAccessibility", "setTextZoom(" + zoom + ")");
|
||||
mWebView.getSettings().setTextZoom(zoom);
|
||||
}
|
||||
|
||||
protected class InternalAccessibilityStateChangeListener
|
||||
implements AccessibilityStateChangeListener {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user