Class MenuPopupWindow.MenuDropDownListView

All Implemented Interfaces:
Drawable.Callback, ViewManager, ViewParent, Filter.FilterListener
Enclosing class:
MenuPopupWindow

public static class MenuPopupWindow.MenuDropDownListView extends DropDownListView
  • Constructor Details

    • MenuDropDownListView

      public MenuDropDownListView(Context context, boolean hijackFocus)
  • Method Details

    • setHoverListener

      public void setHoverListener(MenuItemHoverListener hoverListener)
    • clearSelection

      public void clearSelection()
    • onKeyDown

      public boolean onKeyDown(int keyCode, @Nonnull KeyEvent event)
      Description copied from class: View
      Default implementation: perform press of the view when KeyEvent.KEY_ENTER, KeyEvent.KEY_KP_ENTER or KeyEvent.KEY_SPACE is released, if the view is enabled and clickable.
      Overrides:
      onKeyDown in class ListView
      Parameters:
      keyCode - a key code that represents the button pressed, from KeyEvent
      event - the KeyEvent object that defines the button action
    • onHoverEvent

      public boolean onHoverEvent(@Nonnull MotionEvent ev)
      Description copied from class: View
      Implement this method to handle hover events.

      This method is called whenever a pointer is hovering into, over, or out of the bounds of a view and the view is not currently being touched. Hover events are represented as pointer events with action MotionEvent.ACTION_HOVER_ENTER, MotionEvent.ACTION_HOVER_MOVE, or MotionEvent.ACTION_HOVER_EXIT.

      • The view receives a hover event with action MotionEvent.ACTION_HOVER_ENTER when the pointer enters the bounds of the view.
      • The view receives a hover event with action MotionEvent.ACTION_HOVER_MOVE when the pointer has already entered the bounds of the view and has moved.
      • The view receives a hover event with action MotionEvent.ACTION_HOVER_EXIT when the pointer has exited the bounds of the view or when the pointer is about to go down due to a button click, tap, or similar user action that causes the view to be touched.

      The view should implement this method to return true to indicate that it is handling the hover event, such as by changing its drawable state.

      The default implementation calls View.setHovered(boolean) to update the hovered state of the view when a hover enter or hover exit event is received, if the view is enabled and is clickable. The default implementation also sends hover accessibility events.

      Overrides:
      onHoverEvent in class DropDownListView
      Parameters:
      ev - The motion event that describes the hover.
      Returns:
      True if the view handled the hover event.
      See Also: