-
- 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.bank.sdk.capture.digitalinvoice.DigitalInvoiceFragmentInterface,net.gini.android.bank.sdk.capture.digitalinvoice.DigitalInvoiceScreenContract.View,net.gini.android.bank.sdk.capture.digitalinvoice.LineItemsAdapterListener,net.gini.android.capture.GiniCaptureBaseView
public class DigitalInvoiceFragment extends Fragment implements DigitalInvoiceScreenContract.View, DigitalInvoiceFragmentInterface, LineItemsAdapterListener
When you use the Component API the
DigitalInvoiceFragmentdisplays the line items extracted from an invoice document and their total price. The user can deselect line items which should not be paid for and also edit the quantity, price or description of each line item. The total price is always updated to include only the selected line items.The returned extractions in the DigitalInvoiceFragmentListener.onPayInvoice() are updated to include the user's midifications:
"amountToPay" is updated to contain the sum of the selected line items' prices,
the line items are updated according to the user's modifications.
Before showing the
DigitalInvoiceFragmentyou should validate the compound extractions using the LineItemsValidator. These extractions are returned in the AnalysisFragmentListener.onExtractionsAvailable() listener method.Include the
DigitalInvoiceFragmentinto your layout by using the DigitalInvoiceFragment.createInstance() factory method to create an instance and display it using the androidx.fragment.app.FragmentManager.A DigitalInvoiceFragmentListener instance must be available before the
DigitalInvoiceFragmentis 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 DigitalInvoiceFragmentListener interface or explicitly by setting the listener using DigitalInvoiceFragment.listener.Your Activity is automatically set as the listener in DigitalInvoiceFragment.onCreate().
See the DigitalInvoiceActivity for details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDigitalInvoiceFragment.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DigitalInvoiceFragment()
-
Method Summary
Modifier and Type Method Description DigitalInvoiceFragmentListenergetListener()Set a listener for digital invoice events. UnitsetListener(DigitalInvoiceFragmentListener listener)Set a listener for digital invoice events. CoroutineScopegetViewLifecycleScope()LifecyclegetLifecycle()ViewModelStoregetViewModelStore()CreationExtrasgetDefaultViewModelCreationExtras()ViewModelProvider.FactorygetDefaultViewModelProviderFactory()final SavedStateRegistrygetSavedStateRegistry()UnitonSaveInstanceState(Bundle outState)UnitpayButtonClicked()UnitskipButtonClicked()UnitaddNewArticle()UnitremoveLineItem(SelectableLineItem lineItem)UnitanimateListScroll()header and footer are counted as aprox. UnitupdateFooterDetails(DigitalInvoiceScreenContract.FooterDetails data)UnitupdateLineItem(SelectableLineItem selectableLineItem)Call this method when the modified selectable line item was returned by the LineItemDetailsFragmentListener. -
Methods inherited from class net.gini.android.bank.sdk.capture.digitalinvoice.DigitalInvoiceFragment
callStartTransitionListener, createFragmentContainer, dump, equals, findFragmentByWho, generateActivityResultKey, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getAnimatingAway, getArguments, getChildFragmentManager, getContext, getEnterAnim, getEnterTransition, getEnterTransitionCallback, getExitAnim, getExitTransition, getExitTransitionCallback, getFocusedView, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLoaderManager, getNextTransition, getParentFragment, getParentFragmentManager, getPopDirection, getPopEnterAnim, getPopExitAnim, getPostOnViewCreatedAlpha, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getSharedElementSourceNames, getSharedElementTargetNames, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, hasOptionsMenu, hashCode, initState, isAdded, isDetached, isHidden, isInBackStack, isInLayout, isMenuVisible, isPostponed, isRemoving, isResumed, isStateSaved, isVisible, noteStateNotSaved, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onViewStateRestored, performActivityCreated, performAttach, performConfigurationChanged, performContextItemSelected, performCreate, performCreateOptionsMenu, performCreateView, performDestroy, performDestroyView, performDetach, performGetLayoutInflater, performLowMemory, performMultiWindowModeChanged, performOptionsItemSelected, performOptionsMenuClosed, performPause, performPictureInPictureModeChanged, performPrepareOptionsMenu, performPrimaryNavigationFragmentChanged, performResume, performSaveInstanceState, performStart, performStop, performViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, restoreChildFragmentState, restoreViewState, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setAnimations, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setFocusedView, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setNextTransition, setPopDirection, setPostOnViewCreatedAlpha, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementNames, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getListener
DigitalInvoiceFragmentListener getListener()
Set a listener for digital invoice events.
-
setListener
Unit setListener(DigitalInvoiceFragmentListener listener)
Set a listener for digital invoice events.
-
getViewLifecycleScope
CoroutineScope getViewLifecycleScope()
-
getLifecycle
@NonNull() Lifecycle getLifecycle()
-
getViewModelStore
@NonNull() ViewModelStore getViewModelStore()
-
getDefaultViewModelCreationExtras
@NonNull()@CallSuper() CreationExtras getDefaultViewModelCreationExtras()
-
getDefaultViewModelProviderFactory
@NonNull() ViewModelProvider.Factory getDefaultViewModelProviderFactory()
-
getSavedStateRegistry
@NonNull() final SavedStateRegistry getSavedStateRegistry()
-
onSaveInstanceState
Unit onSaveInstanceState(Bundle outState)
-
payButtonClicked
Unit payButtonClicked()
-
skipButtonClicked
Unit skipButtonClicked()
-
addNewArticle
Unit addNewArticle()
-
removeLineItem
Unit removeLineItem(SelectableLineItem lineItem)
-
animateListScroll
Unit animateListScroll()
header and footer are counted as aprox. 3 items in order to have same time spent on scrolling different size views
-
updateFooterDetails
Unit updateFooterDetails(DigitalInvoiceScreenContract.FooterDetails data)
-
updateLineItem
Unit updateLineItem(SelectableLineItem selectableLineItem)
Call this method when the modified selectable line item was returned by the LineItemDetailsFragmentListener.onSave method.
- Parameters:
selectableLineItem- the SelectableLineItem which was updated in the LineItemDetailsFragment
-
-
-
-