-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.ComponentCallbacks2,android.view.KeyEvent.Callback,android.view.LayoutInflater.Factory,android.view.LayoutInflater.Factory2,android.view.View.OnCreateContextMenuListener,android.view.Window.Callback,androidx.activity.OnBackPressedDispatcherOwner,androidx.activity.contextaware.ContextAware,androidx.activity.result.ActivityResultCaller,androidx.activity.result.ActivityResultRegistryOwner,androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider,androidx.appcompat.app.AppCompatCallback,androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback,androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator,androidx.core.app.TaskStackBuilder.SupportParentable,androidx.core.view.KeyEventDispatcher.Component,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,net.gini.android.capture.review.multipage.MultiPageReviewFragmentListener
public class MultiPageReviewActivity extends AppCompatActivity implements MultiPageReviewFragmentListener
Screen API When you use the Screen API and have enabled the multi-page feature, theMultiPageReviewActivitydisplays 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.If multi-page has been enabled then the
MultiPageReviewActivityis started by the CameraActivity after the user has taken the first photo or imported the first image of a document. For subsequent images the user has to tap on the image stack in the Camera Screen to launch it.Important: A GiniCapture instance is required to use the
Customizing the Multi-Page Review Screen Customizing the look of the Review Screen is done via overriding of app resources.MultiPageReviewActivityThe following items are customizable:
- Page indicator text style: via overriding the style named
GiniCaptureTheme.Review.MultiPage.PageIndicator.TextStyle - Page indicator font: via overriding the style named
GiniCaptureTheme.Review.MultiPage.PageIndicator.TextStyleand setting an item namedgcCustomFontwith the path to the font file in yourassetsfolder - Page indicator background color: via the color resource named
gc_multi_page_review_page_indicator_background - Next button icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gc_review_fab_checkmark.png - Next button color: via the color resources named
gc_review_fabandgc_review_fab_pressed - Thumbnails panel background color: via the color resource named
gc_multi_page_review_thumbnails_panel_background - Thumbnail card background color: via the color resource named
gc_multi_page_review_thumbnail_card_background - Thumbnail badge text style: via overriding the style named
GiniCaptureTheme.Review.MultiPage.ThumbnailBadge.TextStyle - Thumbnail badge font: via overriding the style named
GiniCaptureTheme.Review.MultiPage.ThumbnailBadge.TextStyleand setting an item namedgcCustomFontwith the path to the font file in yourassetsfolder - Thumbnail badge background border color: via the color resource named
gc_multi_page_thumbnail_badge_background_border - Thumbnail drag indicator bumps icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gc_bumps_icon.png - Thumbnail highlight strip color: via the color resource named
gc_multi_page_thumbnail_highlight_strip - Thumbnail activity indicator color: via the color resource named
gc_analysis_activity_indicator - Thumbnail upload success background circle color: via the color resource named
gc_multi_page_thumbnail_upload_success_icon_background - Thumbnail upload success foreground tick color: via the color resource named
gc_multi_page_thumbnail_upload_success_icon_foreground - Thumbnail upload failure background circle color: via the color resource named
gc_multi_page_thumbnail_upload_failure_icon_background - Thumbnail upload failure foreground cross color: via the color resource named
gc_multi_page_thumbnail_upload_failure_icon_foreground - Add page icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gc_multi_page_add_page_icon.png - Add page icon subtitle text: via the string resource named
gc_multi_page_review_add_pages_subtitle - Add page icon subtitle text style: via overriding the style named
GiniCaptureTheme.Review.MultiPage.AddPagesSubtitle.TextStyle - Add page icon subtitle font: via overriding the style named
GiniCaptureTheme.Review.MultiPage.AddPagesSubtitle.TextStyleand setting an item namedgcCustomFontwith the path to the font file in yourassetsfolder - Reorder pages tip text: via the string resource named
gc_multi_page_review_reorder_pages_tip - Reorder pages tip text style: via overriding the style named
GiniCaptureTheme.Review.MultiPage.ReorderPagesTip.TextStyle - Reorder pages tip font: via overriding the style named
GiniCaptureTheme.Review.MultiPage.ReorderPagesTip.TextStyleand setting an item namedgcCustomFontwith the path to the font file in yourassetsfolder - Rotate icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gc_rotate_icon.png - Delete icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gc_delete_icon.png - Image error message text style: via overriding the style named
GiniCaptureTheme.Snackbar.Error.TextStyleand setting an item namedandroid:textStyletonormal,boldoritalic - Image error message font: via overriding the style named
GiniCaptureTheme.Snackbar.Error.TextStyleand setting an item namedgcCustomFontwith the path to the font file in yourassetsfolder - Image error message button text style: via overriding the style named
GiniCaptureTheme.Snackbar.Error.Button.TextStyleand setting an item namedandroid:textStyletonormal,boldoritalic - Image error message button font: via overriding the style named
GiniCaptureTheme.Snackbar.Error.Button.TextStyleand setting an item namedgcCustomFontwith the path to the font file in yourassetsfolder - Image error message background color: via the color resource named
gc_snackbar_error_background - Image analysis error message retry button text: via the string resource named
gc_document_analysis_error_retry - Imported image error message delete button text: via the string resource named
gc_multi_page_review_delete_invalid_document - Imported image delete last page dialog message: via the string resource named
gc_multi_page_review_file_import_delete_last_page_dialog_message - Imported image delete last page dialog positive button text: via the string resource named
gc_multi_page_review_file_import_delete_last_page_dialog_positive_button - Imported image delete last page dialog negative button text: via the string resource named
gc_multi_page_review_file_import_delete_last_page_dialog_negative_button - Imported image delete last page dialog button color: via the color resource named
gc_accent
Important: All overridden styles must have their respective
Customizing the Action Bar Customizing the Action Bar is also done via overriding of app resources and each one - except the title string resource - is global to all Activities (CameraActivity, , ReviewActivity, MultiPageReviewActivity, ).Root.prefixed style as their parent. Ex.: the parent ofGiniCaptureTheme.Review.BottomPanel.TextStylemust beRoot.GiniCaptureTheme.Review.BottomPanel.TextStyle.The following items are customizable:
- Background color: via the color resource named
gc_action_bar(highly recommended for Android 5+: customize the status bar color viagc_status_bar) - Title: via the string resource named
gc_title_multi_page_review - Title color: via the color resource named
gc_action_bar_title - Back button (only for ReviewActivity, MultiPageReviewActivity and ): via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named
gc_action_bar_back
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringEXTRA_OUT_ERRORpublic final static intRESULT_ERROR
-
Method Summary
Modifier and Type Method Description static IntentcreateIntent(@NonNull() Context context)booleanonOptionsItemSelected(MenuItem item)voidonBackPressed()voidonProceedToAnalysisScreen(@NonNull() GiniCaptureMultiPageDocument multiPageDocument)Called when all pages were uploaded successfully and the user tapped on the "next" button. voidonReturnToCameraScreen()Called when the user wants to add a picture of another page. voidonImportedDocumentReviewCancelled()Called when the user deleted all the pages of a document received from another app. voidonError(@NonNull() GiniCaptureError error)Called when an error occurred. -
Methods inherited from class androidx.appcompat.app.AppCompatActivity
addContentView, closeOptionsMenu, dispatchKeyEvent, findViewById, getDelegate, getDrawerToggleDelegate, getMenuInflater, getResources, getSupportActionBar, getSupportParentActivityIntent, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreateSupportNavigateUpTaskStack, onKeyDown, onMenuItemSelected, onMenuOpened, onPanelClosed, onPrepareSupportNavigateUpTaskStack, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onWindowStartingSupportActionMode, openOptionsMenu, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, setTheme, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask -
Methods inherited from class androidx.fragment.app.FragmentActivity
dump, getSupportFragmentManager, getSupportLoaderManager, onAttachFragment, onCreatePanelMenu, onCreateView, onLowMemory, onMultiWindowModeChanged, onPictureInPictureModeChanged, onPreparePanel, onRequestPermissionsResult, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startIntentSenderFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition, validateRequestPermissionsRequestCode -
Methods inherited from class androidx.activity.ComponentActivity
addOnContextAvailableListener, getActivityResultRegistry, getDefaultViewModelProviderFactory, getLastCustomNonConfigurationInstance, getLifecycle, getOnBackPressedDispatcher, getSavedStateRegistry, getViewModelStore, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, peekAvailableContext, registerForActivityResult, removeOnContextAvailableListener, reportFullyDrawn, startActivityForResult, startIntentSenderForResult -
Methods inherited from class androidx.core.app.ComponentActivity
dispatchKeyShortcutEvent, getExtraData, putExtraData, superDispatchKeyEvent -
Methods inherited from class android.app.Activity
closeContextMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, enterPictureInPictureMode, enterPictureInPictureMode, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSplashScreen, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLaunchedFromBubble, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onAttachedToWindow, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelView, onCreateThumbnail, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onGetDirectActions, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onNavigateUp, onNavigateUpFromChild, onOptionsMenuClosed, onPerformDirectAction, onPictureInPictureRequested, onPictureInPictureUiStateChanged, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onSearchRequested, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, overridePendingTransition, postponeEnterTransition, recreate, registerActivityLifecycleCallbacks, registerForContextMenu, releaseInstance, removeDialog, requestDragAndDropPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, requireViewById, runOnUiThread, setActionBar, setContentTransitionManager, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setInheritShowWhenLocked, setIntent, setLocusContext, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setSecondaryProgress, setShowWhenLocked, setTaskDescription, setTitle, setTitleColor, setTranslucent, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActivities, startActivity, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterActivityLifecycleCallbacks, unregisterForContextMenu -
Methods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, getAssets, getTheme -
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingOrSelfUriPermissions, checkCallingPermission, checkCallingUriPermission, checkCallingUriPermissions, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermissions, clearWallpaper, createAttributionContext, createConfigurationContext, createContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAttributionSource, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getParams, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, isUiContext, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, startForegroundService, startInstrumentation, startService, stopService, unbindService, unregisterReceiver, updateServiceGroup -
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, registerComponentCallbacks, sendBroadcastWithMultiplePermissions, unregisterComponentCallbacks -
Methods inherited from class android.view.Window.Callback
onPointerCaptureChanged -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
createIntent
static Intent createIntent(@NonNull() Context context)
-
onOptionsItemSelected
boolean onOptionsItemSelected(MenuItem item)
-
onBackPressed
void onBackPressed()
-
onProceedToAnalysisScreen
void onProceedToAnalysisScreen(@NonNull() GiniCaptureMultiPageDocument multiPageDocument)
Called when all pages were uploaded successfully and the user tapped on the "next" button.
If you use the Screen API you should start the AnalysisActivity and set the document as the EXTRA_IN_DOCUMENT extra.
If you use the Component API you should start the AnalysisFragmentCompat and pass the document when creating it with createInstance.
-
onReturnToCameraScreen
void onReturnToCameraScreen()
Called when the user wants to add a picture of another page. Also called when the user has deleted every page and the document consisted of images taken with the Camera Screen or imported using the Camera Screen.
If you host the MultiPageReviewFragment in its own Activity, then you should simply finish the Activity.
If you use one Activity to host all the Gini Capture fragments, then you should display the CameraFragmentCompat again.
-
onImportedDocumentReviewCancelled
void onImportedDocumentReviewCancelled()
Called when the user deleted all the pages of a document received from another app. This means the MultiPageReviewFragment was launched after a document had been created using createDocumentForImportedFiles.
At this point you should finish Gini Capture by closing the MultiPageReviewFragment and cleaning up using cleanup.
-
onError
void onError(@NonNull() GiniCaptureError error)
Called when an error occurred.
- Parameters:
error- details about what went wrong
-
-
-
-