CameraFragmentStandard

public class CameraFragmentStandard extends Fragment implements CameraFragmentInterface, FragmentImplCallback
Component API

CameraFragmentStandard is the main entry point to the Gini Vision Library when using the Component API without the Android Support Library.

It shows a camera preview with tap-to-focus functionality, a trigger button and an optional flash on/off button. The camera preview also shows document corner guides to which the user should align the document.

If instantiated with createInstance then a button for importing documents is shown next to the trigger button. A hint popup is displayed the first time the Gini Vision Library is used to inform the user about document importing.

For importing documents READ_EXTERNAL_STORAGE permission is required and if the permission is not granted the Gini Vision Library will prompt the user to grant the permission. See @{code Customizing the Camera Screen} on how to override the message and button titles for the rationale and on permission denial alerts.

Include the CameraFragmentStandard into your layout either directly with <fragment> in your Activity's layout or using the android.app.FragmentManager and one of the createInstance() methods.

A CameraFragmentListener instance must be available until the CameraFragmentStandard is attached to an activity. Failing to do so will throw an exception. The listener instance can be provided either implicitly by making the hosting Activity implement the CameraFragmentListener interface or explicitly by setting the listener using setListener.

Your Activity is automatically set as the listener in onAttach.

Customizing the Camera Screen

See the CameraActivity for details.

Functions

createInstance
Link copied to clipboard
static CameraFragmentStandard createInstance()
static CameraFragmentStandard createInstance(@NonNull() GiniVisionFeatureConfiguration giniVisionFeatureConfiguration)
Factory method for creating a new instance of the Fragment with document import enabled for the specified file types.
dump
Link copied to clipboard
void dump(String prefix, FileDescriptor fd, PrintWriter writer, Array<String> args)
equals
Link copied to clipboard
final boolean equals(Object o)
getActivity
Link copied to clipboard
final Activity getActivity()
abstract Activity getActivity()
getAllowEnterTransitionOverlap
Link copied to clipboard
boolean getAllowEnterTransitionOverlap()
getAllowReturnTransitionOverlap
Link copied to clipboard
boolean getAllowReturnTransitionOverlap()
getArguments
Link copied to clipboard
final Bundle getArguments()
getChildFragmentManager
Link copied to clipboard
final FragmentManager getChildFragmentManager()
getContext
Link copied to clipboard
Context getContext()
getEnterTransition
Link copied to clipboard
Transition getEnterTransition()
getExitTransition
Link copied to clipboard
Transition getExitTransition()
getFragmentManager
Link copied to clipboard
final FragmentManager getFragmentManager()
getHost
Link copied to clipboard
final Object getHost()
getId
Link copied to clipboard
final int getId()
getLayoutInflater
Link copied to clipboard
final LayoutInflater getLayoutInflater()
getLoaderManager
Link copied to clipboard
LoaderManager getLoaderManager()
getParentFragment
Link copied to clipboard
final Fragment getParentFragment()
getReenterTransition
Link copied to clipboard
Transition getReenterTransition()
getResources
Link copied to clipboard
final Resources getResources()
getRetainInstance
Link copied to clipboard
final boolean getRetainInstance()
getReturnTransition
Link copied to clipboard
Transition getReturnTransition()
getSharedElementEnterTransition
Link copied to clipboard
Transition getSharedElementEnterTransition()
getSharedElementReturnTransition
Link copied to clipboard
Transition getSharedElementReturnTransition()
getString
Link copied to clipboard
final String getString(int resId)
getTag
Link copied to clipboard
final String getTag()
getTargetFragment
Link copied to clipboard
final Fragment getTargetFragment()
getTargetRequestCode
Link copied to clipboard
final int getTargetRequestCode()
getText
Link copied to clipboard
final CharSequence getText(int resId)
getUserVisibleHint
Link copied to clipboard
boolean getUserVisibleHint()
getView
Link copied to clipboard
View getView()
abstract View getView()
hashCode
Link copied to clipboard
final int hashCode()
void hideActivityIndicatorAndEnableInteraction()
Call this method to hide the activity indicator and enable user interaction.
hideCameraTriggerButton
Link copied to clipboard
void hideCameraTriggerButton()
Call this method to hide the camera trigger button.
hideDocumentCornerGuides
Link copied to clipboard
void hideDocumentCornerGuides()
Call this method to hide the document corner guides.
hideInterface
Link copied to clipboard
void hideInterface()
Call this method to hide the interface elements.
instantiate
Link copied to clipboard
static Fragment instantiate(Context context, String fname)
isAdded
Link copied to clipboard
final boolean isAdded()
isDetached
Link copied to clipboard
final boolean isDetached()
isHidden
Link copied to clipboard
final boolean isHidden()
isInLayout
Link copied to clipboard
final boolean isInLayout()
isRemoving
Link copied to clipboard
final boolean isRemoving()
isResumed
Link copied to clipboard
final boolean isResumed()
isStateSaved
Link copied to clipboard
final boolean isStateSaved()
isVisible
Link copied to clipboard
final boolean isVisible()
onActivityCreated
Link copied to clipboard
void onActivityCreated(Bundle savedInstanceState)
onActivityResult
Link copied to clipboard
void onActivityResult(int requestCode, int resultCode, Intent data)
onAttach
Link copied to clipboard
void onAttach(Activity activity)
void onAttach(Context context)
Internal use only.
onAttachFragment
Link copied to clipboard
void onAttachFragment(Fragment childFragment)
onConfigurationChanged
Link copied to clipboard
void onConfigurationChanged(Configuration newConfig)
onContextItemSelected
Link copied to clipboard
boolean onContextItemSelected(MenuItem item)
onCreate
Link copied to clipboard
void onCreate(Bundle savedInstanceState)
Internal use only.
onCreateAnimator
Link copied to clipboard
Animator onCreateAnimator(int transit, boolean enter, int nextAnim)
onCreateContextMenu
Link copied to clipboard
void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
onCreateOptionsMenu
Link copied to clipboard
void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
onCreateView
Link copied to clipboard
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Internal use only.
onDestroy
Link copied to clipboard
void onDestroy()
Internal use only.
onDestroyOptionsMenu
Link copied to clipboard
void onDestroyOptionsMenu()
onDestroyView
Link copied to clipboard
void onDestroyView()
onDetach
Link copied to clipboard
void onDetach()
onGetLayoutInflater
Link copied to clipboard
LayoutInflater onGetLayoutInflater(Bundle savedInstanceState)
onHiddenChanged
Link copied to clipboard
void onHiddenChanged(boolean hidden)
onInflate
Link copied to clipboard
void onInflate(AttributeSet attrs, Bundle savedInstanceState)
onLowMemory
Link copied to clipboard
void onLowMemory()
onMultiWindowModeChanged
Link copied to clipboard
void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig)
onOptionsItemSelected
Link copied to clipboard
boolean onOptionsItemSelected(MenuItem item)
onOptionsMenuClosed
Link copied to clipboard
void onOptionsMenuClosed(Menu menu)
onPause
Link copied to clipboard
void onPause()
onPictureInPictureModeChanged
Link copied to clipboard
void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, Configuration newConfig)
onPrepareOptionsMenu
Link copied to clipboard
void onPrepareOptionsMenu(Menu menu)
onRequestPermissionsResult
Link copied to clipboard
void onRequestPermissionsResult(int requestCode, Array<String> permissions, Array<int> grantResults)
onResume
Link copied to clipboard
void onResume()
Internal use only.
onSaveInstanceState
Link copied to clipboard
void onSaveInstanceState(@NonNull() Bundle outState)
Internal use only.
onStart
Link copied to clipboard
void onStart()
Internal use only.
onStop
Link copied to clipboard
void onStop()
Internal use only.
onTrimMemory
Link copied to clipboard
void onTrimMemory(int level)
onViewCreated
Link copied to clipboard
void onViewCreated(View view, Bundle savedInstanceState)
onViewStateRestored
Link copied to clipboard
void onViewStateRestored(Bundle savedInstanceState)
postponeEnterTransition
Link copied to clipboard
void postponeEnterTransition()
registerForContextMenu
Link copied to clipboard
void registerForContextMenu(View view)
requestPermissions
Link copied to clipboard
final void requestPermissions(Array<String> permissions, int requestCode)
setAllowEnterTransitionOverlap
Link copied to clipboard
void setAllowEnterTransitionOverlap(boolean allow)
setAllowReturnTransitionOverlap
Link copied to clipboard
void setAllowReturnTransitionOverlap(boolean allow)
setArguments
Link copied to clipboard
void setArguments(Bundle args)
setEnterSharedElementCallback
Link copied to clipboard
void setEnterSharedElementCallback(SharedElementCallback callback)
setEnterTransition
Link copied to clipboard
void setEnterTransition(Transition transition)
setExitSharedElementCallback
Link copied to clipboard
void setExitSharedElementCallback(SharedElementCallback callback)
setExitTransition
Link copied to clipboard
void setExitTransition(Transition transition)
setHasOptionsMenu
Link copied to clipboard
void setHasOptionsMenu(boolean hasMenu)
setInitialSavedState
Link copied to clipboard
void setInitialSavedState(Fragment.SavedState state)
setListener
Link copied to clipboard
void setListener(@NonNull() CameraFragmentListener listener)
Set a listener for camera events.
setMenuVisibility
Link copied to clipboard
void setMenuVisibility(boolean menuVisible)
setReenterTransition
Link copied to clipboard
void setReenterTransition(Transition transition)
setRetainInstance
Link copied to clipboard
void setRetainInstance(boolean retain)
setReturnTransition
Link copied to clipboard
void setReturnTransition(Transition transition)
setSharedElementEnterTransition
Link copied to clipboard
void setSharedElementEnterTransition(Transition transition)
setSharedElementReturnTransition
Link copied to clipboard
void setSharedElementReturnTransition(Transition transition)
setTargetFragment
Link copied to clipboard
void setTargetFragment(Fragment fragment, int requestCode)
setUserVisibleHint
Link copied to clipboard
void setUserVisibleHint(boolean isVisibleToUser)
shouldShowRequestPermissionRationale
Link copied to clipboard
boolean shouldShowRequestPermissionRationale(String permission)
void showActivityIndicatorAndDisableInteraction()
Call this method to show an activity indicator and disable user interaction.
showAlertDialog
Link copied to clipboard
void showAlertDialog(@NonNull() String message, @NonNull() String positiveButtonTitle, @NonNull() DialogInterface.OnClickListener positiveButtonClickListener, @Nullable() String negativeButtonTitle, @Nullable() DialogInterface.OnClickListener negativeButtonClickListener, @Nullable() DialogInterface.OnCancelListener cancelListener)
showCameraTriggerButton
Link copied to clipboard
void showCameraTriggerButton()
Call this method to show the camera trigger button.
showDocumentCornerGuides
Link copied to clipboard
void showDocumentCornerGuides()
Call this method to show the document corner guides.
showError
Link copied to clipboard
void showError(@NonNull() String message, int duration)
Call this method to show an error message to the user in the Camera Screen.
showInterface
Link copied to clipboard
void showInterface()
Call this method to show the interface elements.
startActivity
Link copied to clipboard
void startActivity(Intent intent)
abstract void startActivity(Intent intent)
startActivityForResult
Link copied to clipboard
void startActivityForResult(Intent intent, int requestCode)
abstract void startActivityForResult(Intent intent, int requestCode)
startIntentSenderForResult
Link copied to clipboard
void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
startPostponedEnterTransition
Link copied to clipboard
void startPostponedEnterTransition()
toString
Link copied to clipboard
String toString()
unregisterForContextMenu
Link copied to clipboard
void unregisterForContextMenu(View view)