summaryrefslogtreecommitdiff
path: root/core/java/android/widget/ActionMenuPresenter.java
Commit message (Collapse)AuthorAgeFilesLines
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-4/+5
| | | | | | | | | | | | | | | | | | | 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-5/+4
| | | | | | | | | 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-4/+5
| | | | | | | | | | 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 Satayev2019-12-181-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: I5be7335b23a92b8ac80d2fd890198273b66ad644
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+5
| | | | | | | | | | | | | | | | 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
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-0/+1
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Clean up lint warnings in popup menu presenter classesAlan Viverette2016-01-131-13/+3
| | | | Change-Id: I6b4cce1c4788b408615af0c93575e02e75b4c3ca
* Avoid NPE when ActionMenuPresenter is intialized with null MenuBuilderAlan Viverette2016-01-041-6/+20
| | | | | | | Also adds annotations to accurately reflect nullability. Bug: 26318920 Change-Id: Ia3b170dd301edfc0088a11ee5764c24bab2f10aa
* Ensure only one context menu is shown at a timeAlan Viverette2015-11-251-2/+2
| | | | | | | | | | | | | | | Refactors the menu helper classes. Both classes now implement a common MenuHelper interface, which eliminates the need to keep separate helpers on PhoneWindow and unifies the DecorView showContextMenuForChild() implementations. We now explicitly dismiss any previously shown context menu before showing a new context menu. Previously we relied on the modal nature of the dialog context menu to prevent multiple menus from being opened at once, but this is no longer reliable with popup context menus. Bug: 25656520 Change-Id: Idab3daa6d6888f803f2e33660fe1dd488e4c28d1
* Dispatch the actual PopupWindow dismiss callback to PopupMenuAlan Viverette2015-11-201-4/+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
* Swtich from max_action_buttons resource to a method.Filip Gruszczynski2015-11-171-2/+1
| | | | | | | | | | We want to limit the number of size thresholds that an application will report. Instead of using a dimen resource that will increase the number of thresholds, we calculate the max number of action buttons dynamically in code. Bug: 25394588 Change-Id: I8ece331cd02fb116b49734003cec112708d27f85
* Reduce CascadingMenuPopup's reliance on internal ListView stateAlan Viverette2015-11-031-2/+2
| | | | | | | | Bundles cascading menu information and stores it in a stack representing the hierarchy of added menus. Bug: 23970448 Change-Id: I1621d9eb30ff173767b6ebad2a1977127c42d0ad
* Add Cascading submenus implementation.Oren Blasberg2015-09-101-20/+26
| | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* API council review feedback for ActionMenuViewChris Banes2015-06-101-48/+25
| | | | | | | | | | Reverts "MenuItem, navigation and overflow icon tinting" CL, and adds getter and setter for the overflow icon to ActionMenuView and Toolbar. BUG: 21571899 Change-Id: I591f43650356443fa3256e4d74e28b6ddd8c2b33
* Disable ActionBar animations pending more involved fixChet Haase2015-05-071-1/+2
| | | | | | | | | | | | | | | | | Recycling of ActionBar items can cause problems with the current ActionBar animations, as the system animates views that represent both pre- and post-layout changes, sometimes causing opposit animations to run on the same view, resulting in unpredictable effect slike views remaining invisible. This 'fix' is a workaround to disable item animations pending a more complete and robust fix that involves a more involved system of view recycling that would avoid recycling views that are currently being used in animations. Issue #20538912 Menu missing in Downloads app Change-Id: I7b1d3baf94378e4788f868801a452c6583353842
* Make ActionBar animations work correctlyChet Haase2015-04-141-22/+45
| | | | | | | | | | | | Previous ActionBar animations didn't handle configuration changes or other situations in which the view would get detached. listeners would stay on the view and would attempt to do something nonsensical in the new window. This new approach removes listeners on window detach to avoid this problem. Issue #20125407 Settings Crashes when changing orientation of device Change-Id: I0b3bbd0f6fc23cdb4cbd646b0d2772d72d3d795d
* Fix breakage from ActionBar animationsChet Haase2015-04-091-1/+1
| | | | | | | | | Real fix will come later, but this disables the animations to work around the current crash. Issue #20125407 Settings Crashes when changing orientation of device Change-Id: I748e8889f72483c82cff084c5815322057f16f03
* Fix crash when removing draw listenerJorim Jaggi2015-04-081-3/+4
| | | | | | | The same behavior can be achieved by using a predraw listener, which can be removed while the callback is called, so it doesn't crash. Change-Id: I3a7138ba49936159dc95b7758c9603366dcf808c
* Animate ActionBar itemsChet Haase2015-04-071-13/+247
| | | | | | | | | | Chnages to the ActionBar are now tracked so that new items, items that go away, and items that change location are now animated into their new state. Issue #10863316 action bar items don't fade in correctly Change-Id: Ia956b2b76958f02108c756dab2d1c2617a5904dc
* MenuItem, navigation and overflow icon tintingChris Banes2015-02-271-3/+48
| | | | | | | | | | | | | | | - iconTint and iconTintMode attrs for MenuItem, with associated setters. - navigationTint and navigationTintMode attrs for Toolbar with associated setters. - overlflowTint and overflowTintMode attrs for Toolbar with associated setters. BUG: 18126050 BUG: 19148351 BUG: 19305408 Change-Id: Ibd1fae7cdbc7a7c42809e52541fae5d8beb18e92
* Fix accessibility delegationAlan Viverette2015-01-071-2/+3
| | | | | | | | | | | | | | | Ensures that delegate code is run last. Previously, calling the super method from an accessibility delegate set on a widget would only run code in the widget's parent. Next, the delegate code would run. Finally, the widget's code would run. As a result, the widget code would override any data supplied by the delegate. By moving all overridden code to internal methods, we ensure that the call chain for super includes the widget's parent code followed by the widget's code. The delegate code will always run last. BUG: 17641433 Change-Id: Ib9d403156c1fc4fb04f65f3c126d1277a44b3740
* Update overflow menu alignment to match specAlan Viverette2014-11-201-6/+10
| | | | | BUG: 18417348 Change-Id: I5e4b1ca366c554bca33eac8e5403be6de72370f9
* Fix toolbar height, list divider alpha, action item paddingAlan Viverette2014-09-121-8/+12
| | | | | | | BUG: 17487305 BUG: 17470290 BUG: 17486967 Change-Id: Ib0cb4308f9d57e730504bdeb125662b648cad0f7
* Update action bar item widths, overflow menu, button, and spinner stylesAlan Viverette2014-08-281-0/+19
| | | | | | | | | | | | | Manually modifies the overflow button hotspot bounds so that the ripple appears to be centered on the overflow icon. Adds styleable and parsing for list popup window offsets. Updates spinner text appearance to be consistent with drop down item text appearance. Also updates horizontal inner padding in buttons. BUG: 17305079 BUG: 17304391 BUG: 17302567 Change-Id: Iafddfef290078de968894a3b443ba9f60f84c6d4
* Use touch hotspot in drag-to-open, fix forwarding cancellationAlan Viverette2014-07-011-1/+2
| | | | | BUG: 14230395 Change-Id: Ibea615bcd6a2e57fca8b49ffea23f0df951d497c
* Toolbar factoring and ActionBar functionality integrationAdam Powell2014-05-281-0/+1
| | | | | | | | Toolbars now can act in the role of ActionBar with the exception of navigation modes. Expandable action views are now supported as well as populating menu items from a host window. Change-Id: If477db9c7ad9f95723f28cf73cbf03a07ce9d6ad
* Add support for popups overlapping anchorsAlan Viverette2014-05-051-1/+2
| | | | | BUG: 14471731 Change-Id: I16e8d76caedfebd0c38b8c0b22cd9619d70877c8
* android.widget.ToolbarAdam Powell2014-04-041-10/+0
| | | | | | | | | | | | Add the new Toolbar widget for use in app layouts. ActionBar can now be used as a point of control for either a traditional window decor action bar or for a Toolbar that appears inline in an Activity's layout. ToolbarActionBar is currently WIP. Change-Id: I0da093e5645840f4fd032aa34efa0ae5f1825ff2
* Move drag-to-open handling into ActionMenuItemViewAlan Viverette2014-01-131-20/+12
| | | | | | | | | This prevents the menu item's OnClickListener from being overwritten, allows the client to override item invocation, and prevents showing multiple popups when items are re-initialized. BUG: 11969895 BUG: 12489213 Change-Id: I97ca737810073df348171cdba5442f24a5527f89
* am 9c9975ac: Merge "Fix a bug where OnTouchListeners in action views could ↵Adam Powell2014-01-101-18/+18
| | | | | | | be removed" into klp-modular-dev * commit '9c9975ac3dc63423751c4783162d4ade11d156c1': Fix a bug where OnTouchListeners in action views could be removed
* Move ActionMenuView into android.widget and make it publicAdam Powell2014-01-081-0/+764
Expose ActionMenuView as a way for applications to present ActionBar-style menus in other embedded or repeating contexts. Change-Id: I54b7ccd9b2116ca68bc72956da9262bca9d5085f