public abstract class CameraPreviewCutoutFragment
extends com.yoti.mobile.android.camera.ui.CameraPreviewFragment
Superclass for fragments which display camera in a portrait circle UI (scan and face).
Subclasses implementing this view need only implement createPresenter() to generate a
presenter implementation to handle camera frames. Other important methods subclasses may override
are CameraPreviewFragment.onCameraPreviewReady(), if the presenter needs extra setup for camera size and
createCameraOverlay(android.view.LayoutInflater, android.view.ViewGroup), if the fragment is displaying extra UI elements, such as a capture
button.
| Modifier and Type | Field and Description |
|---|---|
static int |
TEXT_ID_EMPTY
Resource id for empty text
|
| Constructor and Description |
|---|
CameraPreviewCutoutFragment(boolean preferFrontCamera) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createCameraOverlay(android.view.LayoutInflater inflater,
android.view.ViewGroup rootView)
Inflate any UI components which your view should add to the camera.
|
protected abstract CameraViewPresenter |
createPresenter() |
protected android.view.ViewGroup |
getCameraViewContainer() |
void |
hideFocusArea() |
void |
onCameraOpenFailed(java.lang.Throwable throwable) |
void |
onCreate(android.os.Bundle savedInstanceState) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onDestroy() |
protected abstract void |
onHideScanningInstructionsButtonClick() |
void |
onPause() |
protected void |
onPreviewFrame(byte[] data) |
void |
onResume() |
void |
restart()
Can to restart continuous preview mode and take another picture.
|
protected void |
setScanningInstructionsMessage(int textId) |
void |
setStatusText(int textId) |
void |
showFailureFeedback(int feedbackText)
Show Fail feedback with message, typically used by Activities to update this fragment.
|
void |
showFocusArea() |
protected void |
showNoFeedback()
Remove feedback previously shown from
showFailureFeedback(int) |
void |
showStaticFrameImage(com.yoti.mobile.android.core.yuvtools.YuvBuffer staticFrame) |
protected void |
updateOverlayForCameraFailed()
Replacement for
onCameraOpenFailed(Throwable) which will only be called after
overlay has been generated (so don't need to handle uninitialised views). |
disableContinuousAutoFocus, generateHapticFeedback, getNumCameraBuffers, initCamera, isContinuousAutoFocus, onCameraOpen, onCameraPreviewCreated, onCameraPreviewReady, releaseCamera, releaseCameraBuffer, setLowResPreview, shouldDisableAutomaticCameraStartStop, updateFocusAreadump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, onViewCreated, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu@StringRes public static final int TEXT_ID_EMPTY
public CameraPreviewCutoutFragment(boolean preferFrontCamera)
protected abstract CameraViewPresenter createPresenter()
protected abstract void onHideScanningInstructionsButtonClick()
public void onCreate(android.os.Bundle savedInstanceState)
onCreate in class androidx.fragment.app.Fragmentpublic void onPause()
onPause in class com.yoti.mobile.android.camera.ui.CameraPreviewFragmentpublic void onResume()
onResume in class com.yoti.mobile.android.camera.ui.CameraPreviewFragmentpublic void onDestroy()
onDestroy in class androidx.fragment.app.Fragmentpublic android.view.View onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
onCreateView in class androidx.fragment.app.Fragmentpublic void showFocusArea()
public void hideFocusArea()
public final void onCameraOpenFailed(java.lang.Throwable throwable)
onCameraOpenFailed in interface com.yoti.mobile.android.camera.OnCameraOpenListeneronCameraOpenFailed in class com.yoti.mobile.android.camera.ui.CameraPreviewFragmentprotected void createCameraOverlay(android.view.LayoutInflater inflater,
android.view.ViewGroup rootView)
@NonNull protected android.view.ViewGroup getCameraViewContainer()
getCameraViewContainer in class com.yoti.mobile.android.camera.ui.CameraPreviewFragmentprotected void onPreviewFrame(byte[] data)
onPreviewFrame in class com.yoti.mobile.android.camera.ui.CameraPreviewFragmentpublic void showFailureFeedback(@StringRes
int feedbackText)
feedbackText - text to show, or TEXT_ID_EMPTYprotected void showNoFeedback()
showFailureFeedback(int)protected void setScanningInstructionsMessage(@StringRes
int textId)
public void setStatusText(int textId)
public void showStaticFrameImage(com.yoti.mobile.android.core.yuvtools.YuvBuffer staticFrame)
public void restart()
protected void updateOverlayForCameraFailed()
onCameraOpenFailed(Throwable) which will only be called after
overlay has been generated (so don't need to handle uninitialised views).