Class QRCodeFragment
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- androidx.fragment.app.DialogFragment
-
- com.cmput301w23t09.qrhunter.qrcode.QRCodeFragment
-
- 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
- Direct Known Subclasses:
AddQRCodeFragment
,DeleteQRCodeFragment
public class QRCodeFragment extends androidx.fragment.app.DialogFragment implements java.io.Serializable
Displays information about a specific QRCode. It also lets the user:- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Player
activePlayer
protected com.google.android.material.floatingactionbutton.FloatingActionButton
addButton
protected android.widget.EditText
commentBox
protected java.util.List<Comment>
comments
protected CommentAdapter
commentsAdapter
protected com.google.android.material.floatingactionbutton.FloatingActionButton
deleteButton
protected android.widget.ListView
listElement
protected android.widget.ListView
listView
protected com.google.android.material.floatingactionbutton.FloatingActionButton
loadingButton
protected android.widget.CheckBox
locationCheckbox
protected LocationHandler
locationHandler
protected LocationPhotoAdapter
locationPhotoAdapter
protected com.smarteist.autoimageslider.SliderView
locationPhotoSlider
protected LocationPhotoStorage
locationPhotoStorage
protected QRCode
qrCode
protected QRCodePlayerScansAdapter
scansAdapter
protected com.google.android.material.tabs.TabLayout
tabLayout
protected android.widget.Button
takeLocationPhotoBtn
-
Constructor Summary
Constructors Constructor Description QRCodeFragment()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QRCodeFragment
newInstance(QRCode qrCode, Player player)
Creates a new QRCodeFragment to display a specific QR Codeandroid.app.Dialog
onCreateDialog(android.os.Bundle savedInstanceState)
void
onResume()
protected void
setUpButtons(android.view.View view)
Enable and disable buttons of QRCodeFragmentprotected void
toggleCommentBox(boolean isShown)
Toggles whether or not the comment box should be shown or not.void
updateLocationPhoto()
Updates the locationPhoto image view to show the newly-captured location photo-
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, onRequestPermissionsResult, 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
-
-
-
-
Field Detail
-
qrCode
protected QRCode qrCode
-
takeLocationPhotoBtn
protected android.widget.Button takeLocationPhotoBtn
-
locationCheckbox
protected android.widget.CheckBox locationCheckbox
-
locationHandler
protected LocationHandler locationHandler
-
activePlayer
protected Player activePlayer
-
addButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton addButton
-
deleteButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton deleteButton
-
loadingButton
protected com.google.android.material.floatingactionbutton.FloatingActionButton loadingButton
-
tabLayout
protected com.google.android.material.tabs.TabLayout tabLayout
-
commentBox
protected android.widget.EditText commentBox
-
listView
protected android.widget.ListView listView
-
comments
protected java.util.List<Comment> comments
-
commentsAdapter
protected CommentAdapter commentsAdapter
-
locationPhotoSlider
protected com.smarteist.autoimageslider.SliderView locationPhotoSlider
-
locationPhotoAdapter
protected LocationPhotoAdapter locationPhotoAdapter
-
locationPhotoStorage
protected LocationPhotoStorage locationPhotoStorage
-
listElement
protected android.widget.ListView listElement
-
scansAdapter
protected QRCodePlayerScansAdapter scansAdapter
-
-
Method Detail
-
newInstance
public static QRCodeFragment newInstance(QRCode qrCode, Player player)
Creates a new QRCodeFragment to display a specific QR Code- Parameters:
qrCode
- The QR code to viewplayer
- The player that scanned the given QR code- Returns:
- QRCodeFragment
-
onCreateDialog
@NonNull public android.app.Dialog onCreateDialog(@Nullable android.os.Bundle savedInstanceState)
- Overrides:
onCreateDialog
in classandroidx.fragment.app.DialogFragment
-
onResume
public void onResume()
- Overrides:
onResume
in classandroidx.fragment.app.Fragment
-
setUpButtons
protected void setUpButtons(android.view.View view)
Enable and disable buttons of QRCodeFragment- Parameters:
view
- the view
-
toggleCommentBox
protected void toggleCommentBox(boolean isShown)
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)
- Parameters:
isShown
- Whether or not the comment box should be shown.
-
updateLocationPhoto
public void updateLocationPhoto()
Updates the locationPhoto image view to show the newly-captured location photo
-
-