createCustomScreen

Creates a screen for a custom AANavigationState.Custom state.

Override this to provide screens for custom navigation states registered via AANavigationStateMachine's additional transitions. The default returns null, which means the coordinator will not push a screen for unhandled custom states.

Example

override fun createCustomScreen(carContext: CarContext, state: AANavigationState.Custom): Screen? {
return when (state.customScreenName) {
"Payment" -> PaymentScreen(carContext)
"POIDetails" -> POIDetailsScreen(carContext)
else -> null
}
}

Return

A Screen for the custom state, or null if not handled

Parameters

carContext

The CarContext from the Android Auto session

state

The custom state identifying which screen to create