Added in API level 21

ActionMenuView


open class ActionMenuView : LinearLayout
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.LinearLayout
   ↳ android.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 XML attributes
Inherited constants
Public constructors

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

Public methods
open Unit

Dismiss any popups associated with this menu view.

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

Set the icon to use for the overflow button.

open Unit

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
Inherited properties

Public constructors

ActionMenuView

Added in API level 21
ActionMenuView(context: Context!)

ActionMenuView

Added in API level 21
ActionMenuView(
    context: Context!,
    attrs: AttributeSet!)

Public methods

dismissPopupMenus

Added in API level 21
open fun dismissPopupMenus(): Unit

Dismiss any popups associated with this menu view.

generateLayoutParams

Added in API level 21
open fun generateLayoutParams(attrs: AttributeSet!): ActionMenuView.LayoutParams!
Parameters
attrs AttributeSet!: the attributes to build the layout parameters from
Return
ActionMenuView.LayoutParams! an instance of android.view.ViewGroup.LayoutParams or one of its descendants

getMenu

Added in API level 21
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

Added in API level 23
open fun getOverflowIcon(): Drawable?

Return the current drawable used as the overflow icon.

Return
Drawable? The overflow icon drawable This value may be null.

getPopupTheme

Added in API level 21
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

Added in API level 21
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

Added in API level 21
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

Added in API level 21
open fun onConfigurationChanged(newConfig: Configuration!): Unit
Parameters
newConfig Configuration!: The new resource configuration.

onDetachedFromWindow

Added in API level 21
open fun onDetachedFromWindow(): Unit

setOnMenuItemClickListener

Added in API level 21
open fun setOnMenuItemClickListener(listener: ActionMenuView.OnMenuItemClickListener!): Unit

setOverflowIcon

Added in API level 23
open fun setOverflowIcon(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

Added in API level 21
open fun setPopupTheme(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

Added in API level 21
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

Added in API level 21
protected open fun checkLayoutParams(p: ViewGroup.LayoutParams!): Boolean

generateDefaultLayoutParams

Added in API level 21
protected open fun generateDefaultLayoutParams(): ActionMenuView.LayoutParams!
Return
ActionMenuView.LayoutParams! a set of default layout parameters or null

generateLayoutParams

Added in API level 21
protected open fun generateLayoutParams(p: ViewGroup.LayoutParams!): ActionMenuView.LayoutParams!
Parameters
p ViewGroup.LayoutParams!: The layout parameters to convert into a suitable set of layout parameters for this ViewGroup.
Return
ActionMenuView.LayoutParams! an instance of android.view.ViewGroup.LayoutParams or one of its descendants

onLayout

Added in API level 21
protected open fun onLayout(
    changed: Boolean,
    left: Int,
    top: Int,
    right: Int,
    bottom: Int
): Unit
Parameters
changed Boolean: This is a new size or position for this view
left Int: Left position, relative to parent
top Int: Top position, relative to parent
right Int: Right position, relative to parent
bottom Int: Bottom position, relative to parent

onMeasure

Added in API level 21
protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit
Parameters
widthMeasureSpec Int: horizontal space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.
heightMeasureSpec Int: vertical space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.