Package 

Class ScanbotCameraView

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewManager , android.view.ViewParent , android.view.accessibility.AccessibilityEventSource , io.scanbot.sdk.ui.camera.IScanbotCameraView , io.scanbot.sdk.ui.camera.UiZoomDelegate , io.scanbot.sdk.ui.camera.util.FinderViewAttributeHandler

    
    public final class ScanbotCameraView
    extends FrameLayout implements IScanbotCameraView, UiZoomDelegate, FinderViewAttributeHandler
                        

    Provides interface to native Camera and displays camera stream. Use this class if you want to fine-tune camera behavior.

    It is required to pass android.app.Activity (or android.app.Fragment) lifecycle events to this view: .onResume, .onPause. They are used to automatically start and stop camera.

    It is possible to include other views inside of ScanbotCameraView. In such case they will be drawn on top of camera preview with size matching the camera frame. You can use this fact to draw overlays on top of camera.

    Preview frames are provided via PreviewBuffer: .getPreviewBuffer.

    • Method Summary

      Modifier and Type Method Description
      Long getDelayAfterFocusCompleteMs() Delay that camera will took before snap on auto focus complete called from camera core in ms.
      Unit setDelayAfterFocusCompleteMs(Long delayAfterFocusCompleteMs) Delay that camera will took before snap on auto focus complete called from camera core in ms.
      final PreviewBuffer getPreviewBuffer()
      final List<Camera.Size> getSupportedPictureSizes()
      final List<Camera.Size> getSupportedPreviewSizes()
      Integer getFinderViewId()
      final Unit onResume() Notifies view that enclosing android.app.Activity or android.app.Fragment was resumed and therefore camera can be started.
      final Unit onPause() Notifies view that enclosing android.app.Activity or android.app.Fragment was paused and therefore camera must be closed.
      final Unit startPreview() Starts/resumes camera preview stream.
      final Unit stopPreview() Stops camera preview stream.
      Unit takePicture(Boolean acquireFocus) Takes picture.
      Unit useFlash(Boolean useFlash) Enables or disables camera flash.
      Unit setAutoFocusOnTouch(Boolean autoFocusOnTouch)
      Unit autoFocus() Performs auto-focus.
      Unit continuousFocus() Cancels auto-focus and performs continuous-focus.
      Unit addPictureCallback(BasePictureCallback pictureCallback) Adds callback which will be notified when picture will be taken.
      Unit removePictureCallback(BasePictureCallback pictureCallback) Removes callback, so it won't receive any further notifications.
      Unit addCameraStateCallback(CameraStateCallback cameraStateCallback) Adds callback which will be notified about camera state changes.
      Unit removeCameraStateCallback(CameraStateCallback cameraStateCallback) Removes callback, so it won't receive any further notifications.
      Unit addTakePictureCallback(CameraTakePictureCallback cameraTakePictureCallback) Adds callback which will be notified about take picture operation process.
      Unit removeTakePictureCallback(CameraTakePictureCallback cameraTakePictureCallback) Removes callback, so it won't receive any further notifications.
      Unit setCameraOpenCallback(CameraOpenCallback cameraOpenCallback) Callback which will be invoked when camera will be opened
      final Unit setPictureSize(Camera.Size pictureSize) Set camera picture size
      final Unit setPreviewSize(Camera.Size previewSize) Set camera preview size
      final Unit setAutoFocusSound(Boolean enabled) Set camera auto focus sound state.
      final Unit setShutterSound(Boolean enabled) Set camera shutter sound state.
      Unit setPreviewMode(CameraPreviewMode mode) Set the camera preview mode.
      Unit lockToPortrait(Boolean lockPicture) Locks camera in portrait mode
      Unit lockToLandscape(Boolean lockPicture) Locks camera in landscape mode
      Unit unlockOrientation() Unlocks camera orientation
      Unit usePinchToZoom(Boolean usePinchToZoom) Enables/disables Pinch-to-Zoom camera functionality
      Unit setOpticalZoomLevel(Float zoomLevel) Sets current zoom by a linear zoom value ranging from 0f to 1.0f.
      Unit setOpticalZoomRange(ZoomRange zoomRange) Set custom zoom range.
      Unit setCameraModule(CameraModule cameraModule) Defines a camera module.
      <T extends FrameHandler> T getAttachedFrameHandler(Class<T> clazz) Check whether there is same class of FrameHandler attached to the view return object of the same class if exists otherwise null
      Unit addFrameHandler(FrameHandler frameHandler) Used to add frame handler that will be called on each next frame
      Unit removeFrameHandler(FrameHandler frameHandler) Unregisters FrameHandler.
      Unit setUiZoomLevel(Float zoomLevel) Passes the zoom value to the dependent view
      • Methods inherited from class android.view.ViewGroup

        addExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
      • Methods inherited from class android.widget.FrameLayout

        addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawChild, drawableStateChanged, endViewTransition, findFocus, findViewsWithText, focusSearch, focusableViewAvailable, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildDrawingOrder, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildWithMargins, measureChildren, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
      • Methods inherited from class io.scanbot.sdk.camera.ScanbotCameraView

        checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, onMeasure, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
      • Methods inherited from class java.lang.Object

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

      • ScanbotCameraView

        ScanbotCameraView(Context context)
    • Method Detail

      • getDelayAfterFocusCompleteMs

         Long getDelayAfterFocusCompleteMs()

        Delay that camera will took before snap on auto focus complete called from camera core in ms. For some devices this callback could call even before real auto focus completed, so we need to take some delay before snapping. Usually you can set 500ms. By default it is set to 20ms.

      • setDelayAfterFocusCompleteMs

         Unit setDelayAfterFocusCompleteMs(Long delayAfterFocusCompleteMs)

        Delay that camera will took before snap on auto focus complete called from camera core in ms. For some devices this callback could call even before real auto focus completed, so we need to take some delay before snapping. Usually you can set 500ms. By default it is set to 20ms.

      • startPreview

         final Unit startPreview()

        Starts/resumes camera preview stream. Usually used after picture was taken. Note, that preview is started by default after .onResume, so there is no need to call it at the start of the app.

        If view is paused, this call is ignored.

      • takePicture

         Unit takePicture(Boolean acquireFocus)

        Takes picture.

        <p> This is asynchronous process, so results are reported via {@link PictureCallback} added in {@link #addPictureCallback(PictureCallback)}. If snapping process is still going all subsequent calls to {@link #takePicture(boolean)} are ignored. <p> After picture is taken, camera preview is stopped. If you wish it continue, use {@link #startPreview()} <p> If view is paused, this call is ignored.
        Parameters:
        acquireFocus - {@code true} to perform auto-focus before shooting.
      • useFlash

         Unit useFlash(Boolean useFlash)

        Enables or disables camera flash.

        If there is no flash on this device, does nothing.

        If view is paused, this call is ignored.

        Parameters:
        useFlash - true to enable flash.
      • setAutoFocusOnTouch

         Unit setAutoFocusOnTouch(Boolean autoFocusOnTouch)
        Parameters:
        autoFocusOnTouch - if true - auto focus on touch will be enabled, false - otherwise.
      • autoFocus

         Unit autoFocus()

        Performs auto-focus.

        If there is no auto-focus capabilities on this device, does nothing.

        If view is paused, this call is ignored.

      • continuousFocus

         Unit continuousFocus()

        Cancels auto-focus and performs continuous-focus. Should be executed from the main thread and when camera is opened

        If there is no continuous-focus capabilities on this device, does auto-focus.

        If view is paused, this call is ignored.

      • addPictureCallback

         Unit addPictureCallback(BasePictureCallback pictureCallback)

        Adds callback which will be notified when picture will be taken. Callbacks are invoked on a worker thread, so you can safely perform "heavy" operations here.

        Parameters:
        pictureCallback - callback to register.
      • addCameraStateCallback

         Unit addCameraStateCallback(CameraStateCallback cameraStateCallback)

        Adds callback which will be notified about camera state changes. Callbacks are invoked on a main thread.

        Parameters:
        cameraStateCallback - callback to register.
      • addTakePictureCallback

         Unit addTakePictureCallback(CameraTakePictureCallback cameraTakePictureCallback)

        Adds callback which will be notified about take picture operation process. Callbacks are invoked on a main thread.

        Parameters:
        cameraTakePictureCallback - callback to register.
      • setAutoFocusSound

         final Unit setAutoFocusSound(Boolean enabled)

        Set camera auto focus sound state. true if system sound should be played on successful auto focus event, false - otherwise. By default, the camera plays the system-defined camera auto focus sound when autoFocus() is called.

      • setShutterSound

        @RequiresApi(api = 17) final Unit setShutterSound(Boolean enabled)

        Set camera shutter sound state. true if system sound should be played on the take picture event, false - otherwise. By default, the camera plays the system-defined camera shutter sound when takePicture() is called.

        Note that devices may not always allow disabling the camera shutter sound. If the shutter sound state cannot be set to the desired value, this method will be ignored.

      • lockToPortrait

         Unit lockToPortrait(Boolean lockPicture)

        Locks camera in portrait mode

        Parameters:
        lockPicture - if true - taken picture will ba locked to the portrait orientation, false - picture orientation depends on the device sensor.
      • lockToLandscape

         Unit lockToLandscape(Boolean lockPicture)

        Locks camera in landscape mode

        Parameters:
        lockPicture - if true - taken picture will ba locked to the landscape orientation, false - picture orientation depends on the device sensor.
      • usePinchToZoom

         Unit usePinchToZoom(Boolean usePinchToZoom)

        Enables/disables Pinch-to-Zoom camera functionality

        Parameters:
        usePinchToZoom - true if Pinch-to-Zoom should be enabled, false - otherwise
      • setOpticalZoomLevel

         Unit setOpticalZoomLevel(Float zoomLevel)

        Sets current zoom by a linear zoom value ranging from 0f to 1.0f. Zoom Level 0f represents the minimum zoom while Zoom Level 1.0f represents the maximum zoom. Default value is 0f.

        Parameters:
        zoomLevel - Target zoom level
      • setOpticalZoomRange

         Unit setOpticalZoomRange(ZoomRange zoomRange)

        Set custom zoom range. Default value is ZoomRange(0f, 1f).

        Parameters:
        zoomRange - Target zoom range
      • setUiZoomLevel

         Unit setUiZoomLevel(Float zoomLevel)

        Passes the zoom value to the dependent view

        Parameters:
        zoomLevel - the new scale of the UI