Frontend

abstract class Frontend(val frontendContext: FrontendContext) : LifecycleOwner

The base class for Frontends in the IVI system.

A Frontend exposes pieces of the overall user interface. For example, there could be a Frontend for the main menu and one for the map view. A frontend can expose multiple panels at the same time, like a main panel and a panel for a notification. A frontend can also be headless, like a phone Frontend that might not show a panel until a phone call starts.

A Frontend implementation is responsible for the logic to add Panels by calling Frontend.addPanel or Frontend.addPanels. This responsibility can be delegated to other classes.

Parameters

frontendContext

An entry point for this Frontend to communicate with the rest of the system. This frontend context may not be reused by any other frontend.

Constructors

Link copied to clipboard
constructor(frontendContext: FrontendContext)

Properties

Link copied to clipboard
Link copied to clipboard

Whether the frontend is ready to be presented to the user.

Link copied to clipboard
open override val lifecycle: Lifecycle
Link copied to clipboard

The panels that are added to Frontend. Panels can be attached or detached to the system UI. When a Frontend is dismissed, or when a panel is destroyed by other means, it is removed.

Functions

Link copied to clipboard
open fun onCreate()
Link copied to clipboard
open fun onDestroy()
Link copied to clipboard
open fun openTaskPanels()

Open any initial task panels for this Frontend. By default a frontend opens its main panel, chosen with createMainTaskPanel. Alternatively, openTaskPanels can be overridden to decide which, if any, panels to open. Implementations of this method can call addPanel or addPanels to open panels. It is acceptable to open no panels at all.

Link copied to clipboard

Removes a panel from the Frontend.

Link copied to clipboard
inline fun <P : AnyPanel> removePanels(): Boolean

Removes all Panels of type P from the Frontend.

Removes all items of panels from the Frontend.

fun <P : AnyPanel> removePanels(panelType: KClass<P>): Boolean

Removes all Panels of type panelType from the Frontend.

Link copied to clipboard
open override fun toString(): String