FocusMenuItemOnTaskPanelChangeFrontendCoordinationRule

A rule that informs the MenuService of the focused menu item based on which Panels are active. When there is an activeTaskPanelStackData, the corresponding Frontend's menu item is focused. Otherwise, the menu item of the Frontend that owns the activeHomePanel is focused.

Parameters

getMenuItemId

A function that allows the rule to retrieve the MenuItem.Id from the focused FrontendContext in order to inform the MenuService which menu item to focus.

activeHomePanel

The HomePanel that indicates which Frontend is focused if there is no active TaskPanelStackData.

activeTaskPanelStackData

The TaskPanelStackData to observe in order to determine the focused frontend.

Constructors

constructor(getMenuItemId: (FrontendContext) -> MenuItem.Id?, panelRegistry: IviPanelRegistry)

A convenience constructor that extracts the default HomePanel and TaskPanelStackData from the given panelRegistry.

constructor(getMenuItemId: (FrontendContext) -> MenuItem.Id?, activeHomePanel: LiveData<HomePanel?>, activeTaskPanelStackData: LiveData<TaskPanelStackData>)

Functions

Link copied to clipboard
open override fun activate(lifecycleOwner: LifecycleOwner, iviServiceProvider: IviInstanceBoundIviServiceProvider, frontends: LiveData<out Collection<Frontend>>)

Actives the rule within the scope of the given lifecycleOwner.