diff options
Diffstat (limited to 'core/java/android/view/MenuItem.java')
| -rw-r--r-- | core/java/android/view/MenuItem.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/view/MenuItem.java b/core/java/android/view/MenuItem.java index 9e8b97e..2948007 100644 --- a/core/java/android/view/MenuItem.java +++ b/core/java/android/view/MenuItem.java @@ -21,6 +21,8 @@ import android.annotation.LayoutRes; import android.annotation.StringRes; import android.app.Activity; import android.content.Intent; +import android.content.res.ColorStateList; +import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.view.ContextMenu.ContextMenuInfo; import android.view.View.OnCreateContextMenuListener; @@ -599,4 +601,26 @@ public interface MenuItem { * @return This menu item instance for call chaining */ public MenuItem setOnActionExpandListener(OnActionExpandListener listener); + + /** + * Applies a tint to the icon drawable. Does not modify the current tint + * mode, which is {@link PorterDuff.Mode#SRC_IN} by default. + * <p> + * Subsequent calls to {@link android.view.MenuItem#setIcon(android.graphics.drawable.Drawable)} + * will automatically mutate the drawable and apply the specified tint and tint mode. + * + * @param tint the tint to apply, may be {@code null} to clear tint + * @return This menu item instance for call chaining + */ + public MenuItem setIconTintList(ColorStateList tint); + + /** + * Specifies the blending mode used to apply the tint specified by {@link + * #setIconTintList(ColorStateList)} to the icon drawable. The default mode is {@link + * PorterDuff.Mode#SRC_IN}. + * + * @param tintMode the blending mode used to apply the tint, may be {@code null} to clear tint + * @return This menu item instance for call chaining + */ + public MenuItem setIconTintMode(PorterDuff.Mode tintMode); } |
