-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,net.gini.android.capture.internal.ui.FragmentImplCallback,net.gini.android.capture.review.ReviewFragmentInterface
public class ReviewFragmentCompat extends Fragment implements FragmentImplCallback, ReviewFragmentInterface
Component APIWhen you use the Compontent API with the Android Support Library, the
ReviewFragmentCompatdisplays the photographed or imported image and allows the user to review it by checking the sharpness, quality and orientation of the image. The user can correct the orientation by rotating the image.Note: Your Activity hosting this Fragment must extend the and use an AppCompat Theme.
Include the
ReviewFragmentCompatinto your layout by using the createInstance factory method to create an instance and display it using the androidx.fragment.app.FragmentManager.A ReviewFragmentListener instance must be available until the
ReviewFragmentCompatis 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 ReviewFragmentListener interface or explicitly by setting the listener using setListener.Your Activity is automatically set as the listener in onCreate.
Customizing the Review Screen See the ReviewActivity for details.
-
-
Method Summary
Modifier and Type Method Description static ReviewFragmentCompatcreateInstance(@NonNull() Document document)Factory method for creating a new instance of the Fragment using the provided document. voidshowAlertDialog(@NonNull() String message, @NonNull() String positiveButtonTitle, @NonNull() DialogInterface.OnClickListener positiveButtonClickListener, @Nullable() String negativeButtonTitle, @Nullable() DialogInterface.OnClickListener negativeButtonClickListener, @Nullable() DialogInterface.OnCancelListener cancelListener)voidonCreate(Bundle savedInstanceState)Internal use only. ViewonCreateView(LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)Internal use only. voidonStart()Internal use only. voidonStop()Internal use only. voidonSaveInstanceState(Bundle outState)voidonDestroy()Internal use only. voidsetListener(@NonNull() ReviewFragmentListener listener)Set a listener for review events. -
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onViewCreated, onViewStateRestored, postponeEnterTransition, registerForActivityResult, 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, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu -
Methods inherited from class net.gini.android.capture.internal.ui.FragmentImplCallback
getActivity, getView, startActivity, startActivityForResult -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
createInstance
static ReviewFragmentCompat createInstance(@NonNull() Document document)
Factory method for creating a new instance of the Fragment using the provided document.
Note: Always use this method to create new instances. Document is required and an exception is thrown if it's missing.
- Parameters:
document- must be the Document from onDocumentAvailable
-
showAlertDialog
void showAlertDialog(@NonNull() String message, @NonNull() String positiveButtonTitle, @NonNull() DialogInterface.OnClickListener positiveButtonClickListener, @Nullable() String negativeButtonTitle, @Nullable() DialogInterface.OnClickListener negativeButtonClickListener, @Nullable() DialogInterface.OnCancelListener cancelListener)
-
onCreateView
@Nullable() View onCreateView(LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)
Internal use only.
-
onStart
void onStart()
Internal use only.
-
onStop
void onStop()
Internal use only.
-
onSaveInstanceState
void onSaveInstanceState(Bundle outState)
-
onDestroy
void onDestroy()
Internal use only.
-
setListener
void setListener(@NonNull() ReviewFragmentListener listener)
Set a listener for review events.
By default the hosting Activity is expected to implement the . In case that is not feasible you may set the listener using this method.
Note: the listener is expected to be available until the fragment is attached to an activity. Make sure to set the listener before that.
- Parameters:
listener- ReviewFragmentListener instance
-
-
-
-