FileDocCategorySizeDatePackage
ActionMenuItem.javaAPI DocAndroid 5.1 API7679Thu Mar 12 22:22:56 GMT 2015android.support.v7.internal.view.menu

ActionMenuItem

public class ActionMenuItem extends Object implements android.support.v4.internal.view.SupportMenuItem
hide

Fields Summary
private final int
mId
private final int
mGroup
private final int
mCategoryOrder
private final int
mOrdering
private CharSequence
mTitle
private CharSequence
mTitleCondensed
private android.content.Intent
mIntent
private char
mShortcutNumericChar
private char
mShortcutAlphabeticChar
private android.graphics.drawable.Drawable
mIconDrawable
private int
mIconResId
private android.content.Context
mContext
private SupportMenuItem.OnMenuItemClickListener
mClickListener
private static final int
NO_ICON
private int
mFlags
private static final int
CHECKABLE
private static final int
CHECKED
private static final int
EXCLUSIVE
private static final int
HIDDEN
private static final int
ENABLED
Constructors Summary
public ActionMenuItem(android.content.Context context, int group, int id, int categoryOrder, int ordering, CharSequence title)


              
              
        mContext = context;
        mId = id;
        mGroup = group;
        mCategoryOrder = categoryOrder;
        mOrdering = ordering;
        mTitle = title;
    
Methods Summary
public booleancollapseActionView()

        return false;
    
public booleanexpandActionView()

        return false;
    
public android.view.ActionProvidergetActionProvider()

        throw new UnsupportedOperationException();
    
public android.view.ViewgetActionView()

        return null;
    
public chargetAlphabeticShortcut()

        return mShortcutAlphabeticChar;
    
public intgetGroupId()

        return mGroup;
    
public android.graphics.drawable.DrawablegetIcon()

        return mIconDrawable;
    
public android.content.IntentgetIntent()

        return mIntent;
    
public intgetItemId()

        return mId;
    
public android.view.ContextMenu.ContextMenuInfogetMenuInfo()

        return null;
    
public chargetNumericShortcut()

        return mShortcutNumericChar;
    
public intgetOrder()

        return mOrdering;
    
public android.view.SubMenugetSubMenu()

        return null;
    
public android.support.v4.view.ActionProvidergetSupportActionProvider()

        return null;
    
public java.lang.CharSequencegetTitle()

        return mTitle;
    
public java.lang.CharSequencegetTitleCondensed()

        return mTitleCondensed != null ? mTitleCondensed : mTitle;
    
public booleanhasSubMenu()

        return false;
    
public booleaninvoke()

        if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
            return true;
        }

        if (mIntent != null) {
            mContext.startActivity(mIntent);
            return true;
        }

        return false;
    
public booleanisActionViewExpanded()

        return false;
    
public booleanisCheckable()

        return (mFlags & CHECKABLE) != 0;
    
public booleanisChecked()

        return (mFlags & CHECKED) != 0;
    
public booleanisEnabled()

        return (mFlags & ENABLED) != 0;
    
public booleanisVisible()

        return (mFlags & HIDDEN) == 0;
    
public android.view.MenuItemsetActionProvider(android.view.ActionProvider actionProvider)

        throw new UnsupportedOperationException();
    
public android.support.v4.internal.view.SupportMenuItemsetActionView(android.view.View actionView)

        throw new UnsupportedOperationException();
    
public android.support.v4.internal.view.SupportMenuItemsetActionView(int resId)

        throw new UnsupportedOperationException();
    
public android.view.MenuItemsetAlphabeticShortcut(char alphaChar)

        mShortcutAlphabeticChar = alphaChar;
        return this;
    
public android.view.MenuItemsetCheckable(boolean checkable)

        mFlags = (mFlags & ~CHECKABLE) | (checkable ? CHECKABLE : 0);
        return this;
    
public android.view.MenuItemsetChecked(boolean checked)

        mFlags = (mFlags & ~CHECKED) | (checked ? CHECKED : 0);
        return this;
    
public android.view.MenuItemsetEnabled(boolean enabled)

        mFlags = (mFlags & ~ENABLED) | (enabled ? ENABLED : 0);
        return this;
    
public android.support.v7.internal.view.menu.ActionMenuItemsetExclusiveCheckable(boolean exclusive)

        mFlags = (mFlags & ~EXCLUSIVE) | (exclusive ? EXCLUSIVE : 0);
        return this;
    
public android.view.MenuItemsetIcon(android.graphics.drawable.Drawable icon)

        mIconDrawable = icon;
        mIconResId = NO_ICON;
        return this;
    
public android.view.MenuItemsetIcon(int iconRes)

        mIconResId = iconRes;
        mIconDrawable = ContextCompat.getDrawable(mContext, iconRes);
        return this;
    
public android.view.MenuItemsetIntent(android.content.Intent intent)

        mIntent = intent;
        return this;
    
public android.view.MenuItemsetNumericShortcut(char numericChar)

        mShortcutNumericChar = numericChar;
        return this;
    
public android.view.MenuItemsetOnActionExpandListener(MenuItem.OnActionExpandListener listener)

        throw new UnsupportedOperationException();
    
public android.view.MenuItemsetOnMenuItemClickListener(OnMenuItemClickListener menuItemClickListener)

        mClickListener = menuItemClickListener;
        return this;
    
public android.view.MenuItemsetShortcut(char numericChar, char alphaChar)

        mShortcutNumericChar = numericChar;
        mShortcutAlphabeticChar = alphaChar;
        return this;
    
public voidsetShowAsAction(int show)

        // Do nothing. ActionMenuItems always show as action buttons.
    
public android.support.v4.internal.view.SupportMenuItemsetShowAsActionFlags(int actionEnum)

        setShowAsAction(actionEnum);
        return this;
    
public android.support.v4.internal.view.SupportMenuItemsetSupportActionProvider(android.support.v4.view.ActionProvider actionProvider)

        throw new UnsupportedOperationException();
    
public android.support.v4.internal.view.SupportMenuItemsetSupportOnActionExpandListener(MenuItemCompat.OnActionExpandListener listener)

        // No need to save the listener; ActionMenuItem does not support collapsing items.
        return this;
    
public android.view.MenuItemsetTitle(java.lang.CharSequence title)

        mTitle = title;
        return this;
    
public android.view.MenuItemsetTitle(int title)

        mTitle = mContext.getResources().getString(title);
        return this;
    
public android.view.MenuItemsetTitleCondensed(java.lang.CharSequence title)

        mTitleCondensed = title;
        return this;
    
public android.view.MenuItemsetVisible(boolean visible)

        mFlags = (mFlags & HIDDEN) | (visible ? 0 : HIDDEN);
        return this;