Package com.cmput301w23t09.qrhunter.map
Class MapFragment
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cmput301w23t09.qrhunter.BaseFragment
-
- com.cmput301w23t09.qrhunter.map.MapFragment
-
- 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,com.google.android.gms.maps.OnMapReadyCallback
public class MapFragment extends BaseFragment implements com.google.android.gms.maps.OnMapReadyCallback
Displays the map that allows QRs to be seen/searched
-
-
Constructor Summary
Constructors Constructor Description MapFragment(GameController gameController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.android.gms.location.FusedLocationProviderClientgetFusedLocationProviderClient()Retrieve the location provider clientbooleangetLocationPermissionGranted()Check if location permissions were granted.android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)voidonMapReady(com.google.android.gms.maps.GoogleMap googleMap)Called when the map has been initializedvoidonRequestPermissionsResult(int requestCode, java.lang.String[] permissions, int[] grantResults)Handles the users response to permission dialogue box popup-
Methods inherited from class com.cmput301w23t09.qrhunter.BaseFragment
getActivePlayer, getGameController
-
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, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onResume, onSaveInstanceState, onStart, onStop, onViewCreated, 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, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
-
-
-
Constructor Detail
-
MapFragment
public MapFragment(GameController gameController)
-
-
Method Detail
-
onRequestPermissionsResult
public void onRequestPermissionsResult(int requestCode, @NonNull java.lang.String[] permissions, @NonNull int[] grantResults)Handles the users response to permission dialogue box popup- Overrides:
onRequestPermissionsResultin classandroidx.fragment.app.Fragment
-
onCreateView
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)- Overrides:
onCreateViewin classandroidx.fragment.app.Fragment- Parameters:
inflater- The LayoutInflater object that can be used to inflate any views in the fragment,container- If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.savedInstanceState- If non-null, this fragment is being re-constructed from a previous saved state as given here.- Returns:
- View the view which is inflated displaying the the R.layout.map xml file
-
onMapReady
public void onMapReady(com.google.android.gms.maps.GoogleMap googleMap)
Called when the map has been initialized- Specified by:
onMapReadyin interfacecom.google.android.gms.maps.OnMapReadyCallback- Parameters:
googleMap- the Google maps
-
getLocationPermissionGranted
public boolean getLocationPermissionGranted()
Check if location permissions were granted.- Returns:
- if permission was granted.
-
getFusedLocationProviderClient
public com.google.android.gms.location.FusedLocationProviderClient getFusedLocationProviderClient()
Retrieve the location provider client- Returns:
- client
-
-