Search in sources :

Example 1 with ZoomButtonsController

use of android.widget.ZoomButtonsController in project KJFrameForAndroid by kymjs.

the class UIHelper method initWebView.

@SuppressLint({ "JavascriptInterface", "SetJavaScriptEnabled" })
public static void initWebView(WebView webView) {
    WebSettings settings = webView.getSettings();
    settings.setDefaultFontSize(15);
    settings.setJavaScriptEnabled(true);
    settings.setSupportZoom(true);
    settings.setBuiltInZoomControls(true);
    int sysVersion = Build.VERSION.SDK_INT;
    if (sysVersion >= 11) {
        settings.setDisplayZoomControls(false);
    } else {
        ZoomButtonsController zbc = new ZoomButtonsController(webView);
        zbc.getZoomControls().setVisibility(View.GONE);
    }
    webView.setWebViewClient(UIHelper.getWebViewClient());
}
Also used : WebSettings(android.webkit.WebSettings) ZoomButtonsController(android.widget.ZoomButtonsController) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 2 with ZoomButtonsController

use of android.widget.ZoomButtonsController in project robolectric by robolectric.

the class ShadowMapView method __constructor__.

public void __constructor__(Context context, AttributeSet attributeSet) {
    setContextOnRealView(context);
    this.attributeSet = attributeSet;
    zoomButtonsController = new ZoomButtonsController(realMapView);
    invokeConstructor(View.class, realView, ClassParameter.from(Context.class, context), ClassParameter.from(AttributeSet.class, attributeSet), ClassParameter.from(int.class, 0));
    invokeConstructor(ViewGroup.class, realView, ClassParameter.from(Context.class, context), ClassParameter.from(AttributeSet.class, attributeSet), ClassParameter.from(int.class, 0));
}
Also used : Context(android.content.Context) AttributeSet(android.util.AttributeSet) ZoomButtonsController(android.widget.ZoomButtonsController)

Example 3 with ZoomButtonsController

use of android.widget.ZoomButtonsController in project robolectric by robolectric.

the class ShadowMapView method __constructor__.

@Override
public void __constructor__(Context context, AttributeSet attributeSet, int defStyle) {
    setContextOnRealView(context);
    this.attributeSet = attributeSet;
    zoomButtonsController = new ZoomButtonsController(realMapView);
    invokeConstructor(View.class, realView, ClassParameter.from(Context.class, context), ClassParameter.from(AttributeSet.class, attributeSet), ClassParameter.from(int.class, defStyle));
    invokeConstructor(ViewGroup.class, realView, ClassParameter.from(Context.class, context), ClassParameter.from(AttributeSet.class, attributeSet), ClassParameter.from(int.class, defStyle));
    super.__constructor__(context, attributeSet, defStyle);
}
Also used : Context(android.content.Context) AttributeSet(android.util.AttributeSet) ZoomButtonsController(android.widget.ZoomButtonsController)

Example 4 with ZoomButtonsController

use of android.widget.ZoomButtonsController in project android-vertical-slide-view by xmuSistone.

the class CustWebView method getControlls.

private void getControlls() {
    try {
        Class<?> webview = Class.forName("android.webkit.WebView");
        Method method = webview.getMethod("getZoomButtonsController");
        ZoomButtonsController zoomController = (ZoomButtonsController) method.invoke(this);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ZoomButtonsController(android.widget.ZoomButtonsController) Method(java.lang.reflect.Method)

Example 5 with ZoomButtonsController

use of android.widget.ZoomButtonsController in project android_frameworks_base by ParanoidAndroid.

the class ZoomControlEmbedded method getControls.

private ZoomButtonsController getControls() {
    if (mZoomButtonsController == null) {
        mZoomButtonsController = new ZoomButtonsController(mWebView.getWebView());
        mZoomButtonsController.setOnZoomListener(new ZoomListener());
        // ZoomButtonsController positions the buttons at the bottom, but in
        // the middle. Change their layout parameters so they appear on the
        // right.
        View controls = mZoomButtonsController.getZoomControls();
        ViewGroup.LayoutParams params = controls.getLayoutParams();
        if (params instanceof FrameLayout.LayoutParams) {
            ((FrameLayout.LayoutParams) params).gravity = Gravity.END;
        }
    }
    return mZoomButtonsController;
}
Also used : ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) ZoomButtonsController(android.widget.ZoomButtonsController) View(android.view.View)

Aggregations

ZoomButtonsController (android.widget.ZoomButtonsController)8 View (android.view.View)3 ViewGroup (android.view.ViewGroup)3 FrameLayout (android.widget.FrameLayout)3 Context (android.content.Context)2 AttributeSet (android.util.AttributeSet)2 SuppressLint (android.annotation.SuppressLint)1 WebSettings (android.webkit.WebSettings)1 Method (java.lang.reflect.Method)1