Package com.trimblemaps.mapsdk.maps
Class SupportMapFragment
java.lang.Object
androidx.fragment.app.Fragment
com.trimblemaps.mapsdk.maps.SupportMapFragment
- 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,OnMapReadyCallback
public class SupportMapFragment
extends androidx.fragment.app.Fragment
implements OnMapReadyCallback
Support Fragment wrapper around a map view.
A Map component in an app. This fragment is the simplest way to place a map in an application. It's a wrapper around a view of a map to automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity's layout or can dynamically be added using a FragmentManager.
To get a reference to the MapView, use getMapAsync(OnMapReadyCallback)}
- See Also:
-
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.Fragment
mPreviousWho -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetMapAsync(OnMapReadyCallback onMapReadyCallback) Sets a callback object which will be triggered when the TrimbleMapsMap instance is ready to be used.static SupportMapFragmentCreates a default MapFragment instancestatic SupportMapFragmentnewInstance(TrimbleMapsMapOptions trimbleMapsMapOptions) Creates a MapFragment instancevoidonAttach(android.content.Context context) Called when the context attaches to this fragment.android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) Creates the fragment view hierarchy.voidCalled when the fragment is destroyed.voidCalled when the fragment is view hierarchy is being destroyed.voidonInflate(android.content.Context context, android.util.AttributeSet attrs, android.os.Bundle savedInstanceState) Called when this fragment is inflated, parses XML tag attributes.voidCalled when the fragment receives onLowMemory call from the hosting Activity.voidonMapReady(TrimbleMapsMap trimbleMapsMap) Called when the map is ready to be used.voidonPause()Called when the fragment is pausing.voidonResume()Called when the fragment is ready to be interacted with.voidonSaveInstanceState(android.os.Bundle outState) Called when the fragment state needs to be saved.voidonStart()Called when the fragment is visible for the users.voidonStop()Called when the fragment is no longer visible for the user.voidonViewCreated(android.view.View view, android.os.Bundle savedInstanceState) Called when the fragment view hierarchy is created.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, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, 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 Details
-
SupportMapFragment
public SupportMapFragment()
-
-
Method Details
-
newInstance
Creates a default MapFragment instance- Returns:
- MapFragment created
-
newInstance
@NonNull public static SupportMapFragment newInstance(@Nullable TrimbleMapsMapOptions trimbleMapsMapOptions) Creates a MapFragment instance- Parameters:
trimbleMapsMapOptions- The configuration options to be used.- Returns:
- MapFragment created.
-
onAttach
public void onAttach(android.content.Context context) Called when the context attaches to this fragment.- Overrides:
onAttachin classandroidx.fragment.app.Fragment- Parameters:
context- the context attaching
-
onInflate
public void onInflate(@NonNull android.content.Context context, android.util.AttributeSet attrs, android.os.Bundle savedInstanceState) Called when this fragment is inflated, parses XML tag attributes.- Overrides:
onInflatein classandroidx.fragment.app.Fragment- Parameters:
context- The context inflating this fragment.attrs- The XML tag attributes.savedInstanceState- The saved instance state for the map fragment.
-
onCreateView
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) Creates the fragment view hierarchy.- Overrides:
onCreateViewin classandroidx.fragment.app.Fragment- Parameters:
inflater- Inflater used to inflate content.container- The parent layout for the map fragment.savedInstanceState- The saved instance state for the map fragment.- Returns:
- The view created
-
onViewCreated
public void onViewCreated(android.view.View view, android.os.Bundle savedInstanceState) Called when the fragment view hierarchy is created.- Overrides:
onViewCreatedin classandroidx.fragment.app.Fragment- Parameters:
view- The content view of the fragmentsavedInstanceState- THe saved instance state of the framgnt
-
onMapReady
Description copied from interface:OnMapReadyCallbackCalled when the map is ready to be used.- Specified by:
onMapReadyin interfaceOnMapReadyCallback- Parameters:
trimbleMapsMap- An instance of TrimbleMapsMap associated with theMapFragmentorMapViewthat defines the callback.
-
onStart
public void onStart()Called when the fragment is visible for the users.- Overrides:
onStartin classandroidx.fragment.app.Fragment
-
onResume
public void onResume()Called when the fragment is ready to be interacted with.- Overrides:
onResumein classandroidx.fragment.app.Fragment
-
onPause
public void onPause()Called when the fragment is pausing.- Overrides:
onPausein classandroidx.fragment.app.Fragment
-
onSaveInstanceState
public void onSaveInstanceState(@NonNull android.os.Bundle outState) Called when the fragment state needs to be saved.- Overrides:
onSaveInstanceStatein classandroidx.fragment.app.Fragment- Parameters:
outState- The saved state
-
onStop
public void onStop()Called when the fragment is no longer visible for the user.- Overrides:
onStopin classandroidx.fragment.app.Fragment
-
onLowMemory
public void onLowMemory()Called when the fragment receives onLowMemory call from the hosting Activity.- Specified by:
onLowMemoryin interfaceandroid.content.ComponentCallbacks- Overrides:
onLowMemoryin classandroidx.fragment.app.Fragment
-
onDestroyView
public void onDestroyView()Called when the fragment is view hierarchy is being destroyed.- Overrides:
onDestroyViewin classandroidx.fragment.app.Fragment
-
onDestroy
public void onDestroy()Called when the fragment is destroyed.- Overrides:
onDestroyin classandroidx.fragment.app.Fragment
-
getMapAsync
Sets a callback object which will be triggered when the TrimbleMapsMap instance is ready to be used.- Parameters:
onMapReadyCallback- The callback to be invoked.
-