MenuService

interface MenuService

This service is responsible for providing the MenuItems to show in a menu frontend and indicating which (if any) MenuItem is currently selected.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val menuItems: List<MenuItem>

The list of MenuItems to display in a menu frontend.

Link copied to clipboard
abstract val selectedMenuItemId: MenuItem.Id?

The MenuItem.Id of the currently selected MenuItem or null if no MenuItem is selected.

Link copied to clipboard
abstract val showMenuItemCaptions: Boolean

Whether captions should be shown next to menu items when presented by a menu frontend.

Functions

Link copied to clipboard
abstract suspend fun onFrontendFocused(id: MenuItem.Id?)

Should be called when the frontend focus in the system UI has changed. id is the menu item that users use to access the focused frontend. id can be null to indicate that the focused frontend does not have a menu item.

Link copied to clipboard
abstract suspend fun onMenuItemClicked(id: MenuItem.Id)

May be called upon clicking a MenuItem in a menu frontend.

Link copied to clipboard
abstract suspend fun toggleLabelVisibility()

Debug API, Toggle the visibility of the labels