AnalysisFragmentStandard

Component API

When you use the Component API without the Android Support Library, the {@code AnalyzeDocumentFragmentStandard} displays the captured or imported document and an activity indicator while the document is being analyzed by the Gini API.

Note: You can use the activity indicator message to display a message under the activity indicator by overriding the string resource named {@code gv_analysis_activity_indicator_message} . The message is displayed for images only.

For PDF documents the first page is shown (only on Android 5.0 Lollipop and newer) along with the PDF's filename and number of pages above the page. On Android KitKat and older only the PDF's filename is shown with the preview area left empty.

Include the {@code AnalyzeDocumentFragmentStandard} into your layout by using the createInstance factory method to create an instance and display it using the android.app.FragmentManager .

An AnalysisFragmentListener instance must be available until the {@code AnalysisFragmentStandard} 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 AnalysisFragmentListener interface or explicitly by setting the listener using setListener .

Your Activity is automatically set as the listener in onCreate .

Customizing the Analysis Screen

See the AnalysisActivity for details.

public class AnalysisFragmentStandard extends Fragment implements FragmentImplCallback, AnalysisFragmentInterface

Functions

createInstance
Link copied to clipboard

Factory method for creating a new instance of the Fragment using the provided document.

You may pass in an optional analysis error message. This error message is shown to the user with a retry button.

Note: Always use this method to create new instances. Document is required and an exception is thrown if it's missing.

dump
Link copied to clipboard
void dump(String prefix, FileDescriptor fd, PrintWriter writer, Array<Stringargs)
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()
hideError
Link copied to clipboard

Call this method to hide the error shown before with showError or showError .

void hideError()
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(Context context)
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.

void onCreate(Bundle savedInstanceState)
onCreateAnimator
Link copied to clipboard
Animator onCreateAnimator(int transit, boolean enter, int nextAnim)
onCreateContextMenu
Link copied to clipboard
onCreateOptionsMenu
Link copied to clipboard
void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
onCreateView
Link copied to clipboard
onDestroy
Link copied to clipboard
void onDestroy()

Internal use only.

void onDestroy()
onDestroyOptionsMenu
Link copied to clipboard
void onDestroyOptionsMenu()
onDestroyView
Link copied to clipboard
void onDestroyView()
onDetach
Link copied to clipboard
void onDetach()
onDocumentAnalyzed
Link copied to clipboard

You should call this method after you've received the analysis results from the Gini API.

void onDocumentAnalyzed()
onGetLayoutInflater
Link copied to clipboard
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)
onNoExtractionsFound
Link copied to clipboard

You should call this method after you've received the analysis results from the Gini API without the required extractions.

void onNoExtractionsFound()
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
onPrepareOptionsMenu
Link copied to clipboard
void onPrepareOptionsMenu(Menu menu)
onRequestPermissionsResult
Link copied to clipboard
void onRequestPermissionsResult(int requestCode, Array<Stringpermissions, Array<int> grantResults)
onResume
Link copied to clipboard
void onResume()
onSaveInstanceState
Link copied to clipboard
void onSaveInstanceState(Bundle outState)
onStart
Link copied to clipboard
void onStart()

Internal use only.

void onStart()
onStop
Link copied to clipboard
void onStop()

Internal use only.

void onStop()
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<Stringpermissions, 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
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

Set a listener for analysis events.

By default the hosting Activity is expected to implement the AnalysisFragmentListener . 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.

void setListener(AnalysisFragmentListener listener)
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)
showError
Link copied to clipboard

Call this method when you need to show an error message to the user in the Analysis Screen.

abstract void showError(String message, int duration)
void showError(String message, int duration)

Call this method when you need to show an error message with an invokable action to the user in the Analysis Screen.

abstract void showError(String message, String buttonTitle, View.OnClickListener onClickListener)
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
startPostponedEnterTransition
Link copied to clipboard
void startPostponedEnterTransition()
startScanAnimation
Link copied to clipboard

You should call this method when you start the document analysis using the Gini API.

void startScanAnimation()
stopScanAnimation
Link copied to clipboard

You should call this method when the document analysis has finished.

void stopScanAnimation()
toString
Link copied to clipboard
String toString()
unregisterForContextMenu
Link copied to clipboard
void unregisterForContextMenu(View view)