Java Code Examples for android.widget.ZoomButtonsController.setVisible()

The following are Jave code examples for showing how to use setVisible() of the android.widget.ZoomButtonsController class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: WhiteRead   File: MMWebView.java   Source Code and License Vote up 5 votes
private void getController(boolean tag) {
    try {
        Class webView = Class.forName("android.webkit.WebView");
        Method method = webView.getMethod("getZoomButtonsController");
        ZoomButtonsController zoomController = (ZoomButtonsController) method.invoke(this, new Object[]{});
        if (zoomController != null) {
            zoomController.setVisible(tag);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 2
Project: chromium_webview   File: AwZoomControls.java   Source Code and License Vote up 5 votes
@Override
public void invokeZoomPicker() {
    ZoomButtonsController zoomController = getZoomController();
    if (zoomController != null) {
        zoomController.setVisible(true);
    }
}
 
Example 3
Project: chromium_webview   File: AwZoomControls.java   Source Code and License Vote up 5 votes
@Override
public void dismissZoomPicker() {
    ZoomButtonsController zoomController = getZoomController();
    if (zoomController != null) {
        zoomController.setVisible(false);
    }
}
 
Example 4
Project: pickncrop   File: MainActivity.java   Source Code and License Vote up 5 votes
public void createZoomControls() {
	ZoomButtonsController zoomButtonsController = new ZoomButtonsController(
			imageView);
	zoomButtonsController.setVisible(true);
	zoomButtonsController.setAutoDismissed(false);
	zoomButtonsController.setOnZoomListener(new OnZoomListener() {

		public void onZoom(boolean zoomIn) {
			matrix = imageView.getImageMatrix();
			if (zoomIn) {
				matrix.postScale(1.05f, 1.05f, 0.5f * size, 0.5f * size);
				imageView.setImageMatrix(matrix);
			} else {
				matrix.postScale(0.95f, 0.95f, 0.5f * size, 0.5f * size);
				imageView.setImageMatrix(matrix);
			}
			imageView.invalidate();
		}

		public void onVisibilityChanged(boolean visible) {
		}
	});
	RelativeLayout.LayoutParams zoomLayoutParams = new RelativeLayout.LayoutParams(
			LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	zoomLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
	zoomLayoutParams.addRule(RelativeLayout.BELOW, R.id.imageViewCrop);
	viewManager.addView(zoomButtonsController.getContainer(),
			zoomLayoutParams);
}
 
Example 5
Project: cordova-android-chromium   File: AwZoomControls.java   Source Code and License Vote up 5 votes
@Override
public void invokeZoomPicker() {
    ZoomButtonsController zoomController = getZoomController();
    if (zoomController != null) {
        zoomController.setVisible(true);
    }
}
 
Example 6
Project: cordova-android-chromium   File: AwZoomControls.java   Source Code and License Vote up 5 votes
@Override
public void dismissZoomPicker() {
    ZoomButtonsController zoomController = getZoomController();
    if (zoomController != null) {
        zoomController.setVisible(false);
    }
}