ActionMenuView

open class ActionMenuView : LinearLayoutCompat, ItemInvoker, MenuView
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.appcompat.widget.LinearLayoutCompat
   ↳ androidx.appcompat.widget.ActionMenuView

ActionMenuView is a presentation of a series of menu options as a View. It provides several top level options as action buttons while spilling remaining options over as items in an overflow menu. This allows applications to present packs of actions inline with specific or repeating content.

Summary

Nested classes

open

abstract

Interface responsible for receiving menu item click events if the items themselves do not have individual item click listeners.

Inherited constants

Public constructors

<init>(context: Context!)

<init>(context: Context!, attrs: AttributeSet!)

Public methods

open Unit

Dismiss any popups associated with this menu view.

open Boolean

open ActionMenuView.LayoutParams!

open Menu!

Returns the Menu object that this ActionMenuView is currently presenting.

open Drawable?

Return the current drawable used as the overflow icon.

open Int

open Boolean

Hide the overflow items from the associated menu.

open Boolean

Check whether the overflow menu is currently showing.

open Unit

open Unit

open Unit

open Unit
setOverflowIcon(@Nullable icon: Drawable?)

Set the icon to use for the overflow button.

open Unit
setPopupTheme(@StyleRes resId: Int)

Specifies the theme to use when inflating popup menus.

open Boolean

Show the overflow items from the associated menu.

Protected methods

open Boolean

open ActionMenuView.LayoutParams!

open ActionMenuView.LayoutParams!

open Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Inherited functions

Public constructors

<init>

ActionMenuView(context: Context!)

<init>

ActionMenuView(context: Context!, attrs: AttributeSet!)

Public methods

dismissPopupMenus

open fun dismissPopupMenus(): Unit

Dismiss any popups associated with this menu view.

dispatchPopulateAccessibilityEvent

open fun dispatchPopulateAccessibilityEvent(event: AccessibilityEvent!): Boolean

generateLayoutParams

open fun generateLayoutParams(attrs: AttributeSet!): ActionMenuView.LayoutParams!

getMenu

open fun getMenu(): Menu!

Returns the Menu object that this ActionMenuView is currently presenting.

Applications should use this method to obtain the ActionMenuView's Menu object and inflate or add content to it as necessary.

Return
Menu!: the Menu presented by this view

getOverflowIcon

@Nullable open fun getOverflowIcon(): Drawable?

Return the current drawable used as the overflow icon.

Return
Drawable?: The overflow icon drawable

getPopupTheme

open fun getPopupTheme(): Int
Return
Int: resource identifier of the theme used to inflate popup menus, or 0 if menus are inflated against the action menu view theme

hideOverflowMenu

open fun hideOverflowMenu(): Boolean

Hide the overflow items from the associated menu.

Return
Boolean: true if the menu was able to be hidden, false otherwise

isOverflowMenuShowing

open fun isOverflowMenuShowing(): Boolean

Check whether the overflow menu is currently showing. This may not reflect a pending show operation in progress.

Return
Boolean: true if the overflow menu is currently showing

onConfigurationChanged

open fun onConfigurationChanged(newConfig: Configuration!): Unit

onDetachedFromWindow

open fun onDetachedFromWindow(): Unit

setOnMenuItemClickListener

open fun setOnMenuItemClickListener(listener: ActionMenuView.OnMenuItemClickListener!): Unit

setOverflowIcon

open fun setOverflowIcon(@Nullable icon: Drawable?): Unit

Set the icon to use for the overflow button.

Parameters
icon Drawable?: Drawable to set, may be null to clear the icon

setPopupTheme

open fun setPopupTheme(@StyleRes resId: Int): Unit

Specifies the theme to use when inflating popup menus. By default, uses the same theme as the action menu view itself.

Parameters
resId Int: theme used to inflate popup menus

See Also

showOverflowMenu

open fun showOverflowMenu(): Boolean

Show the overflow items from the associated menu.

Return
Boolean: true if the menu was able to be shown, false otherwise

Protected methods

checkLayoutParams

protected open fun checkLayoutParams(p: LayoutParams!): Boolean

generateDefaultLayoutParams

protected open fun generateDefaultLayoutParams(): ActionMenuView.LayoutParams!

generateLayoutParams

protected open fun generateLayoutParams(p: LayoutParams!): ActionMenuView.LayoutParams!

onLayout

protected open fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int): Unit

onMeasure

protected open fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit