Android
Last updated
Was this helpful?
Last updated
Was this helpful?
To add the Driver Achievement UI module to your app, add the following lines to your dependencies in your application build.gradle file:
On a, you also have a demo app and source code of Driver Achievement UI that you can use as an example.
If you have , the Driver Achievement UI module must also be manually initialized.
Then, to initialize the module in your app, you must call the initialization method in onCreate
method of your Application class:
To override colors and texts in the Driver Achievement UI SDK, see .
You can choose which streak theme you want to display in which order, by calling the following method:
Accepted values:
PHONE_DISTRACTION
SAFETY
ACCELERATION
BRAKE
ADHERENCE
SPEEDING
CALL
Default value:
listOf(PHONE_DISTRACTION, SAFETY, ACCELERATION, BRAKE, ADHERENCE, CALL)
For SPEEDING streaks, make sure that the service is activated on your DriveQuant account.
To display the streak list UI, you can call the following methods:
Fragment
Activity
You can choose which badge category you want to display in which order, by calling the following method:
Accepted values:
GENERIC
SAFETY
ECO_DRIVING
PHONE_DISTRACTION
Default value:
listOf(GENERIC, PHONE_DISTRACTION, SAFETY, ECO_DRIVING)
To show the badge UI you can use these following methods:
Fragment
Activity
By calling the following method, you can choose which rank type you want to display:
Accepted values:
RankingType.SAFETY
RankingType.ECO_DRIVING
RankingType.DISTRACTION
RankingType.SPEEDING
Default values [RankingType.SAFETY
, RankingType.ECO_DRIVING
, RankingType.DISTRACTION
]
You can have many periods displayed on the ranking screen. This way, the user can see his ranking on many periods. The following method allows you to selected the order of the displayed periods:
Accepted values :
RankingPeriod.WEEKLY
,
RankingPeriod.MONTHLY
,
RankingPeriod.ALL_TIME
Default value: [RankingPeriod.WEEKLY
, RankingPeriod.MONTHLY
, RankingPeriod.ALL_TIME
]
If you donβt need any kind of selectors you can use the following code:
This method allows you to choose the ranking depth you want to display:
Accepted values: from 5
to 20
Default value: 5
To display the ranking interface, you can call the following methods:
Fragment
Activity