OSDN Git Service

Cascading popup menus: open submenu on mouse hover.
authorOren Blasberg <orenb@google.com>
Tue, 8 Sep 2015 21:59:12 +0000 (14:59 -0700)
committerOren Blasberg <orenb@google.com>
Wed, 16 Sep 2015 20:47:03 +0000 (13:47 -0700)
commit23087be7792c2d22173cf022a72d0648aa430ab5
treed3b26eb5615b3decdb2ef640dcd90ac9c2ced03e
parent9916282bac8ac8fab7ce5b649c049842acffa29b
Cascading popup menus: open submenu on mouse hover.

When the cascading feature is enabled, users can mouseover a
submenu item in a popup menu to expand and open the new submenu
(after a short timeout). Similarly, if a user mouseovers a
different menu item in the original menu, the submenu gets closed
(again, after a short timeout).

This should complete the implementation of cascading submenu
functionality.

Also fix two other issues:

(1) Update some oudated code in PopupMenu that was still opening
the submenu when a user clicks on a submenu item; this
responsibility now lives within the MenuPopupHelper's delegate
MenuPopup class, so it doesn't need to live in PopupMenu anymore.

(2) Fix an issue where icons would be force-set on a submenu when they
should not be. Instead, decide whether to show icons in a submenu
based on whether to show them in the top level menu, as intended.

Bug: 20127825
Change-Id: Ia46852c7f99436065ab4bc234de94dffc0019666
core/java/android/widget/DropDownListView.java
core/java/android/widget/MenuItemHoverListener.java [new file with mode: 0644]
core/java/android/widget/MenuPopupWindow.java
core/java/android/widget/PopupMenu.java
core/java/com/android/internal/view/menu/CascadingMenuPopup.java
core/java/com/android/internal/view/menu/MenuAdapter.java
core/java/com/android/internal/view/menu/StandardMenuPopup.java