ConsumerComposeViewModel

public final class ConsumerComposeViewModel extends Object

Note: This is an experimental feature. For details about integrating with Jetpack Compose, reach out to your representative.

View model that represents state for Consumer Compose composable. Observable fields are expected to be updated by both Controller and UI code.

Public Constructor Summary

Public Method Summary

LiveData<ConsumerPolylineOptions>
getActiveRoutePolylineOptions()
Gets the polyline options for type ActiveRoute.
LiveData<ConsumerPolylineTrafficStyle>
getActiveRoutePolylineTrafficStyle()
Gets the style settings for traffic polylines of type ActiveRoute.
LiveData<CameraStateData>
getCameraState()
Gets the current camera state when Auto Camera is enabled.
LiveData<Session>
getCurrentActiveSession()
Gets the current active session to be displayed in the UI.
LiveData<Boolean>
getIsAutoCameraEnabled()
Gets the Auto Camera setting which updates camera according to route and user location.
LiveData<Set<LiveData<ConsumerMarkerListData>>>
getMarkerLists()
Gets the set of marker lists to be displayed on the map.
LiveData<Set<LiveData<ConsumerMarkerData>>>
getMarkers()
Gets the set of markers to be displayed on the map.
LiveData<Set<LiveData<ConsumerPolylineData>>>
getPolylines()
Gets the set of polylines to be displayed on the map.
LiveData<ProjectedRouteEta>
getProjectedArrival()
Gets the current projected arrival information for the trip.
LiveData<ConsumerPolylineOptions>
getRemainingRoutePolylineOptions()
Gets the polyline options for type RemainingRoute.
LiveData<ConsumerPolylineTrafficStyle>
getRemainingRoutePolylineTrafficStyle()
Gets the style settings for traffic polylines of type RemainingRoute.
LiveData<ConsumerMarkerOptions>
getTripDropoffPointMarkerOptions()
Gets the marker options for marker type TripDropoffPoint.
LiveData<ConsumerMarkerOptions>
getTripIntermediateDestinationMarkerOptions()
Gets the marker options for marker type TripIntermediateDestination.
LiveData<ConsumerMarkerOptions>
getTripPickupPointMarkerOptions()
Gets the marker options for marker type TripPickupPoint.
LiveData<ConsumerMarkerOptions>
getTripVehicleMarkerOptions()
Gets the marker options for marker type TripVehicle.
LiveData<ConsumerMarkerOptions>
getUndefinedTypeMarkerOptions()
Gets the marker options for undefined marker type.
void
setActiveRoutePolylineOptions(ConsumerPolylineOptions consumerPolylineOptions)
Sets custom polyline options for type ActiveRoute.
void
setActiveRoutePolylineTrafficStyle(ConsumerPolylineTrafficStyle consumerTrafficPolylineStyle)
Sets the styles for traffic polylines of type ActiveRoute.
void
setCurrentActiveSession(Session session)
Sets the current active session to be displayed in the UI.
void
setIsAutoCameraEnabled(Boolean isAutoCameraEnabled)
Sets whether Auto Camera is enabled.
void
setRemainingRoutePolylineOptions(ConsumerPolylineOptions consumerPolylineOptions)
Sets custom polyline options for type RemainingRoute.
void
setRemainingRoutePolylineTrafficStyle(ConsumerPolylineTrafficStyle consumerTrafficPolylineStyle)
Sets the styles for traffic polylines of type RemainingRoute.
void
setTripDropoffPointMarkerOptions(ConsumerMarkerOptions consumerMarkerOptions)
Sets custom marker options for marker type TripDropoffPoint.
void
setTripIntermediateDestinationMarkerOptions(ConsumerMarkerOptions consumerMarkerOptions)
Sets custom marker options for marker type TripIntermediateDestination.
void
setTripPickupPointMarkerOptions(ConsumerMarkerOptions consumerMarkerOptions)
Sets custom marker options for marker type TripPickupPoint.
void
setTripVehicleMarkerOptions(ConsumerMarkerOptions consumerMarkerOptions)
Sets custom marker options for marker type TripVehicle.
void
setUndefinedTypeMarkerOptions(ConsumerMarkerOptions consumerMarkerOptions)
Sets custom marker options for undefined marker type.

Inherited Method Summary

Public Constructors

public ConsumerComposeViewModel ()

Public Methods

public LiveData<ConsumerPolylineOptions> getActiveRoutePolylineOptions ()

Gets the polyline options for type ActiveRoute. If the value is null, default options will be used.

public LiveData<ConsumerPolylineTrafficStyle> getActiveRoutePolylineTrafficStyle ()

Gets the style settings for traffic polylines of type ActiveRoute. If the value is null, traffic polylines for the type will not be visible.

public LiveData<CameraStateData> getCameraState ()

Gets the current camera state when Auto Camera is enabled.

public LiveData<Session> getCurrentActiveSession ()

Gets the current active session to be displayed in the UI.

public LiveData<Boolean> getIsAutoCameraEnabled ()

Gets the Auto Camera setting which updates camera according to route and user location.

public LiveData<Set<LiveData<ConsumerMarkerListData>>> getMarkerLists ()

Gets the set of marker lists to be displayed on the map.

public LiveData<Set<LiveData<ConsumerMarkerData>>> getMarkers ()

Gets the set of markers to be displayed on the map.

public LiveData<Set<LiveData<ConsumerPolylineData>>> getPolylines ()

Gets the set of polylines to be displayed on the map.

public LiveData<ProjectedRouteEta> getProjectedArrival ()

Gets the current projected arrival information for the trip.

public LiveData<ConsumerPolylineOptions> getRemainingRoutePolylineOptions ()

Gets the polyline options for type RemainingRoute. If the value is null, default options will be used.

public LiveData<ConsumerPolylineTrafficStyle> getRemainingRoutePolylineTrafficStyle ()

Gets the style settings for traffic polylines of type RemainingRoute. If the value is null, traffic polylines for the type will not be visible.

public LiveData<ConsumerMarkerOptions> getTripDropoffPointMarkerOptions ()

Gets the marker options for marker type TripDropoffPoint. If the value is null, default options will be used.

public LiveData<ConsumerMarkerOptions> getTripIntermediateDestinationMarkerOptions ()

Gets the marker options for marker type TripIntermediateDestination. If the value is null, default options will be used.

public LiveData<ConsumerMarkerOptions> getTripPickupPointMarkerOptions ()

Gets the marker options for marker type TripPickupPoint. If the value is null, default options will be used.

public LiveData<ConsumerMarkerOptions> getTripVehicleMarkerOptions ()

Gets the marker options for marker type TripVehicle. If the value is null, default options will be used.

public LiveData<ConsumerMarkerOptions> getUndefinedTypeMarkerOptions ()

Gets the marker options for undefined marker type. If the value is null, default options will be used.

public void setActiveRoutePolylineOptions (ConsumerPolylineOptions consumerPolylineOptions)

Sets custom polyline options for type ActiveRoute. If null, then default options are used.

public void setActiveRoutePolylineTrafficStyle (ConsumerPolylineTrafficStyle consumerTrafficPolylineStyle)

Sets the styles for traffic polylines of type ActiveRoute. If null, traffic polylines of this type are hidden.

public void setCurrentActiveSession (Session session)

Sets the current active session to be displayed in the UI. To clear the current active session, set this value to null.

public void setIsAutoCameraEnabled (Boolean isAutoCameraEnabled)

Sets whether Auto Camera is enabled. When enabled, the map's camera automatically animates according to trip data. Before making changes to the map's CameraPositionState, Auto Camera must be disabled.

public void setRemainingRoutePolylineOptions (ConsumerPolylineOptions consumerPolylineOptions)

Sets custom polyline options for type RemainingRoute. If null, then default options are used.

public void setRemainingRoutePolylineTrafficStyle (ConsumerPolylineTrafficStyle consumerTrafficPolylineStyle)

Sets the styles for traffic polylines of type RemainingRoute. If null, traffic polylines of this type are hidden.

public void setTripDropoffPointMarkerOptions (ConsumerMarkerOptions consumerMarkerOptions)

Sets custom marker options for marker type TripDropoffPoint. If null, then default options are used.

public void setTripIntermediateDestinationMarkerOptions (ConsumerMarkerOptions consumerMarkerOptions)

Sets custom marker options for marker type TripIntermediateDestination. If null, then default options are used.

public void setTripPickupPointMarkerOptions (ConsumerMarkerOptions consumerMarkerOptions)

Sets custom marker options for marker type TripPickupPoint. If null, then default options are used.

public void setTripVehicleMarkerOptions (ConsumerMarkerOptions consumerMarkerOptions)

Sets custom marker options for marker type TripVehicle. If null, then default options are used.

public void setUndefinedTypeMarkerOptions (ConsumerMarkerOptions consumerMarkerOptions)

Sets custom marker options for undefined marker type. If null, then default options are used.