Implement advanced windowing

This section describes optimal uses of Scalable UI.

Enable the feature

Set the required flag in your System UI configuration file (config.xml or similar):

<bool name="config_enableScalableUI">true</bool>

Verify the system configuration

Verify that your system includes the required feature and disables any legacy or conflicting windowing features:

  • The system must include the feature, android.software.car.splitscreen_multitasking

  • Confirm that any legacy windowing or split-screen features that conflict with the new root-task model are disabled.

Define panels and variants

To declare all the config files that contain Panel configurations, add an array resource named window_states.

To address role mapping, Panels must use the role attribute to be mapped to the apps they host. role references an array of component names, such as role="@array/nav_components.

Define transitions

Within each Panel definition, define the transitions by mapping system or custom Events to a target Variant. For example, to define behavior for the navigation panel:

<Transitions>
    <Transition onEvent="_System_TaskOpenEvent" toVariant="@id/opened"/>
    <Transition onEvent="_System_HomeEvent" toVariant="@id/closed"/>
    <Transition onEvent="@string/event_system_nav_focus_lost" toVariant="@id/minimized"/>
</Transitions>