diff options
author | Chris Banes <chrisbanes@google.com> | 2015-06-09 13:36:44 +0000 |
---|---|---|
committer | Chris Banes <chrisbanes@google.com> | 2015-06-10 11:39:01 +0100 |
commit | a41b78973db3dfde159f7d641f794f462ad323d3 (patch) | |
tree | 98701587be8e486b93ad9f8fa75ec82c50f71009 /core/java/android/widget/ActionMenuView.java | |
parent | d9b0acd2eb8d844b9f901fc62e0de74c1a7d8430 (diff) | |
download | frameworks_base-a41b78973db3dfde159f7d641f794f462ad323d3.zip frameworks_base-a41b78973db3dfde159f7d641f794f462ad323d3.tar.gz frameworks_base-a41b78973db3dfde159f7d641f794f462ad323d3.tar.bz2 |
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
Diffstat (limited to 'core/java/android/widget/ActionMenuView.java')
-rw-r--r-- | core/java/android/widget/ActionMenuView.java | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/core/java/android/widget/ActionMenuView.java b/core/java/android/widget/ActionMenuView.java index 278a8fb..1f02c3b 100644 --- a/core/java/android/widget/ActionMenuView.java +++ b/core/java/android/widget/ActionMenuView.java @@ -16,11 +16,11 @@ package android.widget; import android.annotation.NonNull; +import android.annotation.Nullable; import android.annotation.StyleRes; import android.content.Context; -import android.content.res.ColorStateList; import android.content.res.Configuration; -import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.ContextThemeWrapper; import android.view.Gravity; @@ -541,39 +541,35 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo dismissPopupMenus(); } - /** @hide */ - public boolean isOverflowReserved() { - return mReserveOverflow; - } - - /** @hide */ - public void setOverflowReserved(boolean reserveOverflow) { - mReserveOverflow = reserveOverflow; - } - /** - * Applies a tint to the overflow drawable. Does not modify the current tint - * mode, which is {@link PorterDuff.Mode#SRC_IN} by default. + * Set the icon to use for the overflow button. * - * @param tint the tint to apply, may be {@code null} to clear tint + * @param icon Drawable to set, may be null to clear the icon */ - public void setOverflowTintList(ColorStateList tint) { - if (mPresenter != null) { - mPresenter.setOverflowTintList(tint); - } + public void setOverflowIcon(@Nullable Drawable icon) { + getMenu(); + mPresenter.setOverflowIcon(icon); } /** - * Specifies the blending mode used to apply the tint specified by {@link - * #setOverflowTintList(ColorStateList)} to the overflow drawable. - * The default mode is {@link PorterDuff.Mode#SRC_IN}. + * Return the current drawable used as the overflow icon. * - * @param tintMode the blending mode used to apply the tint, may be {@code null} to clear tint + * @return The overflow icon drawable */ - public void setOverflowTintMode(PorterDuff.Mode tintMode) { - if (mPresenter != null) { - mPresenter.setOverflowTintMode(tintMode); - } + @Nullable + public Drawable getOverflowIcon() { + getMenu(); + return mPresenter.getOverflowIcon(); + } + + /** @hide */ + public boolean isOverflowReserved() { + return mReserveOverflow; + } + + /** @hide */ + public void setOverflowReserved(boolean reserveOverflow) { + mReserveOverflow = reserveOverflow; } @Override |