Package com.example.skeddly.ui.popup
Class MapPopupDialogFragment
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
com.example.skeddly.ui.popup.MapPopupDialogFragment
- 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,com.google.android.gms.maps.OnMapReadyCallback
public class MapPopupDialogFragment
extends androidx.fragment.app.DialogFragment
implements com.google.android.gms.maps.OnMapReadyCallback
Dialog fragment for the map popup
-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState -
Field Summary
Fields inherited from class androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMALFields inherited from class androidx.fragment.app.Fragment
mPreviousWho -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.android.gms.maps.model.LatLnggetLocationFromAddress(String strAddress) Get a location from a provided string address.static MapPopupDialogFragmentnewInstance(String requestKey, MapPopupType mapPopupType, ArrayList<CustomLocation> entrantLocations) Create a new instance of the MapPopupDialogFragment.android.app.DialogonCreateDialog(android.os.Bundle savedInstanceState) android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) voidonMapReady(com.google.android.gms.maps.GoogleMap googleMap) voidupdateMapAddress(String address) Given an address, put a pin on the map there and update our current result locationMethods 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, requireComponentDialog, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, show, show, showNowMethods 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, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, 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
-
Constructor Details
-
MapPopupDialogFragment
public MapPopupDialogFragment()
-
-
Method Details
-
newInstance
public static MapPopupDialogFragment newInstance(String requestKey, MapPopupType mapPopupType, ArrayList<CustomLocation> entrantLocations) Create a new instance of the MapPopupDialogFragment.- Parameters:
requestKey- The requestKey that should be used when returning the result.mapPopupType- The MapPopupType defining the type of popup/behaviour wanted.entrantLocations- The arraylist of entrant locations to be marked on the map. Can be NULL if mapPopupType is SET- Returns:
- A new MapPopupDialogFragment with the given arguments set.
-
onCreateView
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) - Overrides:
onCreateViewin classandroidx.fragment.app.Fragment
-
onCreateDialog
@NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState) - Overrides:
onCreateDialogin classandroidx.fragment.app.DialogFragment
-
onMapReady
public void onMapReady(@NonNull com.google.android.gms.maps.GoogleMap googleMap) - Specified by:
onMapReadyin interfacecom.google.android.gms.maps.OnMapReadyCallback
-
updateMapAddress
Given an address, put a pin on the map there and update our current result location- Parameters:
address- The address to put a pin in
-
getLocationFromAddress
Get a location from a provided string address.- Parameters:
strAddress- The address to locate- Returns:
- A LatLng object that contains the latitude and longitude of our address
-