ConsumerController

public interface ConsumerController

Controls ridesharing features associated with ConsumerMapFragment. When the Fragment is destroyed, your app should remove all references to this class.

Nested Class Summary

class ConsumerController.OnConsumerMarkerClickCallback Callback invoked when an SDK marker is clicked or tapped. 
class ConsumerController.OnProjectedRouteUpdateCallback Callback invoked when the vehicle marker moves along the projected route polyline. 

Public Method Summary

abstract Session
getActiveSession()
Returns the session that is currently showing.
abstract CameraUpdate
getCameraUpdate()
Returns the CameraUpdate used to position the map if autocamera is enabled.
abstract ConsumerMapStyle
getConsumerMapStyle()
Returns methods for customizing UI elements managed by ConsumerMapFragment.
abstract Marker
getConsumerMarker(int markerType)
Returns the Marker instance used by the SDK for the given type, if it exists.
abstract void
hideAllSessions()
Hides any session that is currently showing.
abstract boolean
isAutoCameraEnabled()
Returns a boolean value that indicates whether the camera is set to automatically center and/or zoom.
abstract void
setAutoCameraEnabled(boolean enable)
Sets the camera to automatically center and/or zoom when a session is active.
abstract void
setOnConsumerMarkerClickCallback(ConsumerController.OnConsumerMarkerClickCallback callback)
Sets the callback that is invoked when a marker is clicked.
abstract void
setOnProjectedRouteUpdateCallback(ConsumerController.OnProjectedRouteUpdateCallback callback)
Sets the callback that is invoked when the projected route is updated.
abstract void
showSession(Session session)
Shows the requested session.

Public Methods

public abstract Session getActiveSession ()

Returns the session that is currently showing.

public abstract CameraUpdate getCameraUpdate ()

Returns the CameraUpdate used to position the map if autocamera is enabled. Returns null if there is no active session.

public abstract ConsumerMapStyle getConsumerMapStyle ()

Returns methods for customizing UI elements managed by ConsumerMapFragment.

public abstract Marker getConsumerMarker (int markerType)

Returns the Marker instance used by the SDK for the given type, if it exists.

Note that marker instances may become obsolete as the SDK redraws its UI components on the map. Use caution when referencing or interacting with them.

Also note that mutations on marker properties made directly through Maps APIs instead of Consumer SDK APIs may result on an out-of-synchronization state.

Parameters
markerType The MarkerType of the marker

public abstract void hideAllSessions ()

Hides any session that is currently showing.

public abstract boolean isAutoCameraEnabled ()

Returns a boolean value that indicates whether the camera is set to automatically center and/or zoom.

public abstract void setAutoCameraEnabled (boolean enable)

Sets the camera to automatically center and/or zoom when a session is active.

public abstract void setOnConsumerMarkerClickCallback (ConsumerController.OnConsumerMarkerClickCallback callback)

Sets the callback that is invoked when a marker is clicked.

public abstract void setOnProjectedRouteUpdateCallback (ConsumerController.OnProjectedRouteUpdateCallback callback)

Sets the callback that is invoked when the projected route is updated.

public abstract void showSession (Session session)

Shows the requested session. The camera will initially zoom to the calculated zoom level, but autocamera settings will not change.