AAScreenFactory
interface AAScreenFactory
Factory for creating app-specific Android Auto Screen instances.
The SDK's AANavigationCoordinator uses this factory to instantiate screens based on state machine transitions without knowing the concrete screen types. This decouples the SDK's navigation logic from app-specific screen implementations.
Usage
Implement this interface with your app's screen classes:
class MyScreenFactory : AAScreenFactory {
override fun createSearchScreen(carContext: CarContext) =
MySearchScreen(carContext)
override fun createRoutePreviewScreen(carContext: CarContext) =
MyRoutePreviewScreen(carContext)
// ...
}Content copied to clipboard
Then pass it to the coordinator:
val coordinator = AANavigationCoordinator(carContext, myScreenFactory)Content copied to clipboard
See also
Functions
Link copied to clipboard
Creates a screen for a custom AANavigationState.Custom state.
Link copied to clipboard
abstract fun createNavigationScreen(carContext: CarContext, destinationTitle: String, useDemoMode: Boolean, isSyncPush: Boolean = false): Screen
Creates the active navigation/guidance screen.
Link copied to clipboard
Creates the route preview screen.
Link copied to clipboard
Creates the search/destination screen.