Package 

Class OnboardingActivity

  • 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.OnMultiWindowModeChangedProvider , androidx.core.app.OnNewIntentProvider , androidx.core.app.OnPictureInPictureModeChangedProvider , androidx.core.app.TaskStackBuilder.SupportParentable , androidx.core.content.OnConfigurationChangedProvider , androidx.core.content.OnTrimMemoryProvider , androidx.core.view.KeyEventDispatcher.Component , androidx.core.view.MenuHost , androidx.lifecycle.HasDefaultViewModelProviderFactory , androidx.lifecycle.LifecycleOwner , androidx.lifecycle.ViewModelStoreOwner , androidx.savedstate.SavedStateRegistryOwner , net.gini.android.capture.onboarding.OnboardingFragmentListener

    
    public class OnboardingActivity
    extends AppCompatActivity implements OnboardingFragmentListener
                        

    When you use the Screen API, the OnboardingActivity displays important advice for correctly photographing a document.

    The OnboardingActivity is started by the CameraActivity when the latter is launched for the first time. You may disable this behavior - we highly recommend keeping it - by passing false to setShouldShowOnboardingAtFirstRun when creating a GiniCapture instance.

    You can change the number of displayed pages and their content (image and short text) by setting an ArrayList containing OnboardingPage objects when building a instance with setCustomOnboardingPages.

    Customizing the look of the Onboarding Screen is done via overriding of app resources or by providing your own pages with your own strings and drawable resources.

    The following items are customizable:

    • Next button icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gc_onboarding_fab_next.png
    • Next button color: via the color resources named gc_onboarding_fab and gc_onboarding_fab_pressed
    • Page indicators: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gc_onboarding_indicator_active.png and gc_onboarding_indicator_inactive.png
    • Onboarding message color: via the color resource named gc_onboarding_message
    • Onboarding message font: via overriding the style named GiniCaptureTheme.Onboarding.Message.TextStyle and setting an item named gcCustomFont with the path to the font file in your assets folder
    • Onboarding message text style: via overriding the style named GiniCaptureTheme.Onboarding.Message.TextStyle and setting an item named android:textStyle to normal, bold or italic
    • Onboarding message text size: via overriding the style named GiniCaptureTheme.Onboarding.Message.TextStyle and setting an item named android:textSize to the desired sp size
    • Tablet Onboarding Pages:
      • First page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named gc_onboarding_lighting.png
      • First page text: via the string resource named gc_onboarding_ligthing
      • Second page image via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named gc_onboarding_flat.png
      • Second page text: via the string resource named gc_onboarding_flat
      • Third page image: via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named gc_onboarding_parallel.png
      • Third page text: via the string resource named gc_onboarding_parallel
      • Fourth page image: via images for sw600dp-mdpi, sw600dp-hdpi, sw600dp-xhdpi, sw600dp-xxhdpi, sw600dp-xxxhdpi named gc_onboarding_align.png
      • Fourth page text: via the string resource named gc_onboarding_align
    • Phone Onboarding Pages:
      • First page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gc_onboarding_flat.png
      • First page text: via the string resource named gc_onboarding_flat
      • Second page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gc_onboarding_parallel.png
      • Second page text: via the string resource named gc_onboarding_parallel
      • Third page image: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gc_onboarding_align.png
      • Third page text: via the string resource named gc_onboarding_align
    • Background transparency: via the string resource named gc_onboarding_page_fragment_background_alpha which must contain a real number between [0,1].
    • Background color: via the color resource named gc_background. Note: this color resource is global to all Activities (CameraActivity, , ReviewActivity, AnalysisActivity)

    Important: All overriden styles must have their respective Root. prefixed style as their parent. Ex.: the parent of GiniCaptureTheme.Onboarding.Message.TextStyle must be Root.GiniCaptureTheme.Onboarding.Message.TextStyle.

    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, AnalysisActivity).

    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 via gc_status_bar)
    • Title: via the string resource named gc_title_onboarding
    • Title color: via the color resource named gc_action_bar_title
    • Back button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named gc_action_bar_back
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean onOptionsItemSelected(MenuItem item)
      void onCloseOnboarding() Called when the user has left the last page - either by swiping or tapping on the Next button - and you should close the Onboarding Fragment.
      void onError(@NonNull() GiniCaptureError giniCaptureError) 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, onCreateView, onRequestPermissionsResult, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startIntentSenderFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition, validateRequestPermissionsRequestCode
      • Methods inherited from class androidx.activity.ComponentActivity

        addMenuProvider, addOnConfigurationChangedListener, addOnContextAvailableListener, addOnMultiWindowModeChangedListener, addOnNewIntentListener, addOnPictureInPictureModeChangedListener, addOnTrimMemoryListener, getActivityResultRegistry, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getLastCustomNonConfigurationInstance, getLifecycle, getOnBackPressedDispatcher, getSavedStateRegistry, getViewModelStore, invalidateMenu, onBackPressed, onCreatePanelMenu, onMultiWindowModeChanged, onPictureInPictureModeChanged, onPreparePanel, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, onTrimMemory, peekAvailableContext, registerForActivityResult, removeMenuProvider, removeOnConfigurationChangedListener, removeOnContextAvailableListener, removeOnMultiWindowModeChangedListener, removeOnNewIntentListener, removeOnPictureInPictureModeChangedListener, removeOnTrimMemoryListener, 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, getOnBackInvokedDispatcher, 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, onLowMemory, onNavigateUp, onNavigateUpFromChild, onOptionsMenuClosed, onPerformDirectAction, onPictureInPictureRequested, onPictureInPictureUiStateChanged, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onSearchRequested, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, overridePendingTransition, postponeEnterTransition, recreate, registerActivityLifecycleCallbacks, registerComponentCallbacks, 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, setRecentsScreenshotEnabled, setRequestedOrientation, setResult, setSecondaryProgress, setShouldDockBigOverlays, setShowWhenLocked, setTaskDescription, setTitle, setTitleColor, setTranslucent, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldDockBigOverlays, 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, unregisterComponentCallbacks, unregisterForContextMenu
      • Methods inherited from class android.view.ContextThemeWrapper

        applyOverrideConfiguration, getAssets, getTheme
      • Methods inherited from class android.view.Window.Callback

        onPointerCaptureChanged
      • 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, revokeSelfPermissionsOnKill, 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, revokeSelfPermissionOnKill, sendBroadcastWithMultiplePermissions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait