FinishRouteViewModel

Manages the state and behavior of the finish route UI control. This control is displayed when navigation reaches the destination.

Thread Safety

This ViewModel is not thread-safe and must only be accessed from the Main thread.

  • All methods must be called from the Main (UI) thread

  • All StateFlow properties emit values on the Main thread

  • Concurrent access from multiple threads may lead to undefined behavior

Inheritors

Properties

Link copied to clipboard
abstract val finishHandler: StateFlow<() -> Unit?>

Observable state holding the handler for the finish button. When null, the finish button is hidden.

Link copied to clipboard
abstract val parkingMode: StateFlow<FinishRouteParkingMode>

Observable state of the parking feature. Indicates whether parking spots are shown on the map. When set to Unavailable, the parking button will be hidden.

Functions

Link copied to clipboard
abstract fun onCleared()

Releases resources when the view model is no longer needed.

Link copied to clipboard
abstract fun onParkingButtonClicked()

Called when the user clicks the parking button. Toggles the parking mode between Enabled and Disabled.

Link copied to clipboard
abstract fun setFinishHandler(handler: () -> Unit?)

Sets the handler for the finish button. This handler will be invoked when the user wants to finish navigation.

Link copied to clipboard
abstract fun setParkingButtonAvailability(availability: Boolean)

Updates the availability of the parking button. When set to false, the parking mode will be set to Unavailable.