MenuItem

data class MenuItem(val id: MenuItem.Id, val icon: DrawableResolver, val label: StringResolver) : Parcelable

Represents a MenuItem with an icon and a text label.

Parameters

id

A unique identifier for this menu item.

icon

A DrawableResolver that returns this menu item's icon. The provided icon can make use of a StateListDrawable to support different states, such as state_selected for when the menu item is selected.

label

A StringResolver that returns this menu item's label.

Constructors

Link copied to clipboard
fun MenuItem(idValue: String, @DrawableRes iconRes: Int, @StringRes labelResourceId: Int)
Link copied to clipboard

Types

Link copied to clipboard
data class Id(val value: String) : Parcelable

Uses value as the unique identifier of a MenuItem.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Inherited functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)