MapFragment

An Android fragment wrapping the TomTom MapView. This fragment handles a complete lifecycle of the underlying MapView. It can be instantiated either programmatically via MapFragment.newInstance(mapOptions: MapOptions) or via the XML view inflation. See MapResources to check what attributes can be configured via XML.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val balloonsViewContainer: ViewGroup

This represents the container view for any balloon markers on the map. When clicked, balloon markers typically show more information about a specific point on the map.

Link copied to clipboard
open override val compassButton: CompassButton

This represents the compass button on the map. This button provides a quick way for users to change the map to have a northern orientation.

Link copied to clipboard

This represents the button that shows the user's current location on the map.

Link copied to clipboard
open override val logoView: LogoView

This represents the logo of the map provider. This logo ensures the correct attribution is given to the map data source.

Link copied to clipboard

This represents the adapter for the balloon views. The adapter determines how the content inside each balloon marker is displayed.

Link copied to clipboard
open override val scaleView: ScaleView

This represents the scale view on the map. This shows the scale of the map in relation to the real world distances.

Link copied to clipboard

This represents the zoom controls on the map. These controls allow users to zoom in and out of the map view.

Inherited properties

Link copied to clipboard
@get:NonNull
@get:CallSuper
open override val defaultViewModelCreationExtras: CreationExtras
Link copied to clipboard
@get:NonNull
open override val defaultViewModelProviderFactory: ViewModelProvider.Factory
Link copied to clipboard
@get:NonNull
open override val lifecycle: Lifecycle
Link copied to clipboard
@RestrictTo(value = [RestrictTo.Scope.LIBRARY])
@Nullable
var mPreviousWho: String?
Link copied to clipboard
@get:NonNull
override val savedStateRegistry: SavedStateRegistry
Link copied to clipboard
@get:NonNull
open override val viewModelStore: ViewModelStore

Functions

Link copied to clipboard
@MainThread
open override fun getMapAsync(callback: MapReadyCallback): Cancellable

Sets a callback that will be triggered when the map instance is ready to use. The callback will be executed on the main thread. Note: You must call this method from the main thread. Otherwise an exception will be thrown.

Link copied to clipboard
open override fun onConfigurationChanged(newConfig: Configuration)
Link copied to clipboard
open override fun onCreate(savedInstanceState: Bundle?)

Handles the 'onCreate' lifecycle event. Initializes the MapView internals and UI components.

Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View

Called on the fragment to instantiate its MapView. If there were some calls for getMapAsync(callback: OnMapReadyCallback), then the subscribed callbacks will be executed as soon as the MapView is created and the underlying TomTomMap is available.

Link copied to clipboard
open override fun onDestroy()

This handles the 'onDestroy' lifecycle event. It is called when the parent component is being destroyed. This ensures the internal map view components are properly shut down and resources are freed.

Link copied to clipboard
open override fun onInflate(context: Context, attrs: AttributeSet, savedInstanceState: Bundle?)

This is called when the fragment's UI is created. This method parses the given attributes and sets the map options accordingly.

Link copied to clipboard
open override fun onPause()

This handles the 'onPause' lifecycle event. It is called when the parent component is no longer resumed but still visible. This ensures the internal map view components pause their active processes to conserve resources.

Link copied to clipboard
open override fun onResume()

This handles the 'onResume' lifecycle event. It is called when the parent component is visible to the user and actively running. This ensures the internal map view components are active and updated.

Link copied to clipboard
open override fun onSaveInstanceState(outState: Bundle)

This handles the 'onSaveInstanceState' lifecycle event. It is called when the parent component saves its instance state. This stores the current state of the MapView component, ensuring that the state can be restored after a configuration change or other events that restart the component.

Link copied to clipboard
open override fun onStart()

This handles the 'onStart' lifecycle event. It is called when the parent component becomes visible to the user. This ensures the internal map view components are ready to display.

Link copied to clipboard
open override fun onStop()

This handles the 'onStop' lifecycle event. It is called when the parent component is no longer visible to the user. This ensures the internal map view components stop all active processes to conserve resources.

Inherited functions

Link copied to clipboard
open fun dump(@NonNull p0: String, @Nullable p1: FileDescriptor?, @NonNull p2: PrintWriter, @Nullable p3: Array<String>?)
Link copied to clipboard
operator override fun equals(@Nullable other: Any?): Boolean
Link copied to clipboard
@Nullable
fun getActivity(): FragmentActivity?
Link copied to clipboard
@Nullable
fun getArguments(): Bundle?
Link copied to clipboard
@NonNull
fun getChildFragmentManager(): FragmentManager
Link copied to clipboard
@Nullable
open fun getContext(): Context?
Link copied to clipboard
@Nullable
open fun getEnterTransition(): Any?
Link copied to clipboard
@Nullable
open fun getExitTransition(): Any?
Link copied to clipboard
@Nullable
fun getFragmentManager(): FragmentManager?
Link copied to clipboard
@Nullable
fun getHost(): Any?
Link copied to clipboard
fun getId(): Int
Link copied to clipboard
@NonNull
fun getLayoutInflater(): LayoutInflater
@NonNull
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP_PREFIX])
open fun getLayoutInflater(@Nullable p0: Bundle?): LayoutInflater
Link copied to clipboard
@NonNull
open fun getLoaderManager(): LoaderManager
Link copied to clipboard
@Nullable
fun getParentFragment(): Fragment?
Link copied to clipboard
@NonNull
fun getParentFragmentManager(): FragmentManager
Link copied to clipboard
@Nullable
open fun getReenterTransition(): Any?
Link copied to clipboard
@NonNull
fun getResources(): Resources
Link copied to clipboard
Link copied to clipboard
@Nullable
open fun getReturnTransition(): Any?
Link copied to clipboard
@Nullable
open fun getSharedElementEnterTransition(): Any?
Link copied to clipboard
Link copied to clipboard
@NonNull
fun getString(@StringRes p0: Int): String
@NonNull
fun getString(@StringRes p0: Int, @Nullable vararg p1: Any): String
Link copied to clipboard
@Nullable
fun getTag(): String?
Link copied to clipboard
@Nullable
fun getTargetFragment(): Fragment?
Link copied to clipboard
Link copied to clipboard
@NonNull
fun getText(@StringRes p0: Int): CharSequence
Link copied to clipboard
Link copied to clipboard
@Nullable
open fun getView(): View?
Link copied to clipboard
@MainThread
@NonNull
open fun getViewLifecycleOwner(): LifecycleOwner
Link copied to clipboard
@NonNull
open fun getViewLifecycleOwnerLiveData(): LiveData<LifecycleOwner>
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP_PREFIX])
fun hasOptionsMenu(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP_PREFIX])
fun isMenuVisible(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@MainThread
@CallSuper
open fun onActivityCreated(@Nullable p0: Bundle?)
Link copied to clipboard
open fun onActivityResult(p0: Int, p1: Int, @Nullable p2: Intent?)
Link copied to clipboard
@MainThread
@CallSuper
open fun onAttach(@NonNull p0: Activity)
@MainThread
@CallSuper
open fun onAttach(@NonNull p0: Context)
Link copied to clipboard
@MainThread
open fun onAttachFragment(@NonNull p0: Fragment)
Link copied to clipboard
@MainThread
open fun onContextItemSelected(@NonNull p0: MenuItem): Boolean
Link copied to clipboard
@MainThread
@Nullable
open fun onCreateAnimation(p0: Int, p1: Boolean, p2: Int): Animation?
Link copied to clipboard
@MainThread
@Nullable
open fun onCreateAnimator(p0: Int, p1: Boolean, p2: Int): Animator?
Link copied to clipboard
@MainThread
open override fun onCreateContextMenu(@NonNull p0: ContextMenu, @NonNull p1: View, @Nullable p2: ContextMenu.ContextMenuInfo?)
Link copied to clipboard
@MainThread
open fun onCreateOptionsMenu(@NonNull p0: Menu, @NonNull p1: MenuInflater)
Link copied to clipboard
@MainThread
open fun onDestroyOptionsMenu()
Link copied to clipboard
@MainThread
@CallSuper
open fun onDestroyView()
Link copied to clipboard
@MainThread
@CallSuper
open fun onDetach()
Link copied to clipboard
@NonNull
open fun onGetLayoutInflater(@Nullable p0: Bundle?): LayoutInflater
Link copied to clipboard
@MainThread
open fun onHiddenChanged(p0: Boolean)
Link copied to clipboard
@UiThread
@CallSuper
open fun onInflate(@NonNull p0: Activity, @NonNull p1: AttributeSet, @Nullable p2: Bundle?)
Link copied to clipboard
@MainThread
@CallSuper
open override fun onLowMemory()
Link copied to clipboard
Link copied to clipboard
@MainThread
open fun onOptionsItemSelected(@NonNull p0: MenuItem): Boolean
Link copied to clipboard
@MainThread
open fun onOptionsMenuClosed(@NonNull p0: Menu)
Link copied to clipboard
@MainThread
open fun onPrepareOptionsMenu(@NonNull p0: Menu)
Link copied to clipboard
Link copied to clipboard
open fun onRequestPermissionsResult(p0: Int, @NonNull p1: Array<String>, @NonNull p2: IntArray)
Link copied to clipboard
@MainThread
open fun onViewCreated(@NonNull p0: View, @Nullable p1: Bundle?)
Link copied to clipboard
@MainThread
@CallSuper
open fun onViewStateRestored(@Nullable p0: Bundle?)
Link copied to clipboard
Link copied to clipboard
@MainThread
@NonNull
override fun <I : Any, O : Any> registerForActivityResult(@NonNull p0: ActivityResultContract<I, O>, @NonNull p1: ActivityResultCallback<O>): ActivityResultLauncher<I>
@MainThread
@NonNull
override fun <I : Any, O : Any> registerForActivityResult(@NonNull p0: ActivityResultContract<I, O>, @NonNull p1: ActivityResultRegistry, @NonNull p2: ActivityResultCallback<O>): ActivityResultLauncher<I>
Link copied to clipboard
open fun registerForContextMenu(@NonNull p0: View)
Link copied to clipboard
fun requestPermissions(@NonNull p0: Array<String>, p1: Int)
Link copied to clipboard
@NonNull
fun requireActivity(): FragmentActivity
Link copied to clipboard
@NonNull
fun requireArguments(): Bundle
Link copied to clipboard
@NonNull
fun requireContext(): Context
Link copied to clipboard
@NonNull
fun requireFragmentManager(): FragmentManager
Link copied to clipboard
@NonNull
fun requireHost(): Any
Link copied to clipboard
@NonNull
fun requireParentFragment(): Fragment
Link copied to clipboard
@NonNull
fun requireView(): View
Link copied to clipboard
open fun setArguments(@Nullable p0: Bundle?)
Link copied to clipboard
open fun setEnterSharedElementCallback(@Nullable p0: SharedElementCallback?)
Link copied to clipboard
open fun setEnterTransition(@Nullable p0: Any?)
Link copied to clipboard
open fun setExitSharedElementCallback(@Nullable p0: SharedElementCallback?)
Link copied to clipboard
open fun setExitTransition(@Nullable p0: Any?)
Link copied to clipboard
Link copied to clipboard
open fun setInitialSavedState(@Nullable p0: Fragment.SavedState?)
Link copied to clipboard
Link copied to clipboard
open fun setReenterTransition(@Nullable p0: Any?)
Link copied to clipboard
Link copied to clipboard
open fun setReturnTransition(@Nullable p0: Any?)
Link copied to clipboard
open fun setSharedElementEnterTransition(@Nullable p0: Any?)
Link copied to clipboard
open fun setSharedElementReturnTransition(@Nullable p0: Any?)
Link copied to clipboard
open fun setTargetFragment(@Nullable p0: Fragment?, p1: Int)
Link copied to clipboard
Link copied to clipboard
open fun startActivity(@NonNull p0: Intent)
open fun startActivity(@NonNull p0: Intent, @Nullable p1: Bundle?)
Link copied to clipboard
open fun startActivityForResult(@NonNull p0: Intent, p1: Int)
open fun startActivityForResult(@NonNull p0: Intent, p1: Int, @Nullable p2: Bundle?)
Link copied to clipboard
open fun startIntentSenderForResult(@NonNull p0: IntentSender, p1: Int, @Nullable p2: Intent?, p3: Int, p4: Int, p5: Int, @Nullable p6: Bundle?)
Link copied to clipboard
Link copied to clipboard
@NonNull
open override fun toString(): String
Link copied to clipboard
open fun unregisterForContextMenu(@NonNull p0: View)