Callback registered with
TripModel.registerTripCallback(LifecycleOwner, boolean, TripModelCallback)
or
TripModel.registerTripCallback(TripModelCallback)
.
Trip related data can be temporarily unavailable at scheduled callback due to factors like
weak or lost mobile signal in the reporting vehicle. Value of the related field will be
null
in that scenario. Please treat it accordingly and expect
nonnull
data at subsequent callbacks.
Public Constructor Summary
Public Method Summary
void |
onTripActiveRouteRemainingDistanceUpdated(TripInfo
tripInfo, Integer
distanceMeters)
Called when the remaining distance of the active leg has changed.
|
void |
onTripActiveRouteTrafficUpdated(TripInfo
tripInfo,
TrafficData trafficData)
Called when the traffic conditions on the active route have changed.
|
void | |
void |
onTripDropoffLocationUpdated(TripInfo
tripInfo,
TerminalLocation dropoff)
Called when the trip's dropoff location is updated.
|
void |
onTripDropoffTimeUpdated(TripInfo
tripInfo, Long timestampMillis)
Called when the vehicle's arrival time or estimated arrival time at the dropoff
point is updated.
|
void |
onTripETAToNextWaypointUpdated(TripInfo
tripInfo, Long timestampMillis)
Called when the estimated arrival time of the vehicle at the next waypoint
(which may or may not belong to the named trip) has changed.
|
void |
onTripIntermediateDestinationsUpdated(TripInfo
tripInfo, List<TerminalLocation>
intermediateDestinations)
Called when the trip's list of intermediate destinations has changed.
|
void |
onTripPickupLocationUpdated(TripInfo
tripInfo,
TerminalLocation pickup)
Called when the trip's pickup location is updated.
|
void |
onTripDropoffTimeUpdated(TripInfo
tripInfo, Long timestampMillis)
onTripETAToNextWaypointUpdated(TripInfo
tripInfo, Long timestampMillis)
Called when the estimated arrival time of the vehicle at the next waypoint
(which may or may not belong to the named trip) has changed.
|
void |
onTripIntermediateDestinationsUpdated(TripInfo
tripInfo, List<TerminalLocation>
intermediateDestinations)
Called when the trip's list of intermediate destinations has changed.
|
void |
onTripPickupLocationUpdated(TripInfo
tripInfo,
TerminalLocation pickup)
Called when the trip's pickup location is updated.
|
void |
onTripPickupTimeUpdated(TripInfo
tripInfo, Long timestampMillis)
Called when the vehicle's arrival time or estimated arrival time at the pickup
point is updated.
|
void |
onTripRemainingRouteDistanceUpdated(TripInfo
tripInfo, Integer
distanceMeters)
Called when the distance of the remaining route has changed.
|
void |
onTripRemainingRouteTrafficUpdated(TripInfo
tripInfo,
TrafficData trafficData)
Called when the traffic conditions on the remaining route have changed.
|
void |
onTripRemainingRouteUpdated(TripInfo
tripInfo,
Route route)
Called when the remaining route has changed.
|
void |
onTripRemainingWaypointsUpdated(TripInfo
tripInfo, List<TripWaypoint>
waypointList)
Called when the trip's list of remaining waypoints has changed.
|
void | |
void |
onTripStatusUpdated(TripInfo
tripInfo, int status)
This method is deprecated. Use
onTripStatusUpdate(TripInfo, int) instead. This method will be
removed in the next major release.
|
void |
onTripUpdateError(TripInfo
tripInfo,
TripUpdateError error)
Called when there is an error updating the trip state, typically due to a
network connectivity error.
|
void |
onTripUpdated(TripInfo
tripInfo)
Called when the scheduled update has been completed and the
TripModelCallback callbacks have been completed for any changed
data.
|
void |
onTripVehicleLocationUpdated(TripInfo
tripInfo,
VehicleLocation vehicleLocation)
Called when the trip's vehicle location is updated.
|
Inherited Method Summary
Public Constructors
public TripModelCallback ()
Public Methods
public void onTripActiveRouteRemainingDistanceUpdated (TripInfo tripInfo, Integer distanceMeters)
Called when the remaining distance of the active leg has changed. The active leg is the route from the vehicle until the next waypoint belonging to the trip.
Parameters
tripInfo | Current trip information. |
---|---|
distanceMeters | The length of the remaining leg, in meters. null value means this
data is temporarily unavailable at scheduled callback. |
public void onTripActiveRouteTrafficUpdated (TripInfo tripInfo, TrafficData trafficData)
Called when the traffic conditions on the active route have changed.
Parameters
tripInfo | Current trip information. |
---|---|
trafficData | The updated traffic information. null value means this data is
temporarily unavailable at scheduled callback. |
public void onTripActiveRouteUpdated (TripInfo tripInfo, Route route)
Called when the route is updated.
Parameters
tripInfo | Current trip information. |
---|---|
route | the trip vehicle's route. null value means this data is
temporarily unavailable at scheduled callback. |
public void onTripDropoffLocationUpdated (TripInfo tripInfo, TerminalLocation dropoff)
Called when the trip's dropoff location is updated.
Parameters
tripInfo | Current trip information. |
---|---|
dropoff |
TerminalLocation of the updated dropoff location. null
value means this data is temporarily unavailable at scheduled callback. |
public void onTripDropoffTimeUpdated (TripInfo tripInfo, Long timestampMillis)
Called when the vehicle's arrival time or estimated arrival time at the dropoff point is updated. Before the vehicle arrives, it is an estimate; after, it is the actual arrival time.
Parameters
tripInfo | Current trip information. |
---|---|
timestampMillis | milliseconds of UTC time since Unix epoch. null value means this
data is temporarily unavailable at scheduled callback. |
public void onTripETAToNextWaypointUpdated (TripInfo tripInfo, Long timestampMillis)
Called when the estimated arrival time of the vehicle at the next waypoint (which may or may not belong to the named trip) has changed.
Parameters
tripInfo | Current trip information. |
---|---|
timestampMillis | milliseconds of UTC time since Unix epoch. null value means this
data is temporarily unavailable at scheduled callback. |
public void onTripIntermediateDestinationsUpdated (TripInfo tripInfo, List<TerminalLocation> intermediateDestinations)
Called when the trip's list of intermediate destinations has changed.
Parameters
tripInfo | Current trip information. |
---|---|
intermediateDestinations | The updated list of intermediate destination locations. |
public void onTripPickupLocationUpdated (TripInfo tripInfo, TerminalLocation pickup)
Called when the trip's pickup location is updated.
Parameters
tripInfo | Current trip information. |
---|---|
pickup |
TerminalLocation of the updated pickup location. null value
means this data is temporarily unavailable at scheduled callback. |
public void onTripPickupTimeUpdated (TripInfo tripInfo, Long timestampMillis)
Called when the vehicle's arrival time or estimated arrival time at the pickup point is updated. Before the vehicle arrives, it is an estimate; after, it is the actual arrival time.
Parameters
tripInfo | Current trip information. |
---|---|
timestampMillis | milliseconds of UTC time since Unix epoch. null value means this
data is temporarily unavailable at scheduled callback. |
public void onTripRemainingRouteDistanceUpdated (TripInfo tripInfo, Integer distanceMeters)
Called when the distance of the remaining route has changed.
Parameters
tripInfo | Current trip information. |
---|---|
distanceMeters | The length of the remaining leg, in meters. null value means this
data is temporarily unavailable at scheduled callback. |
public void onTripRemainingRouteTrafficUpdated (TripInfo tripInfo, TrafficData trafficData)
Called when the traffic conditions on the remaining route have changed.
Parameters
tripInfo | Current trip information. |
---|---|
trafficData | The updated traffic information. null value means this data is
temporarily unavailable at scheduled callback. |
public void onTripRemainingRouteUpdated (TripInfo tripInfo, Route route)
Called when the remaining route has changed. This will only be triggered when the driver deviates from the original route, when the remaining route traffic data has changed, or when the remaining route waypoints have changed.
Parameters
tripInfo | Current trip information. |
---|---|
route | the trip vehicle's route. null value means this data is
temporarily unavailable at scheduled callback. |
public void onTripRemainingWaypointsUpdated (TripInfo tripInfo, List<TripWaypoint> waypointList)
Called when the trip's list of remaining waypoints has changed.
Parameters
tripInfo | Current trip information. |
---|---|
waypointList | The updated list of remaining waypoints. |
public void onTripStatusUpdate (TripInfo tripInfo, int status)
Called when the
TripInfo.TripStatus
is updated.
Parameters
tripInfo | Current trip information. |
---|---|
status | The current status of the trip. |
public void onTripStatusUpdated (TripInfo tripInfo, int status)
This method is deprecated.
Use
onTripStatusUpdate(TripInfo, int)
instead. This method will be removed in the
next major release.
Called when the
TripInfo.TripStatus
is updated.
Parameters
tripInfo | Current trip information. |
---|---|
status | The current status of the trip. |
public void onTripUpdateError (TripInfo tripInfo, TripUpdateError error)
Called when there is an error updating the trip state, typically due to a network connectivity error.
Parameters
tripInfo | Current trip information. |
---|---|
error | The error. |
public void onTripUpdated (TripInfo tripInfo)
Called when the scheduled update has been completed and the
TripModelCallback
callbacks have been completed for any changed data. Called
every time the trip is updated even if no data has changed. The update interval can be
modified in
TripModel.setTripModelOptions(TripModelOptions)
.
Parameters
tripInfo | Current trip information. |
---|
public void onTripVehicleLocationUpdated (TripInfo tripInfo, VehicleLocation vehicleLocation)
Called when the trip's vehicle location is updated.
Parameters
tripInfo | Current trip information. |
---|---|
vehicleLocation | The trip vehicle's updated location information. |