Class PlacesMapFragment
- java.lang.Object
-
- androidx.fragment.app.Fragment
-
- com.cheetahdigital.locations.ui.places.map.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 ofPlace
-
-
Constructor Summary
Constructors Constructor Description PlacesMapFragment()
-
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 listvoid
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 listvoid
clearMarkers()
Removes all map markersjava.util.HashMap<com.google.android.gms.maps.model.Marker,Place>
getMarkerPlaceHashMap()
Returns the HashMap of map markersint
getScreenName()
float
getZoomLevel(double radius)
Returns the zoom levelvoid
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 coordinatesvoid
setUpWithPlacesList(PlacesListFragment placesFragment)
Setup thisPlacesMapFragment
with aPlacesListFragment
.-
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
-
-
-
-
Method Detail
-
onCreate
public void onCreate(android.os.Bundle savedInstanceState)
- Overrides:
onCreate
in classandroidx.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 classandroidx.fragment.app.Fragment
-
onMapReady
public void onMapReady(com.google.android.gms.maps.GoogleMap googleMap)
- Specified by:
onMapReady
in interfacecom.google.android.gms.maps.OnMapReadyCallback
-
setUpWithPlacesList
public void setUpWithPlacesList(PlacesListFragment placesFragment)
Setup thisPlacesMapFragment
with aPlacesListFragment
.- Parameters:
placesFragment
- the PlacesListFragment to link to
-
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 valuelongitude
- 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 ofPlace
-
addMarkers
public void addMarkers(java.util.List<Place> places)
Populates map markers from the given places list- Parameters:
places
- list ofPlace
-
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 interfacecom.cheetahdigital.corekit.sdk.analytics.AnalyticsManager.AnalyticsScreen
-
onCameraIdle
public void onCameraIdle()
- Specified by:
onCameraIdle
in interfacecom.google.android.gms.maps.GoogleMap.OnCameraIdleListener
-
onCameraMoveStarted
public void onCameraMoveStarted(int i)
- Specified by:
onCameraMoveStarted
in interfacecom.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener
-
onClick
public void onClick(android.view.View view)
- Specified by:
onClick
in interfaceandroid.view.View.OnClickListener
-
-