Code example for ZoomButtonsController

Methods: getZoomControls

0
    // This method is used in tests. It doesn't modify the state of zoom controls. 
    View getZoomControlsViewForTest() {
        return mZoomButtonsController != null ? mZoomButtonsController.getZoomControls() : null;
    } 
 
    void updateZoomControls() { 
        if (mZoomButtonsController == null) return;
        boolean canZoomIn = mContentViewCore.canZoomIn();
        boolean canZoomOut = mContentViewCore.canZoomOut();
        if (!canZoomIn && !canZoomOut) {
            // Hide the zoom in and out buttons if the page cannot zoom 
            mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
        } else { 
            // Set each one individually, as a page may be able to zoom in or out 
            mZoomButtonsController.setZoomInEnabled(canZoomIn);
            mZoomButtonsController.setZoomOutEnabled(canZoomOut);
        } 
    } 
 
    private class ZoomListener implements ZoomButtonsController.OnZoomListener {
        @Override