LogoLogo
ProductsUse casesDocsSupport
  • Introducing DriveKit
  • DriveKit Guides
  • Get started with drivekit
    • Trip recording lifecycle
    • iOS
      • πŸš€Quick start
      • Advanced configurations
      • References
      • iOS DriveKit Demo App
    • Android
      • πŸš€Quick start
      • Advanced configurations
      • References
      • Android DriveKit Demo App
      • Android 15 Migration guide
      • Android 14 Migration guide
      • Troubleshooting
  • Trip analysis
    • Introduction
    • iOS
      • Permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (iOS)
    • Android
      • Runtime permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
      • Android
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
    • REST services
      • Trip
      • References
    • Trip Simulator
      • iOS
      • Android
  • PERMISSIONS UTILS
    • Introduction
    • User interface
      • iOS
        • Get started
        • Main configurations
      • Android
        • Get started
        • Main configurations
  • COMMON UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
    • References
  • DRIVER DATA
    • Introduction
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
      • Android
        • Get Started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
  • Driver Data Timeline UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • Vehicle
    • Introduction
    • iOS
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (iOS)
    • Android
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Main configurations
        • Advanced configurations
      • Android
        • Get started
        • Main configurations
        • Advanced configurations
  • DRIVER ACHIEVEMENT
    • Introduction
    • iOS
      • Get started
    • Android
      • Get Started
    • User interface
      • iOS
      • Android
  • CHALLENGE
    • Introduction
    • Important challenge rules
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
      • Android
        • Get started
  • GROUP
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • React Native
    • Get started
    • Integration
  • Flutter
    • Get started
    • Integration
  • Push services
    • Introduction
    • Push Trip Data
    • Push Deleted trip
    • Push Crash Data
    • Push Diagnosis Data
  • ADMIN SERVICES
    • Beacon
      • Add
      • Replace
      • Delete
      • Configuration
    • Challenges
      • List of challenges
      • Challenge details
      • Registered users
      • Challenge ranking
      • Users' progress
      • Definitions
    • Customer
      • Activity timeline
    • Driver
      • Timeline
      • Synthesis
      • Identity
      • Status
      • Add or update a metadata
      • Vehicles
      • Profile
      • Application diagnoses
    • Drivers
      • Account
      • Statistics
      • Ranking
      • Expired accounts
    • Group
      • Timeline
      • Synthesis
    • Trips
      • Add or update a metadata
      • Delete a metadata
    • Vehicle
      • Create
      • Characteristics
      • Configuration
      • Statistics
      • Update mileage
      • Tire and brake wear update
      • References
  • Crashes
    • Annotate a crash
    • Revoke crash location URL
  • ENTERPRISE SERVICES
    • Introduction
    • Teams
      • Create a team
      • List of teams
      • Enable or disable a team
    • Hyper-admins
      • Create a hyper-admin
      • List of hyper-admins
      • Delete a hyper-admin
    • Monitoring
      • Get a push trip data report
      • Get a push crash data report
      • Request to retry failed trips
      • Request to retry failed crashes
      • Get the status of a task
  • Release notes
    • Changelog
      • iOS
      • Android
      • UI iOS
      • UI Android
Powered by GitBook
On this page
  • Get the module
  • Initialize
  • Override colors and texts
  • Select Streak themes
  • Display streak list interface
  • By creating a Fragment
  • By launching an Activity
  • Select Badges categories
  • Display Badge list interface
  • By creating a Fragment
  • By launching an Activity
  • Select ranking themes
  • Set ranking selectors
  • Configure ranking depth
  • Display Ranking interface
  • By creating a Fragment
  • By launching an Activity

Was this helpful?

Export as PDF
  1. DRIVER ACHIEVEMENT
  2. User interface

Android

PreviousiOSNextIntroduction

Last updated 1 year ago

Was this helpful?

Get the module

To add the Driver Achievement UI module to your app, add the following lines to your dependencies in your application build.gradle file:

dependencies {
    implementation 'com.drivequant.drivekit:drivekit-driver-achievement-ui:$drivekitui_version'
}

Replace $drivekitui_version with the DriveKit version you are using in your app

On a, you also have a demo app and source code of Driver Achievement UI that you can use as an example.

Initialize

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:

fun initialize()

Override colors and texts

To override colors and texts in the Driver Achievement UI SDK, see .

Select Streak themes

You can choose which streak theme you want to display in which order, by calling the following method:

fun configureStreakThemes(streakThemes: List<StreakTheme>)

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.

Display streak list interface

To display the streak list UI, you can call the following methods:

By creating a Fragment

val fragment = DriverAchievementUI.createStreakListFragment()

By launching an Activity

DriverAchievementUI.startRankingActivity(context)

Select Badges categories

You can choose which badge category you want to display in which order, by calling the following method:

fun configureBadgeCategories(badgeCategories: MutableList<BadgeCategory>)

Accepted values:

  • GENERIC

  • SAFETY

  • ECO_DRIVING

  • PHONE_DISTRACTION

Default value:

listOf(GENERIC, PHONE_DISTRACTION, SAFETY, ECO_DRIVING)

Display Badge list interface

To show the badge UI you can use these following methods:

By creating a Fragment

supportFragmentManager
    .beginTransaction()
    .replace(R.id.yourContainer, BadgesListFragment())
    .commit()

By launching an Activity

val intent = Intent(context, BadgeListActivity::class.java)
context.startActivity(intent)

Select ranking themes

By calling the following method, you can choose which rank type you want to display:

fun configureRankingTypes(rankingTypes: List<RankingType>)

Accepted values:

  • RankingType.SAFETY

  • RankingType.ECO_DRIVING

  • RankingType.DISTRACTION

  • RankingType.SPEEDING

Default values [RankingType.SAFETY, RankingType.ECO_DRIVING, RankingType.DISTRACTION]

Set ranking selectors

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:

fun configureRankingSelector(rankingSelector: RankingSelectorType)

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:

 val rankingSelectorType = RankingSelectorType.NONE
 DriverAchievementUI.configureRankingSelector(rankingSelectorType)

In this case, the period of the ranking is weekly

Configure ranking depth

This method allows you to choose the ranking depth you want to display:

fun configureRankingDepth(rankingDepth: Int)
int rankingDepthValue = 20;
DriverAchievementUI.INSTANCE.configureRankingDepth(rankingDepthValue);

Accepted values: from 5 to 20

Default value: 5

Display Ranking interface

To display the ranking interface, you can call the following methods:

By creating a Fragment

RankingFragment.newInstance()

By launching an Activity

RankingActivity.launchActivity(context)
Github repository
Common UI configuration
disabled the SDK auto-initialization