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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.