-
- 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.multipage.MultiPageReviewFragmentInterface,net.gini.android.capture.review.multipage.previews.PreviewFragmentListener
public class MultiPageReviewFragment extends Fragment implements MultiPageReviewFragmentInterface, PreviewFragmentListener, FragmentImplCallback
Component APIWhen you use the Compontent API and have enabled the multi-page feature, the
MultiPageReviewFragmentdisplays the photographed or imported images and allows the user to review them by checking the order, sharpness, quality and orientation of the images. The user can correct the order by dragging the thumbnails of the images and can also correct the orientation by rotating the images.Important:
- A GiniCapture instance is required to use the
MultiPageReviewFragment - Your Activity hosting this Fragment must extend the androidx.appcompat.app.AppCompatActivity and use an AppCompat Theme.
Include the
MultiPageReviewFragmentinto your layout by using the createInstance factory method to create an instance and display it using the androidx.fragment.app.FragmentManager.A MultiPageReviewFragmentListener instance must be available until the
MultiPageReviewFragmentis 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 MultiPageReviewFragmentListener interface or explicitly by setting the listener using setListener.Your Activity is automatically set as the listener in onCreate.
Customizing the Multi-Page Review Screen See the MultiPageReviewActivity for details.
-
-
Method Summary
Modifier and Type Method Description static MultiPageReviewFragmentcreateInstance()voidonCreate(Bundle savedInstanceState)Internal use only. voidshowAlertDialog(@NonNull() String message, @NonNull() String positiveButtonTitle, @NonNull() DialogInterface.OnClickListener positiveButtonClickListener, @Nullable() String negativeButtonTitle, @Nullable() DialogInterface.OnClickListener negativeButtonClickListener, @Nullable() DialogInterface.OnCancelListener cancelListener)ViewonCreateView(@NonNull() LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)voidonResume()voidonPause()voidonDestroy()voidonRetryUpload(@NonNull() ImageDocument document)voidonDeleteDocument(@NonNull() ImageDocument document)voidsetListener(@NonNull() MultiPageReviewFragmentListener listener)Set a listener for multi-page 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, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, 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 MultiPageReviewFragment createInstance()
-
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
View onCreateView(@NonNull() LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onResume
void onResume()
-
onPause
void onPause()
-
onDestroy
void onDestroy()
-
onRetryUpload
void onRetryUpload(@NonNull() ImageDocument document)
-
onDeleteDocument
void onDeleteDocument(@NonNull() ImageDocument document)
-
setListener
void setListener(@NonNull() MultiPageReviewFragmentListener listener)
Set a listener for multi-page 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- MultiPageReviewFragmentListener instance
-
-
-
-