core-ktx / androidx.view / android.view.Menu

Extensions for android.view.Menu

contains

operator fun Menu.contains(item: MenuItem): Boolean

Returns true if item is found in this menu.

forEach

fun Menu.forEach(action: (item: MenuItem) -> Unit): Unit

Performs the given action on each item in this menu.

forEachIndexed

fun Menu.forEachIndexed(action: (index: Int, item: MenuItem) -> Unit): Unit

Performs the given action on each item in this menu, providing its sequential index.

get

operator fun Menu.get(index: Int): MenuItem

Returns the menu at index.

isEmpty

fun Menu.isEmpty(): Boolean

Returns true if this menu contains no items.

isNotEmpty

fun Menu.isNotEmpty(): Boolean

Returns true if this menu contains one or more items.

iterator

operator fun Menu.iterator(): MutableIterator<MenuItem>

Returns a MutableIterator over the items in this menu.

size

val Menu.size: Int

Returns the number of items in this menu.