Google is committed to advancing racial equity for Black communities. See how.

ListPopupWindow

open class ListPopupWindow : ShowableListMenu
kotlin.Any
   ↳ androidx.appcompat.widget.ListPopupWindow

Static library support version of the framework's android.widget.ListPopupWindow. Used to write apps that run on platforms prior to Android L. When running on Android L or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Summary

Constants
static Int

Mode for setInputMethodMode(int): the requirements for the input method should be based on the focusability of the popup.

static Int

Mode for setInputMethodMode(int): this popup always needs to work with an input method, regardless of whether it is focusable.

static Int

Mode for setInputMethodMode(int): this popup never needs to work with an input method, regardless of whether it is focusable.

static Int

Alias for ViewGroup.LayoutParams#MATCH_PARENT.

static Int

The provided prompt view should appear above list content.

static Int

The provided prompt view should appear below list content.

static Int

Alias for ViewGroup.LayoutParams#WRAP_CONTENT.

Public constructors
<init>(@NonNull context: Context)

Create a new, empty popup window capable of displaying items from a ListAdapter.

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?)

Create a new, empty popup window capable of displaying items from a ListAdapter.

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, @AttrRes defStyleAttr: Int)

Create a new, empty popup window capable of displaying items from a ListAdapter.

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, @AttrRes defStyleAttr: Int, @StyleRes defStyleRes: Int)

Create a new, empty popup window capable of displaying items from a ListAdapter.

Public methods
open Unit

Clear any current list selection.

open OnTouchListener!

Returns an OnTouchListener that can be added to the source view to implement drag-to-open behavior.

open Unit

Dismiss the popup window.

open View?

Returns the view that will be used to anchor this popup.

open Int

Returns the animation style that will be used when the popup window is shown or dismissed.

open Drawable?

open Rect?

Return custom anchor-relative bounds of the popup's transition epicenter

open Int

open Int

open Int

Return the current value in setInputMethodMode(int).

open ListView?

open Int

open Any?

open Long

open Int

open View?

open Int

Returns the current value in setSoftInputMode(int).

open Int

open Int

open Boolean

open Boolean

Returns whether the popup window will be modal when shown.

open Boolean

open Boolean
onKeyDown(keyCode: Int, @NonNull event: KeyEvent)

Filter key down events.

open Boolean
onKeyPreIme(keyCode: Int, @NonNull event: KeyEvent)

Filter pre-IME key events.

open Boolean
onKeyUp(keyCode: Int, @NonNull event: KeyEvent)

Filter key up events.

open Boolean
performItemClick(position: Int)

Perform an item click operation on the specified list adapter position.

open Unit

Post a show() call to the UI thread.

open Unit
setAdapter(@Nullable adapter: ListAdapter?)

Sets the adapter that provides the data and the views to represent the data in this popup window.

open Unit
setAnchorView(@Nullable anchor: View?)

Sets the popup's anchor view.

open Unit
setAnimationStyle(@StyleRes animationStyle: Int)

Set an animation style to use when the popup window is shown or dismissed.

open Unit

Sets a drawable to be the background for the popup window.

open Unit

Sets the width of the popup window by the size of its content.

open Unit

Set the gravity of the dropdown list.

open Unit
setEpicenterBounds(@Nullable bounds: Rect?)

Specifies the custom anchor-relative bounds of the popup's transition epicenter.

open Unit
setHeight(height: Int)

Sets the height of the popup window in pixels.

open Unit

Set the horizontal offset of this popup from its anchor view in pixels.

open Unit

Control how the popup operates with an input method: one of INPUT_METHOD_FROM_FOCUSABLE, INPUT_METHOD_NEEDED, or INPUT_METHOD_NOT_NEEDED.

open Unit

Sets a drawable to use as the list item selector.

open Unit
setModal(modal: Boolean)

Set whether this window should be modal when shown.

open Unit

Set a listener to receive a callback when the popup is dismissed.

open Unit
setOnItemClickListener(@Nullable clickListener: OnItemClickListener?)

Sets a listener to receive events when a list item is clicked.

open Unit
setOnItemSelectedListener(@Nullable selectedListener: OnItemSelectedListener?)

Sets a listener to receive events when a list item is selected.

open Unit

Set where the optional prompt view should appear.

open Unit
setPromptView(@Nullable prompt: View?)

Set a view to act as a user prompt for this popup window.

open Unit
setSelection(position: Int)

Set the selected position of the list.

open Unit

Sets the operating mode for the soft input area.

open Unit

Set the vertical offset of this popup from its anchor view in pixels.

open Unit
setWidth(width: Int)

Sets the width of the popup window in pixels.

open Unit
setWindowLayoutType(layoutType: Int)

Set the layout type for this popup window.

open Unit

Show the popup list.

Constants