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_NORMAL

    Fields inherited from class androidx.fragment.app.Fragment

    mPreviousWho
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.android.gms.maps.model.LatLng
    Get a location from a provided string address.
    newInstance(String requestKey, MapPopupType mapPopupType, ArrayList<CustomLocation> entrantLocations)
    Create a new instance of the MapPopupDialogFragment.
    android.app.Dialog
    onCreateDialog(android.os.Bundle savedInstanceState)
     
    android.view.View
    onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
     
    void
    onMapReady(com.google.android.gms.maps.GoogleMap googleMap)
     
    void
    Given an address, put a pin on the map there and update our current result location

    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, requireComponentDialog, 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, 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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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:
      onCreateView in class androidx.fragment.app.Fragment
    • onCreateDialog

      @NonNull public android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState)
      Overrides:
      onCreateDialog in class androidx.fragment.app.DialogFragment
    • onMapReady

      public void onMapReady(@NonNull com.google.android.gms.maps.GoogleMap googleMap)
      Specified by:
      onMapReady in interface com.google.android.gms.maps.OnMapReadyCallback
    • updateMapAddress

      public void updateMapAddress(String address)
      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

      public com.google.android.gms.maps.model.LatLng getLocationFromAddress(String strAddress)
      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