-
- 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 ScanbotCameraXView extends ConstraintLayout implements IScanbotCameraView, UiZoomDelegate, FinderViewAttributeHandler
Wrapper view for CameraX
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classScanbotCameraXView.Companion
-
Field Summary
Fields Modifier and Type Field Description private Array<Size>supportedPreviewSizesprivate Array<Size>supportedPictureSizesprivate LifecycleOwnerlifecycleOwnerprivate LongdelayAfterFocusCompleteMsprivate final SparseArray<View>mChildrenByIdsprivate final ConstraintWidgetContainermLayoutWidgetprivate final BooleanmDirtyHierarchyprivate final ConstraintLayoutStatesmConstraintLayoutSpecprivate final IntegermLastMeasureWidthSizeprivate final IntegermLastMeasureHeightSizeprivate final IntegermLastMeasureWidthModeprivate final IntegermLastMeasureHeightModeprivate final ConstraintLayout.MeasurermMeasurerprivate final IntegerfinderViewId
-
Constructor Summary
Constructors Constructor Description ScanbotCameraXView(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description final Array<Size>getSupportedPreviewSizes()final UnitsetSupportedPreviewSizes(Array<Size> supportedPreviewSizes)final Array<Size>getSupportedPictureSizes()final UnitsetSupportedPictureSizes(Array<Size> supportedPictureSizes)final LifecycleOwnergetLifecycleOwner()final UnitsetLifecycleOwner(LifecycleOwner lifecycleOwner)LonggetDelayAfterFocusCompleteMs()Delay that camera will took before snap on auto focus complete called from camera core in ms. UnitsetDelayAfterFocusCompleteMs(Long delayAfterFocusCompleteMs)Delay that camera will took before snap on auto focus complete called from camera core in ms. IntegergetFinderViewId()<T extends FrameHandler> TgetAttachedFrameHandler(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 UnitaddFrameHandler(FrameHandler frameHandler)Used to add frame handler that will be called on each next frame UnitremoveFrameHandler(FrameHandler frameHandler)Unregisters FrameHandler. UnitsetPreviewMode(CameraPreviewMode previewMode)Set the camera preview mode. UnittakePicture(Boolean acquireFocus)Takes picture. UnitaddPictureCallback(BasePictureCallback pictureCallback)Adds callback which will be notified when picture will be taken. UnitremovePictureCallback(BasePictureCallback pictureCallback)Removes callback, so it won't receive any further notifications. UnitsetCameraOpenCallback(CameraOpenCallback cameraOpenCallback)Callback which will be invoked when camera will be opened UnitaddCameraStateCallback(CameraStateCallback cameraStateCallback)Adds callback which will be notified about camera state changes. UnitremoveCameraStateCallback(CameraStateCallback cameraStateCallback)Removes callback, so it won't receive any further notifications. UnitaddTakePictureCallback(CameraTakePictureCallback cameraTakePictureCallback)Adds callback which will be notified about take picture operation process. UnitremoveTakePictureCallback(CameraTakePictureCallback cameraTakePictureCallback)Removes callback, so it won't receive any further notifications. UnitsetAutoFocusOnTouch(Boolean autoFocusOnTouch)UnitautoFocus()Performs auto-focus. UnitcontinuousFocus()Cancels auto-focus and performs continuous-focus. UnituseFlash(Boolean useFlash)Enables or disables camera flash. UnitlockToPortrait(Boolean lockPicture)Locks camera in portrait mode UnitlockToLandscape(Boolean lockPicture)Locks camera in landscape mode UnitunlockOrientation()Unlocks camera orientation UnitusePinchToZoom(Boolean usePinchToZoom)Enables/disables Pinch-to-Zoom camera functionality UnitsetOpticalZoomLevel(Float zoomLevel)Sets current zoom by a linear zoom value ranging from 0f to 1.0f. UnitsetOpticalZoomRange(ZoomRange zoomRange)Set custom zoom range. UnitsetCameraModule(CameraModule cameraModule)Defines a camera module. final UnitsetPictureSize(Size pictureSize)Set camera picture size final UnitsetPreviewSize(Size previewSize)Set camera preview size UnitsetUiZoomLevel(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, 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, 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, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, 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 androidx.constraintlayout.widget.ConstraintLayout
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, 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, 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, getAccessibilityClassName, 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, onCreateDrawableState, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, 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.ui.camera.ScanbotCameraXView
addView, applyConstraintsFromLayoutParams, checkLayoutParams, fillMetrics, forceLayout, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getDesignInformation, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOptimizationLevel, getViewById, getViewWidget, isRtl, loadLayoutDescription, onLayout, onMeasure, onViewAdded, onViewRemoved, parseLayoutDescription, removeView, requestLayout, resolveMeasuredDimension, resolveSystem, setConstraintSet, setDesignInformation, setId, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOnConstraintsChanged, setOptimizationLevel, setSelfDimensionBehaviour, setState, shouldDelayChildPressedState -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ScanbotCameraXView
ScanbotCameraXView(Context context, AttributeSet attrs)
-
-
Method Detail
-
getSupportedPreviewSizes
final Array<Size> getSupportedPreviewSizes()
-
setSupportedPreviewSizes
final Unit setSupportedPreviewSizes(Array<Size> supportedPreviewSizes)
-
getSupportedPictureSizes
final Array<Size> getSupportedPictureSizes()
-
setSupportedPictureSizes
final Unit setSupportedPictureSizes(Array<Size> supportedPictureSizes)
-
getLifecycleOwner
final LifecycleOwner getLifecycleOwner()
-
setLifecycleOwner
final Unit setLifecycleOwner(LifecycleOwner lifecycleOwner)
-
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.
-
getFinderViewId
Integer getFinderViewId()
-
getAttachedFrameHandler
<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
-
addFrameHandler
Unit addFrameHandler(FrameHandler frameHandler)
Used to add frame handler that will be called on each next frame
-
removeFrameHandler
Unit removeFrameHandler(FrameHandler frameHandler)
Unregisters FrameHandler.
- Parameters:
frameHandler- handler to unregister.
-
setPreviewMode
Unit setPreviewMode(CameraPreviewMode previewMode)
Set the camera preview mode. By default - CameraPreviewMode.FILL_IN.
- Parameters:
previewMode-camera preview mode
-
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.
-
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.
-
removePictureCallback
Unit removePictureCallback(BasePictureCallback pictureCallback)
Removes callback, so it won't receive any further notifications.
- Parameters:
pictureCallback- callback to unregister.
-
setCameraOpenCallback
Unit setCameraOpenCallback(CameraOpenCallback cameraOpenCallback)
Callback which will be invoked when camera will be opened
- Parameters:
cameraOpenCallback- callback
-
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.
-
removeCameraStateCallback
Unit removeCameraStateCallback(CameraStateCallback cameraStateCallback)
Removes callback, so it won't receive any further notifications.
- Parameters:
cameraStateCallback- callback to unregister.
-
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.
-
removeTakePictureCallback
Unit removeTakePictureCallback(CameraTakePictureCallback cameraTakePictureCallback)
Removes callback, so it won't receive any further notifications.
- Parameters:
cameraTakePictureCallback- callback to unregister.
-
setAutoFocusOnTouch
Unit setAutoFocusOnTouch(Boolean autoFocusOnTouch)
- Parameters:
autoFocusOnTouch- iftrue- 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.
-
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-trueto enable flash.
-
lockToPortrait
Unit lockToPortrait(Boolean lockPicture)
Locks camera in portrait mode
- Parameters:
lockPicture- iftrue- 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- iftrue- taken picture will ba locked to the landscape orientation,false- picture orientation depends on the device sensor.
-
unlockOrientation
Unit unlockOrientation()
Unlocks camera orientation
-
usePinchToZoom
Unit usePinchToZoom(Boolean usePinchToZoom)
Enables/disables Pinch-to-Zoom camera functionality
- Parameters:
usePinchToZoom-trueif 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
-
setCameraModule
Unit setCameraModule(CameraModule cameraModule)
Defines a camera module. By default is CameraModule.BACK.
- Parameters:
cameraModule- CameraModule to use.
-
setPictureSize
final Unit setPictureSize(Size pictureSize)
Set camera picture size
-
setPreviewSize
final Unit setPreviewSize(Size previewSize)
Set camera preview size
-
setUiZoomLevel
Unit setUiZoomLevel(Float zoomLevel)
Passes the zoom value to the dependent view
- Parameters:
zoomLevel- the new scale of the UI
-
-
-
-