Class ZoomTransaction
-
- All Implemented Interfaces:
-
android.hardware.Camera.OnZoomChangeListener
public final class ZoomTransaction implements Camera.OnZoomChangeListener
Class for processing a zoom request. Create an instance of this by calling zoomTo() on a CameraFragment or CameraView.
-
-
Method Summary
Modifier and Type Method Description ZoomTransaction
onComplete(Runnable onComplete)
Call this to specify a Runnable to be executed when the zoom operation is complete. ZoomTransaction
onChange(Camera.OnZoomChangeListener onChange)
Call this to specify an OnZoomChangeListener to be notified of changes in the zoom level. void
go()
Actually performs the zoom. void
cancel()
Cancels an outstanding smooth zoom request. void
onZoomChange(int zoomValue, boolean stopped, Camera camera)
-
-
Method Detail
-
onComplete
ZoomTransaction onComplete(Runnable onComplete)
Call this to specify a Runnable to be executed when the zoom operation is complete.
- Parameters:
onComplete
- a Runnable
-
onChange
ZoomTransaction onChange(Camera.OnZoomChangeListener onChange)
Call this to specify an OnZoomChangeListener to be notified of changes in the zoom level. For a smooth zoom, this will be called for each change in the zoom level. For a non-smooth zoom, this will be called once, at the end.
- Parameters:
onChange
- the listener for zoom change events
-
go
void go()
Actually performs the zoom. If smooth zooming is supported, the zoom begins but happens asynchronously. If smoooth zooming is not supported, the zoom happens immediately, and your callback objects (OnZoomChangedListener, Runnable) are immediately invoked.
-
cancel
void cancel()
Cancels an outstanding smooth zoom request. Call this after go() and before your onCompleted Runnable is invoked.
-
onZoomChange
void onZoomChange(int zoomValue, boolean stopped, Camera camera)
-
-
-
-