Code example for ZoomControls

Methods: getVisibility, setIsZoomInEnabled, setIsZoomOutEnabled, setVisibility

0
			onViewChanged(scaleIncrement);
		} 
	} 
 
	private void handleScaleDown() 
	{ 
		if (scaleFactor > scaleMin) {
			onViewChanged(-scaleIncrement);
		} 
	} 
 
	private void handleHideControls() 
	{ 
		zoomControls.setVisibility(View.GONE);
	} 
 
	private void manageControls() 
	{ 
		if (scaleFactor == scaleMax) {
			zoomControls.setIsZoomInEnabled(false);
		} else { 
			zoomControls.setIsZoomInEnabled(true);
		} 
 
		if (scaleFactor == scaleMin) {
			zoomControls.setIsZoomOutEnabled(false);
		} else { 
			zoomControls.setIsZoomOutEnabled(true);
		} 
	} 
 
	private void onViewChanged(float dscale)
	{ 
		updateChangeMatrix(dscale);
		manageControls(); 
		requestLayout();
		scheduleControlTimeout(); 
	} 
 
	private void computeBaseMatrix() 
	{ 
		Drawable d = imageView.getDrawable();
		baseMatrix.reset();
 
		if (d != null) {
			// The base matrix is the matrix that displays the entire image bitmap. 
			// It orients the image when orientation is set and scales in X and Y independently,  
			// so that src matches dst exactly. 
			// This may change the aspect ratio of the src. 
			Rect r = new Rect();
			getDrawingRect(r);
			int intrinsicWidth = d.getIntrinsicWidth();
			int intrinsicHeight = d.getIntrinsicHeight();