Trips widgets
This section introduces graphical elements that simplify the display of driver behaviour scores synthesis.

Driver synthesis scorecard

The Driver Data component includes a component to visualise the average performance of a driver.
The synthesis scorecard shows as main information the averages of each of the driving scores calculated over a 7 days since the last trip date.
The synthesis scorecard also indicates, over this period, the number of trips performed as well as the total distance and driving duration.
The component allows you to select the scores displayed and the order in which they are displayed. To move from one score to another, simply swipe the scorecards.
To include the scorecards into your app, call the following method:
Kotlin
Java
1
DriverDataUI.getLastTripsSynthesisCardsView(
2
listOf(
3
LastTripsSynthesisCard.SAFETY,
4
LastTripsSynthesisCard.ECO_DRIVING,
5
LastTripsSynthesisCard.ECO_DRIVING,
6
LastTripsSynthesisCard.SPEEDING
7
), object : SynthesisCardsViewListener {
8
override fun onViewLoaded(fragment: DKSynthesisCardViewPagerFragment) {
9
10
}
11
})
Copied!
1
final ArrayList<LastTripsSynthesisCard> cards = new ArrayList<>();
2
cards.add(LastTripsSynthesisCard.SAFETY);
3
cards.add(LastTripsSynthesisCard.ECO_DRIVING);
4
cards.add(LastTripsSynthesisCard.DISTRACTION);
5
cards.add(LastTripsSynthesisCard.SPEEDING);
6
DriverDataUI.INSTANCE.getLastTripsSynthesisCardsView(cards, new SynthesisCardsViewListener() {
7
@Override
8
public void onViewLoaded(@NotNull DKSynthesisCardViewPagerFragment fragment) {
9
10
}
11
});
Copied!
The order in which the scorecards are displayed corresponds to the order of the items in the table. To hide a theme, simply do not add it to the table.
The value SPEEDING can be set only if this configuration is enabled for your API key.

Last trip widget

The Driver Data component includes a widget to display a short chronological list of the driver's last trips.
With the last trip widget, the driver can get a quick overview of his last 10 trips with a simple swipe.
Each small card corresponds to a trip and the user can access the full details and map view by tapping on the current card.
By selecting the last card, the user can access the list of all the trips.
​​To include the last trip widget into your app, call the following method:
Kotlin
Java
1
val fragment = DriverDataUI.getLastTripsView(HeaderDay.DURATION)And embed the returned view into your layout.
Copied!
1
Fragment fragment = DriverDataUI.INSTANCE.getLastTripsView(HeaderDay.DURATION);
Copied!
Last modified 2mo ago
Export as PDF
Copy link