summaryrefslogtreecommitdiff
path: root/core/java/android/widget/PopupMenu.java
Commit message (Collapse)AuthorAgeFilesLines
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-061-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I41e12e425284e74561c6b61663241df364ae54a1
* Add PopupMenu#setForceShowIconMihai Popa2019-02-051-0/+13
| | | | | | | | | | The API enables developers to display icons for menu items. Before this, the common workaround was to reflect in MenuPopupHelper (non-public class), and call setForceShowIcon there. Bug: 123769396 Test: atest android.widget.cts.PopupMenuTest Change-Id: If4ef46bc7786a2e7e756a9b15c81147e0cce1090
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+3
| | | | | | | | | | | | | | | | For packages: android.widget This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ic61019b1df85448a158fc2ba55c326353222c6b9
* Add @TestApi PopupMenu.getMenuListViewVladislav Kaznacheev2017-01-201-0/+16
| | | | | | | | | | | This method returns the ListView representing the menu. It is required to test the actual contents of a PopupMenu. Bug: 34076597 Test: android.widget.cts.ToolbarTest#testItemViewAttributes, android.widget.cts.PopupMenuTest#testItemViewAttributes Change-Id: Id72a8f482048d724d4fde15b126e0d08e1d18390
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-5/+5
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Dispatch the actual PopupWindow dismiss callback to PopupMenuAlan Viverette2015-11-201-14/+6
| | | | | | | | | | | | | | Previously the dismiss callback was called immediately after the menu received a close request; however, the dismiss callback implies that the menu's window has finished animating and been removed from the window manager. Also cleans up handling of mPopup in MenuPopupHelper to prevent unnecessary MenuPopup allocations and convert unnecessary fields into method arguments. Bug: 25323707 Change-Id: I8e3877ae6c40b4d0f1df23a4ff4fa48a7df34e0d
* Clean up PopupMenuAlan Viverette2015-11-161-76/+71
| | | | | | | | | | No functional changes, only refactoring: - remove unused mShowCascadingMenus member variable - move private interface implementations to anonymous inner classes - move interfaces to end of class - clean up docs formatting Change-Id: Ib82ca0d3a3ff49207959a17b77c4ff4f11a1afc2
* Cascading popup menus: open submenu on mouse hover.Oren Blasberg2015-09-161-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add Cascading submenus implementation.Oren Blasberg2015-09-101-2/+9
| | | | | | | | | This change adds a new Cascading implementation of MenuPopup. When enabled, submenus will show up in a cascading side by side fashion when opened next to popup menus. Bug: 20127825 Change-Id: Ie3c797fb5dbada7521cd93dc4171950af2be2ff7
* Pull out widget helpers into their own classes.Oren Blasberg2015-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in service of desktop-style submenus. Follow up CLs will make use of the newly independent classes. MOST of the changes in this CL are simply moving code from one place to another. Below are descriptions of the new files added: DropDownListView: Decouple this from ListPopupWindow, so other "menu popup" implementations [forthcoming] may make use of it. This class is UNCHANGED except for the addition of the setListSelectionHidden method. ForwardingListener: Decouple this from ListPopupWindow, so that other clients of this listener can expect a more general ShowableListMenu rather than a concrete ListPopupWindow. This will be useful later when we want to use something other than ListPopupWindow to show a menu. This class is UNCHANGED, except for (1) using the getListView() on popup rather than accessing its mDropDownList member, and (2) replacing ListPopupWindow return values with ShowableListMenu. MenuAdapter: Decouple from MenuPopupHelper so it may be used by forthcoming "menu popup" implementations rather than just by MenuPopupHelper itself. This class is UNCHANGED. ShowableListMenu: A new interface to encapsulate a menu that can be shown or hidden. This will be implemented by both ListPopupWindow and a forthcoming "menu popup" class. Bug: 20127825 Change-Id: I565b444d25e966ff8b8c6ceac7be8de56a9116df
* Add @ResourceInt annotations on APIsTor Norbye2015-02-181-1/+2
| | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Add popup window accessors for anchor overlap, gravity, windowAlan Viverette2015-01-071-0/+23
| | | | | | | Cleans up comments and some code in PopupWindow. BUG: 18245054 Change-Id: I2111d0c194ee1a39aaa721083041fc139efcf630
* Add style support to PopupMenu, clean up constructor javadocAlan Viverette2014-10-151-15/+42
| | | | | BUG: 18002523 Change-Id: Ice492686b814460248ccbe9727c64dd002e7ed7a
* Add gravity settings to PopupWindow/ListPopupWindow/PopupMenuAdam Powell2013-09-261-0/+14
| | | | | | | | | | Allow calling code to specify left/right/start/end gravity when showing a popup attached to an anchor. This allows easy alignment of either the right or left edges of the popup and anchor view. Bug 10728401 Change-Id: Ie0844a04ea0576fa67b0972f5873aaa4c5b823f6
* Fix NPE in PopupMenu.getDragToOpenListener()Alan Viverette2013-09-241-0/+13
| | | | | BUG: 10912382 Change-Id: I206e697b4781c4d03ebc01aa675511d89c1656af
* Fix pre tag formatting in getDragToOpenListener documentationAlan Viverette2013-08-301-2/+4
| | | | | BUG: 10549164 Change-Id: Ie3e05e918edbd737326c724e4e712279ac410238
* Add public API for obtaining drag-to-open listenerAlan Viverette2013-08-271-0/+30
| | | | | BUG: 10457019 Change-Id: I66485521c54b82033044834e7aab6707a3049e6b
* Fix bug 5300621 - Share menu disappears in galleryAdam Powell2011-09-211-0/+2
| | | | | | | | | | | | | | | | | ActionProviders (or action views) unfortunately had no way to report that they had opened a sub-UI that would affect menu visibility listeners used to hide action bars when not in use. This caused the Gallery UI to hide its action bar when the share popup was open. Add hidden API (to be made public later) to ActionProvider that can be used to inform the menu system that a sub UI has opened or closed. Account for this in menu visibility callbacks. Fix ShareActionProvider to use this when its popup windows open and close. Fix a regression where submenus were not properly reporting visibility changes. Change-Id: Ia6f45fb463ad106105c40d01f141c2e5c8b96f78
* Fix bug 4818050 - Need a way to get notified when a PopupMenu getsAdam Powell2011-06-211-2/+43
| | | | | | | | dismissed/canceled Add an OnDismissListener to PopupMenu. Change-Id: I7abe1b9c9bea5e758a9c32631185e50cd7eb1ed0
* Added android.widget.PopupMenuAdam Powell2010-08-041-0/+154
Change-Id: Id507cf93ebd0484f141a0a44266b883c01aa10db