History log of /frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c8f6ecc265656cdf68d2010a4e04666017c3b907 30-Jun-2015 Chris Banes <chrisbanes@google.com> Fix memory leak in setActionProvider() - framework edition

Caused by ActionMenuItem's SubUiVisibilityListener
not being nulled when it is replaced via setActionProvider().

BUG: 22189734
Change-Id: Id4deaa05cd5554ca7bdf969a592e4812e39dcb75
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
a41b78973db3dfde159f7d641f794f462ad323d3 09-Jun-2015 Chris Banes <chrisbanes@google.com> API council review feedback for ActionMenuView

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
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
9cc36ca1b520c06f882e84b909f3a2b75d303a06 23-Feb-2015 Chris Banes <chrisbanes@google.com> MenuItem, navigation and overflow icon tinting

- 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
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
cb923d99e9ec2f7b6b40a7c89c83a6caaa03b016 01-Jul-2014 Chet Haase <chet@google.com> null-check before derefing title in MenuItemImpl

The toString() method in MenuItemImpl returns mTitle.toString(),
which crashes when the title is null (which it can be, since there
is no requirement that a title be non-null, and you can get one
by simply not assigning a title to begin with or by setting it
to null).

Issue #13420311 MenuItemImpl can't handle a null title

Change-Id: I701d1d565f1d254ffdd41ca64c1abaf2906edb79
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
8eea3ea5591e59f55cbb4f6b2b7e9363a285ced3 04-Feb-2014 Alan Viverette <alanv@google.com> Add APIs for obtaining themed Drawable from Theme, Context

BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
2dc27f22c9f2ff5de9f9e7d578391ba2abb9815c 16-Jul-2013 Adam Powell <adamp@google.com> Fix collapsible action views.

Fix a regression caused by a previous overzealous refactoring. (Oops.)
Watch those conditionals, everyone!

Bug 9866559

Change-Id: Ia88a4ee38edef378e70bdc7151c825375a3d482d
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
b4c8ba49ac6ccce8e5c7904741f4adff05e37640 12-Jul-2013 Adam Powell <adamp@google.com> Fix MenuItemImpl#hasCollapsibleActionView for action providers

hasCollapsibleActionView was previously checking only that mActionView
was not null, even if the item had a valid ActionProvider that would
later lazily create an action view when prompted. Account for this and
attempt to create the action view if needed when
hasCollapsibleActionView is called.

Bug 8732876

Change-Id: Idf7b329770f686208882509b82a4cb13c70ef32c
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
dcc55855bc660fc2f45d02a1398be2e4fcf5fcb5 03-May-2013 Adam Powell <adamp@google.com> Fix a NPE in MenuItemImpl when setting null ActionProvider

Change-Id: I00be010b2197d0f41d0e45b3814474d3ad0c3295
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
eb573418a7a727fb44720514da8ebc1dc37388f7 19-Apr-2011 Mattias Falk <mattias.falk@sonyericsson.com> Re-read shortcut labels if the language has changed

The shortcut label isn't updated to the current language
if the phone's language has changed.

The problem was that the shortcut label is stored in a
static variable which is set once and kept throughout the
life time of the process.

Change-Id: I89c5875fbf28fb82e073166c472ca205d28674fb
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
39d5c6172503620ac3761148adac5fd7fa20d02d 16-Jun-2012 Adam Powell <adamp@google.com> Make MediaRouter UI more robust around route count changes

Improve the API around ActionProvider visibility overriding. Allow the
application to notify whatever is hosting the ActionProvider that
visibility has changed in a way that is friendly to alternate support
library-style reimplementations of MenuItem.

Allow MediaRouter.Callback implementations to add or remove themselves
or other Callbacks during dispatch of callback events.

Make MediaRouteActionProvider track the visibility of corresponding
menu items more accurately.

Change-Id: Ic7ddb6a87c3637904750d2661e4a9fa323b09ea0
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
130b4572d1f3df702e5b296a655d15a41f6d4c66 16-Jun-2012 Adam Powell <adamp@google.com> ActionProvider API update

* Add ActionProvider#overridesItemVisibility and isVisible.
These methods allow an ActionProvider to override the
visibility of a MenuItem that it is bound to. If a MenuItem
has been explicitly hidden by the application, it will not
be visible.

* Change MediaRouteActionProvider to not require a MediaRouter
callback, to avoid extra lifecycle management headaches.

Change-Id: I606fa98b3a6a3e60a953dd024274f9bf9c67acdd
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
690ffb4e1f735148a15f2036d9a3c1962fba188c 05-Jun-2012 Adam Powell <adamp@google.com> More fun with MediaRouter

Add action provider, button, and styles. Extend ActionProvider to
allow for getting references to MenuItem instances.

Implement toggle mode for the MediaRouteButton/ActionProvider. Dialog
selection yet to come.

Change-Id: Ibe3188570f503bbf8dd00cf154663435656a7171
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
c4852a37186260bf688dc94a77a4ebd2a8290a02 19-Mar-2012 Adam Powell <adamp@google.com> Fix a bug where MenuItems would not return consistent results for
item icons initialized from a drawable resource id.

Change-Id: Ieb5245b8fe0e11b2eb788143859da1c0b3657b9f
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
23f4cc0353615107cc9c19fda9cf96ddd43266e2 18-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5099037 - No delete option when multiple videos are selected

Fix some bugs related to how action item slots are allocated in menus.

Fix some padding/margins in ActivityChooserView.

Change-Id: I12096b0165daca902c5bc8e24c1e8d54a35e9557
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
10da590839e264735de8a4582021aca0dab81037 27-Jul-2011 Amith Yamasani <yamasani@google.com> Handle callbacks to CollapsibleActionViews that are in an actionLayout.

Also, the onActionViewCollapsed needs to be called before detaching
the action view, so that the action view can dismiss the keyboard properly.

Fixes the Gmail search case where the keyboard doesn't disappear on hitting
the "up" affordance after a search.

Change-Id: I3c2f3f90f0edf6473404e6ceae3fa08866cad736
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
038f1c80af06da55056120e121d43e3ee89ec726 21-Jul-2011 Adam Powell <adamp@google.com> Bug 5061529 - Save/restore action view state for menu items across
invalidations.

This includes expand/collapse state.

Add CollapsibleActionView interface. Views can implement this to have
special behavior when they are presented as an expanding/collapsing
action view. This lets SearchView and others take care of fiddly
behavior (focus stealing; opening the IME) automatically without apps
needing to implement this themselves.

Change-Id: Ibbd1eb5fcf3e3a862419e9344ad50f896bd05e36
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
76559a65ad9d644f10beacf8895ceb217fdd0aeb 07-Jul-2011 Svetoslav Ganov <svetoslavganov@google.com> Polish of the ActivityChooserView and ShareActionProvider.

1. Addressed the UX comments: ActivityChooserView's default selection
popup no longer shows a message, rather hightlights the default
action which now it displays. Alignemnt of the UI.

2. The ShareActionProvider shows a sub-menu if the host item goes
on the overflow menu.

3. Now the heade layout of the activity chooser view is not needed hence
dropped and the item and footer ones are merged.

Change-Id: I0b3de623e4c0a805be9ed73a8541e66b8c00e2d2
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
961dd11895ce72e59bca124ef5bea4e4c1183099 12-Jul-2011 Adam Powell <adamp@google.com> Update ActionProvider to support dynamically building submenus.

Stub out ShareActionProvider for building a submenu of activities to
choose from.

Change-Id: Ibd9ada77a455ed1a296c87b6d967073ca0f676c2
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
35aecd5884a5ccfe380903e39f30f468315e8f92 01-Jul-2011 Adam Powell <adamp@google.com> Updates for action menus

Sync with UX designs for action menus in split action bar mode.
Layout is now based on a grid cell scheme.

Tweak action menu item layouts.

Fix some bugs with drawing LinearLayout dividers.

Rename config resources to follow convention.

Action bar menu items now show text in ALL CAPS. This is done in a
locale-dependent manner, but if it produces problems in specific
locales the config resource config_actionMenuItemAllCaps should be set
to false for that locale.

Change-Id: I064c2dd85e012e89551f29153efcfc17f9106333
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
51ac0e94a83cfccb5105aa14df1077729a5b4ccc 17-Jun-2011 Svetoslav Ganov <svetoslavganov@google.com> Adding a ShareView and ActionProvider for menus.

1. Adding a widget for sharing contenet with other applications.
The widget orders the share targets based on previous shares.
It displays the share target list as either a popup anchored to
itslef or as a dialog.

2. Added a ShareDataModel that will back widgets or other classes
that are interested in share targets for a given intent ordered
according to share history. This class is backing the ShareView

3. Added ActionProvider mechanism for the MenuItems. The action
provider of a menu creates the action view as well as performs
a default action if the menu item is on the overflow menu and
is triggered but none of the menu callback has handled that.

bug:4590827

Change-Id: Iaa4add2df2538b8c6c7edbeaf2880486d4fd75c5
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
ea1ca952c625d51dc71e1cc3d955b239921888c7 21-Jun-2011 Adam Powell <adamp@google.com> Fix bug 4108953 - Old-style menus do not show menu items marked as
showAsAction="always"

Change-Id: I63299143ea780abeed6dcdece6934f0e704b46a2
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
81cf3ecadefb8fd6c05771b0b9947babaa9c8eaf 17-May-2011 Adam Powell <adamp@google.com> Action buttons now use themable style.

Obey action view layoutparams.

Change-Id: Ia466008465b57659615fbf9d450ce3fdb3c06379
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
8d02deabac62c4a68a335a7b3141795466362b89 01-Jun-2011 Adam Powell <adamp@google.com> Implement bug 4500971 - Collapsable action views

Action views may now be flagged as 'collapsable'. This means that the
action menu will always show them in the collapsed state by
default. When selected, the action view will "take over" the
navigation/view side of an action bar until dismissed via the home/up
button.

This feature allows for more long-term exclusive modes akin to
ActionModes but less intrusive. The action menu itself remains
unaffected. Collapsable action views are ideal for things such as
search or categories of tool palettes.

Change-Id: Ibafce5631befbfe67c5d834c2e2617d3d7f6da7a
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
45c515b0e962ee8ffc901872bcc9f25599ea0e78 22-Apr-2011 Adam Powell <adamp@google.com> Action bar work for phones

Tweak sizing and layouts for action bar on smaller devices. The action
bar's size is now partially dependent on form factor and orientation
to conserve screen space, especially in landscape mode.

Alter the max action menu items for smaller devices. Disallow text on
action menu items with a horizontal width of less than 480dp when an
icon is available.

Remove the "Done" text on the action mode close button. (TODO: get a
properly sized 9-patch resource for this - the current one has an
intrinsic width that is too large.)

When setting an action bar icon as a resource ID, the bar will attempt
to load a mipmapped resource that is the closest available for the
target size.

Change-Id: I2498c640666ade310fdd1d3a2078bd4000b392a2
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
696cba573e651b0e4f18a4718627c8ccecb3bda0 29-Mar-2011 Adam Powell <adamp@google.com> Refactor menu internals.

In the old world, MenuBuilder and MenuItemImpl were responsible for
generating views for any presentation of a menu. MenuBuilder needed to
know any types and resources involved, and the implied caching
semantics did not work well for menus presented within AdapterViews.

In the new world, the MenuPresenter interface takes over the
responsibility of generating views or adapters for menu
items. MenuBuilder/MenuItemImpl still provide extra metadata tracking
used by these presenters. Mutiple presenters may be active for a
single menu at a time. All of this remains internal framework
implementation details.

BaseMenuPresenter provides a simple base for presenters that treats
the host MenuView more like an AdapterView. This allows for less
rebuilding of views when items are added/removed.

Callbacks have been restructured. Calls that relate to the menu itself
are still handled by MenuBuilder.Callback, but calls related to a
specific presentation of a menu are handled by MenuPresenter.Callback
objects attached to a MenuPresenter.

Also add API to programmatically set divider options for LinearLayout
and hidden API so that ActionBarView can have finer-grained control
over divider placement.

Change-Id: I2265b86a084279822908021aec20dfbadc1bb56b
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
abbcc241c0db3d9167b5e6baeac1a07f009a05a5 24-Jan-2011 Adam Powell <adamp@google.com> Fix bug 3237638 - make it easy to change a "refresh" AB button/icon
into the indeterminate progress icon

This fixes a bug that caused ActionViews to not be updated properly
after a pass through invalidateOptionsMenu/onPrepareOptionsMenu. Apps
can now set/clear action views to display progress spinner widgets or
anything else on demand.

Change-Id: I138eceb504177c6bb5b86d40a68a82973aa841a5
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
e7d468410b3a783560d5158a5798cef1b4b67702 14-Jan-2011 Adam Powell <adamp@google.com> Rework action bar menus.

Fix bug 3328810 - remove icons from action bar overflow menu. Popup
menus now will not show icons. Give popup menu items a minimum width.
Alter the sizing of popup menus.

Fix bug 3192635 - revise rules for action menu dividers. Dividers now
appear between the overflow button and any other items next to it, and
anywhere they disambiguate touch targets between text and other
content. Action views are on their own and should include their own
dividers if needed.

Remove dividers from around action bar spinners and tabs.

Change-Id: I935b48b473606ac2adde5e2b251bf30ebe2a3da9
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
d16c9884bb0bd06f9d7aa1be649226a5df6591ee 07-Jan-2011 Adam Powell <adamp@google.com> Fix bug 3330223 - onCreateOptionsMenu() unable to getActionView()
immediately after orientation change

Inflate action view layout resource earlier so that calls to
getActionView are valid immediately after menu inflation.

Change-Id: I8023328b1a77670ac42a783f6e4b46aa5c2a798e
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
3f476b34049d062942eafcf48396f593e00bd324 04-Jan-2011 Adam Powell <adamp@google.com> Revisiting ActionBar API and layout.

Fix several bugs where ActionBar was ignoring LayoutParams in action
views.

Add convenience methods for toggling display options flags.

Add layout resource version of ActionBar#setCustomView

Fix a bug preventing actionViewClasses from being loaded properly in
menu xml.

Change-Id: I0d9a0b635fd9cfc020bac69369c0c7749c226349
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
d8404b23739b135060ab9a04317a9f8b990cf8ca 13-Oct-2010 Adam Powell <adamp@google.com> Allow icon+text action buttons

Change-Id: I96d1f3958de3ac13cadbab108b87d6bae96e9473
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
cf78b3e5101349fdddbde14b3a55140f9562ae66 13-Sep-2010 Adam Powell <adamp@google.com> Add support for custom action views in ActionBar menus

Change-Id: Ic7850bc00fcfe95d805dd6a1b15cb5d413942475
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
4d9861e7ec8488634d316b20981464de2ab7b6fe 17-Aug-2010 Adam Powell <adamp@google.com> Bug 2923440 - ActionMode buttons show if room by default - different approach.

This enforces the new policy if menu items are created
programmatically instead of inflated from menu xml.

This reverts commit fbb72fdbe58142e0f1f7ffa17f009b0d829b33c3.

Change-Id: I102e93b80a3248634e98e0d7dc3321bf1d8b263b
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
4267534d1c42af847ed0cefd1c88c99f66b36571 10-Jul-2010 Adam Powell <adamp@google.com> Action Bar now supports submenus as popups.

Change-Id: I1691c16081b3474ed6d6e406f91f5f74a2dc8fcb
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
89e0645b4157961e8c465eb9c819f965fdb453d8 24-Jun-2010 Adam Powell <adamp@google.com> Added context modes to ActionBar API.

Change-Id: I7c3e782cbf01be7bc671b377fb4d706040888833
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
96675b1df3969f2d313b68f60ed9fa36805db8ce 11-Jun-2010 Adam Powell <adamp@google.com> Merging ActionBar menu with options menu.

Options menu items may now specify if they would like to appear in the
action bar. Menu items defined in xml may set the showAsAction
attribute to one of "never"(default), "ifRoom", or "always". Action
buttons are populated as follows:

* All showAsAction="always" items become action buttons, even if it
would crowd the navigation area of the action bar.

* If there is space remaining, showAsAction="ifRoom" items are added
until no more will fit comfortably.

Action button click events are now handled by the
onOptionsItemSelected method used by the standard options menu.

The construction of options menus now happens earlier in order to
provide data to the action bar. Activities with an action bar can now
expect to have onCreateOptionsMenu called when activity start-up is
complete.

Activity#invalidateOptionsMenu can be used to force a refresh of menu
items where the previous API would use ActionBar#updateActionMenu.

Change-Id: If52ddf1cf9f6926206bcdeadf42072ea2c24fab9
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
151af19bf409a47424ddaa51e1ac4a0c532c4eb6 04-May-2010 Adam Powell <adamp@google.com> Fix bug 2651076 - Catch/log ActivityNotFoundException in MenuItemImpl.invoke()

Change-Id: I841a37349fbc6af33073aaecae903eb8999cc5bd
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/com/android/internal/view/menu/MenuItemImpl.java