MenuPopupHelper

(SESL variant) Presents a menu as a small, simple popup anchored to another view.

Constructors

Link copied to clipboard
constructor(@NonNull context: @NonNull Context, @NonNull menu: @NonNull MenuBuilder)
constructor(@NonNull context: @NonNull Context, @NonNull menu: @NonNull MenuBuilder, @NonNull anchorView: @NonNull View)
constructor(@NonNull context: @NonNull Context, @NonNull menu: @NonNull MenuBuilder, @NonNull anchorView: @NonNull View, overflowOnly: Boolean, @AttrRes popupStyleAttr: Int)
constructor(@NonNull context: @NonNull Context, @NonNull menu: @NonNull MenuBuilder, @NonNull anchorView: @NonNull View, overflowOnly: Boolean, @AttrRes popupStyleAttr: Int, @StyleRes popupStyleRes: Int)

Functions

Link copied to clipboard
open fun dismiss()
Dismisses the popup, if showing.
Link copied to clipboard
open fun getGravity(): Int
Link copied to clipboard
open fun getListView(): ListView
API to get the underlying ListView of the Popup
Link copied to clipboard
@NonNull
open fun getPopup(): @NonNull MenuPopup
Link copied to clipboard
open fun isShowing(): Boolean
Link copied to clipboard
open fun seslForceShowUpper(force: Boolean)
Link copied to clipboard
open fun seslSetOverflowOnly(overflowOnly: Boolean)
Link copied to clipboard
open fun seslSetOverlapAnchor(overlapAnchor: Boolean)
Link copied to clipboard
open fun seslUpdate()
Update the popup menu content width.
Link copied to clipboard
open fun setAnchorView(@NonNull anchor: @NonNull View)
Sets the view to which the popup window is anchored.
Link copied to clipboard
open fun setForceShowIcon(forceShowIcon: Boolean)
Sets whether the popup menu's adapter is forced to show icons in the menu item views.
Link copied to clipboard
open fun setGravity(gravity: Int)
Sets the alignment of the popup window relative to the anchor view.
Link copied to clipboard
open fun setOnDismissListener(@Nullable listener: @Nullable PopupWindow.OnDismissListener)
Link copied to clipboard
Link copied to clipboard
open fun show()
open fun show(x: Int, y: Int)
Link copied to clipboard
open fun tryShow(): Boolean
Attempts to show the popup anchored to the view specified by setAnchorView.
open fun tryShow(x: Int, y: Int): Boolean
Shows the popup menu and makes a best-effort to anchor it to the specified (x,y) coordinate relative to the anchor view.