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)
// ...
}

Then pass it to the coordinator:

val coordinator = AANavigationCoordinator(carContext, myScreenFactory)

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
abstract fun createRoutePreviewScreen(carContext: CarContext): Screen

Creates the route preview screen.

Link copied to clipboard
abstract fun createSearchScreen(carContext: CarContext): Screen

Creates the search/destination screen.