Class AddQRCodeFragment

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnDismissListener, android.view.View.OnCreateContextMenuListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner, java.io.Serializable

    public class AddQRCodeFragment
    extends QRCodeFragment
    Displays information about a specific QRCode. It also lets the user:
    • Add scanned QR code to profile
    • Record geolocation of scanned QR code
    • Take location photo of scanned qr code
    See Also:
    Serialized Form
    • 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 Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LocationPhotoAdapter getLocationPhotoAdapter()
      Retrieve the location photo adapter
      LocationPhotoController getLocationPhotoController()
      Retrieve the location photo controller
      LocationPhotoFragment getLocationPhotoFragment()
      Retrieve the location photo fragment
      static AddQRCodeFragment newInstance​(QRCode qrCode, Player activePlayer)
      Creates a new AddQRCodeFragment to display a specific QR Code
      void onRequestPermissionsResult​(int requestCode, java.lang.String[] permissions, int[] grantResults)
      Disables the "Record QR Location" box if the user has not granted location permissions
      protected void setUpButtons​(android.view.View view)
      Enable and disable buttons of QRCodeFragment
      protected void toggleCommentBox​(boolean isShown)
      Toggles whether or not the comment box should be shown or not.
      • Methods inherited from class androidx.fragment.app.DialogFragment

        dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, isCancelable, onActivityCreated, onAttach, onCancel, onCreate, onDestroyView, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, onStart, onStop, onViewStateRestored, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, show, show, showNow
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelCreationExtras, 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, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onViewCreated, 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, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
      • Methods inherited from class java.lang.Object

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

      • AddQRCodeFragment

        public AddQRCodeFragment()
    • Method Detail

      • newInstance

        public static AddQRCodeFragment newInstance​(QRCode qrCode,
                                                    Player activePlayer)
        Creates a new AddQRCodeFragment to display a specific QR Code
        Parameters:
        qrCode - The QR code to view
        activePlayer - The player that scanned the given QR code
        Returns:
        QRCodeFragment
      • setUpButtons

        protected void setUpButtons​(android.view.View view)
        Description copied from class: QRCodeFragment
        Enable and disable buttons of QRCodeFragment
        Overrides:
        setUpButtons in class QRCodeFragment
        Parameters:
        view - the view
      • toggleCommentBox

        protected void toggleCommentBox​(boolean isShown)
        Description copied from class: QRCodeFragment
        Toggles whether or not the comment box should be shown or not.

        Behaves like a 'hook', where the comment box is only available to AddQRCodeFragment and DeleteQRCodeFragment (essentially whenever the player has/had scanned the code themselved)

        Overrides:
        toggleCommentBox in class QRCodeFragment
        Parameters:
        isShown - Whether or not the comment box should be shown.
      • onRequestPermissionsResult

        public void onRequestPermissionsResult​(int requestCode,
                                               @NonNull
                                               java.lang.String[] permissions,
                                               @NonNull
                                               int[] grantResults)
        Disables the "Record QR Location" box if the user has not granted location permissions
        Overrides:
        onRequestPermissionsResult in class androidx.fragment.app.Fragment
        Parameters:
        requestCode - The request code passed in Fragment.requestPermissions(String[], int).
        permissions - The requested permissions. Never null.
        grantResults - The grant results for the corresponding permissions which is either PackageManager.PERMISSION_GRANTED or PackageManager.PERMISSION_DENIED. Never null.
      • getLocationPhotoFragment

        public LocationPhotoFragment getLocationPhotoFragment()
        Retrieve the location photo fragment
        Returns:
        The location photo fragment
      • getLocationPhotoController

        public LocationPhotoController getLocationPhotoController()
        Retrieve the location photo controller
        Returns:
        The location photo controller
      • getLocationPhotoAdapter

        public LocationPhotoAdapter getLocationPhotoAdapter()
        Retrieve the location photo adapter
        Returns:
        The location photo adapter