If you need to programmatically display the stop trip confirmation dialog (for example, when the user taps a start trip notification), you can call the public method showConfirmationDialog() of the DKTripRecordingButton instance.
Warning: This dialog won’t appear if the DKTripRecordingUserMode doesn’t allow the user to end a trip.
Trip recording widget configurations
The button has 4 configurations to cover all possible scenarios, and its display can be adjusted using the tripRecordingUserMode parameter.
NONE: The button is hidden and the trip recording is fully automatic. This is the simplest mode, and the one we prefer.
START_STOP: The button is displayed and the user has total control over the trip recording cycle: start, stop and cancel. In this configuration, autostart remains active.
START_ONLY: The user can start a trip manually but cannot stop or cancel it under any circumstances. Recording stops automatically. In this configuration, autostart remains active.
STOP_ONLY: The user cannot start a trip manually. The start of a trip is detected automatically. The user can only stop the trip to get his results or cancel the recording
The default value is START_STOP.
To set the button mode, call the following method: