Class SubmitReceiptFragment<V extends SubmitReceiptView,​P extends SubmitReceiptPresenter<V>>

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner, com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen, SubmitReceiptView, com.cheetahdigital.uikit.architecture.mvp.MvpView

    public class SubmitReceiptFragment<V extends SubmitReceiptView,​P extends SubmitReceiptPresenter<V>>
    extends com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V,​P>
    implements SubmitReceiptView, android.view.View.OnClickListener
    Extends the MvpFragmentView with SubmitReceiptView as the View and the SubmitReceiptPresenter as the presenter

    This fragment calls the camera or gallery functions of the phone so that users can submit an image of a receipt Can receive the following intent extras:

    • Nested Class Summary

      • Nested classes/interfaces inherited from class androidx.fragment.app.Fragment

        androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected P createPresenter()
      Instantiate MvpFragmentView.mPresenter to be used for this MvpActivityView
      protected int getContentLayoutId()
      Provide the Content Layout ID which is of a Layout Resource Reference of Android
      android.view.View.OnClickListener getImageViewClickListener()  
      int getScreenName()  
      android.view.View.OnClickListener getSubmitButtonClicked()  
      void onActivityCreated​(android.os.Bundle savedInstanceState)  
      void onActivityResult​(int requestCode, int resultCode, android.content.Intent data)  
      void onClick​(android.view.View v)  
      android.view.View onCreateView​(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)  
      protected void onPhotoTapped()
      Choose a photo from the device
      void onSaveInstanceState​(android.os.Bundle outState)  
      protected void onSubmitButtonClicked()
      This submits a file receipt to the API
      void setImageViewClickListener​(android.view.View.OnClickListener onImageViewClickListener)  
      void setSubmitButtonClicked​(android.view.View.OnClickListener onSubmitButtonClicked)  
      void showError​(java.lang.String error)
      This notifies the view when the API call returns an error
      void showReceiptSuccessfulDialog​(Receipt receipt)
      This notifies the view when the submission of the receipt to the API returns a successful response
      • Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView

        captureSharedElementValues, getPresenter, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onAttach, onDestroyView, onViewCreated, startActivity, startActivityForResult
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onStart, onStop, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, 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 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SELECT_PICTURE_REQUEST_CODE

        public static int SELECT_PICTURE_REQUEST_CODE
      • IMAGE_FOLDER_NAME

        public static java.lang.String IMAGE_FOLDER_NAME
    • Constructor Detail

      • SubmitReceiptFragment

        public SubmitReceiptFragment()
    • Method Detail

      • getImageViewClickListener

        public android.view.View.OnClickListener getImageViewClickListener()
      • setImageViewClickListener

        public void setImageViewClickListener​(android.view.View.OnClickListener onImageViewClickListener)
      • getSubmitButtonClicked

        public android.view.View.OnClickListener getSubmitButtonClicked()
      • setSubmitButtonClicked

        public void setSubmitButtonClicked​(android.view.View.OnClickListener onSubmitButtonClicked)
      • getContentLayoutId

        protected int getContentLayoutId()
        Description copied from class: com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
        Provide the Content Layout ID which is of a Layout Resource Reference of Android
        Specified by:
        getContentLayoutId in class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends SubmitReceiptView,​P extends SubmitReceiptPresenter<V>>
        Returns:
        id of the content layout
      • onCreateView

        @Nullable
        public android.view.View onCreateView​(android.view.LayoutInflater inflater,
                                              android.view.ViewGroup container,
                                              android.os.Bundle savedInstanceState)
        Overrides:
        onCreateView in class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends SubmitReceiptView,​P extends SubmitReceiptPresenter<V>>
      • createPresenter

        protected P createPresenter()
        Description copied from class: com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView
        Instantiate MvpFragmentView.mPresenter to be used for this MvpActivityView
        Specified by:
        createPresenter in class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends SubmitReceiptView,​P extends SubmitReceiptPresenter<V>>
        Returns:
        return the MvpBasePresenter
      • showError

        public void showError​(java.lang.String error)
        Description copied from interface: SubmitReceiptView
        This notifies the view when the API call returns an error
        Specified by:
        showError in interface SubmitReceiptView
        Parameters:
        error - String error message
      • onSubmitButtonClicked

        protected void onSubmitButtonClicked()
        This submits a file receipt to the API
      • onPhotoTapped

        protected void onPhotoTapped()
        Choose a photo from the device
      • getScreenName

        public int getScreenName()
        Specified by:
        getScreenName in interface com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
        Overrides:
        getScreenName in class com.cheetahdigital.uikit.architecture.mvp.MvpFragmentView<V extends SubmitReceiptView,​P extends SubmitReceiptPresenter<V>>
      • onClick

        public void onClick​(android.view.View v)
        Specified by:
        onClick in interface android.view.View.OnClickListener
      • onActivityResult

        public void onActivityResult​(int requestCode,
                                     int resultCode,
                                     android.content.Intent data)
        Overrides:
        onActivityResult in class androidx.fragment.app.Fragment
      • onActivityCreated

        public void onActivityCreated​(android.os.Bundle savedInstanceState)
        Overrides:
        onActivityCreated in class androidx.fragment.app.Fragment
      • onSaveInstanceState

        public void onSaveInstanceState​(android.os.Bundle outState)
        Overrides:
        onSaveInstanceState in class androidx.fragment.app.Fragment