Get started
To add Vehicle module to your app, add the following line to your dependencies in your application build.gradle file:
dependencies {
implementation 'com.drivequant.drivekit:drivekit-vehicle-ui:$drivekitui_version'
}
Replace
$drivekitui_version
with the DriveKit version you are using in your appOn a Github repository, you can find a demo app and the source code of Vehicle UI that you can use as an example.
You must initialize the UI module with that following method:
Kotlin
Java
DriveKitVehicleUI.initialize()
DriveKitVehicleUI.INSTANCE.initialize();
This method will configure the module with default values for the parameters:
VehicleTypes
, maxVehicles
, categoryConfigType
, detectionModes
.For each of these parameters, you will find below their related descriptions.
To display the vehicle list to the driver, just call the following method:
Kotlin
Java
DriveKitNavigationController.vehicleUIEntryPoint?.startVehicleListActivity(context)
final VehicleUIEntryPoint vehiclesEntryPoint = DriveKitNavigationController.INSTANCE.getVehicleUIEntryPoint();
if (vehiclesEntryPoint != null) {
vehiclesEntryPoint.startVehicleListActivity(getContext());
}
To display the vehicle detail, just call the following method:
Kotlin
Java
DriveKitNavigationController.vehicleUIEntryPoint?.startVehicleDetailActivity(context, vehicleId)
final VehicleUIEntryPoint vehiclesEntryPoint = DriveKitNavigationController.INSTANCE.getVehicleUIEntryPoint();
if (vehiclesEntryPoint != null) {
vehiclesEntryPoint.startVehicleDetailActivity(getContext(), vehicleId);
}
To display vehicle selection screens, just call the following method:
Kotlin
Java
VehiclePickerActivity.launchActivity(
context: Context,
vehicleToDelete: Vehicle? = null,
listener : VehiclePickerCompleteListener? = null)
VehiclePickerActivity.Companion.launchActivity(context: Context);
VehiclePickerCompleteListener
: This callback is called when VehiclePickerActivity has finishedvehicleToDelete
: If you want to replace your vehicle, you can use this parameter, it will delete and create a new one.
Last modified 1yr ago