Class PlacesMapFragment

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner, com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen, com.google.android.gms.maps.GoogleMap.OnCameraIdleListener, com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener, com.google.android.gms.maps.OnMapReadyCallback

    public class PlacesMapFragment
    extends androidx.fragment.app.Fragment
    implements com.google.android.gms.maps.OnMapReadyCallback, com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen, com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener, com.google.android.gms.maps.GoogleMap.OnCameraIdleListener, android.view.View.OnClickListener
    The fragment class to show the map from the given list of Place
    • 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 interface com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener

        REASON_API_ANIMATION, REASON_DEVELOPER_ANIMATION, REASON_GESTURE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMarkers​(java.util.List<Place> places)
      Populates map markers from the given places list
      void centerMap​(double latitude, double longitude)
      Moves the map in the center of the given coordinates.
      void centerMap​(android.location.Location location)
      Moves the map in the center of the given location.
      void centerMap​(java.util.List<Place> places)
      Moves the map in the center of the given places list
      void clearMarkers()
      Removes all map markers
      java.util.HashMap<com.google.android.gms.maps.model.Marker,​Place> getMarkerPlaceHashMap()
      Returns the HashMap of map markers
      int getScreenName()  
      float getZoomLevel​(double radius)
      Returns the zoom level
      void onCameraIdle()  
      void onCameraMoveStarted​(int i)  
      void onClick​(android.view.View view)  
      void onCreate​(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 recenterMap()
      Recenters the map to the last centered coordinates
      void setUpWithPlacesList​(PlacesListFragment placesFragment)
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, 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, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, 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
      • Methods inherited from class java.lang.Object

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

      • PlacesMapFragment

        public PlacesMapFragment()
    • Method Detail

      • onCreate

        public void onCreate​(android.os.Bundle savedInstanceState)
        Overrides:
        onCreate in class androidx.fragment.app.Fragment
      • getMarkerPlaceHashMap

        public java.util.HashMap<com.google.android.gms.maps.model.Marker,​Place> getMarkerPlaceHashMap()
        Returns the HashMap of map markers
        Returns:
        map markers
      • 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
      • onMapReady

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

        public void recenterMap()
        Recenters the map to the last centered coordinates
      • centerMap

        public void centerMap​(double latitude,
                              double longitude)
        Moves the map in the center of the given coordinates. Also populates the map markers
        Parameters:
        latitude - place latitude value
        longitude - place longitude value
      • centerMap

        public void centerMap​(android.location.Location location)
        Moves the map in the center of the given location.
        Parameters:
        location - geographic location
      • centerMap

        public void centerMap​(java.util.List<Place> places)
        Moves the map in the center of the given places list
        Parameters:
        places - list of Place
      • addMarkers

        public void addMarkers​(java.util.List<Place> places)
        Populates map markers from the given places list
        Parameters:
        places - list of Place
      • clearMarkers

        public void clearMarkers()
        Removes all map markers
      • getZoomLevel

        public float getZoomLevel​(double radius)
        Returns the zoom level
        Parameters:
        radius - radius distance
        Returns:
        zoom level
      • getScreenName

        public int getScreenName()
        Specified by:
        getScreenName in interface com.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
      • onCameraIdle

        public void onCameraIdle()
        Specified by:
        onCameraIdle in interface com.google.android.gms.maps.GoogleMap.OnCameraIdleListener
      • onCameraMoveStarted

        public void onCameraMoveStarted​(int i)
        Specified by:
        onCameraMoveStarted in interface com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener
      • onClick

        public void onClick​(android.view.View view)
        Specified by:
        onClick in interface android.view.View.OnClickListener