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

SubMenuBuilder

public class SubMenuBuilder extends MenuBuilder implements android.view.SubMenu
The model for a sub menu, which is an extension of the menu. Most methods are proxied to the parent menu.
hide

Fields Summary
private MenuBuilder
mParentMenu
private MenuItemImpl
mItem
Constructors Summary
public SubMenuBuilder(android.content.Context context, MenuBuilder parentMenu, MenuItemImpl item)

        super(context);

        mParentMenu = parentMenu;
        mItem = item;
    
Methods Summary
public booleancollapseItemActionView(MenuItemImpl item)

        return mParentMenu.collapseItemActionView(item);
    
booleandispatchMenuItemSelected(MenuBuilder menu, android.view.MenuItem item)

        return super.dispatchMenuItemSelected(menu, item) ||
                mParentMenu.dispatchMenuItemSelected(menu, item);
    
public booleanexpandItemActionView(MenuItemImpl item)

        return mParentMenu.expandItemActionView(item);
    
public java.lang.StringgetActionViewStatesKey()

        final int itemId = mItem != null ? mItem.getItemId() : 0;
        if (itemId == 0) {
            return null;
        }
        return super.getActionViewStatesKey() + ":" + itemId;
    
public android.view.MenuItemgetItem()

        return mItem;
    
public android.view.MenugetParentMenu()

        return mParentMenu;
    
public MenuBuildergetRootMenu()

        return mParentMenu;
    
public booleanisQwertyMode()

        return mParentMenu.isQwertyMode();
    
public booleanisShortcutsVisible()

        return mParentMenu.isShortcutsVisible();
    
public voidsetCallback(Callback callback)

        mParentMenu.setCallback(callback);
    
public android.view.SubMenusetHeaderIcon(android.graphics.drawable.Drawable icon)

        super.setHeaderIconInt(icon);
        return this;
    
public android.view.SubMenusetHeaderIcon(int iconRes)

        super.setHeaderIconInt(ContextCompat.getDrawable(getContext(), iconRes));
        return this;
    
public android.view.SubMenusetHeaderTitle(java.lang.CharSequence title)

        super.setHeaderTitleInt(title);
        return this;
    
public android.view.SubMenusetHeaderTitle(int titleRes)

        super.setHeaderTitleInt(getContext().getResources().getString(titleRes));
        return this;
    
public android.view.SubMenusetHeaderView(android.view.View view)

        super.setHeaderViewInt(view);
        return this;
    
public android.view.SubMenusetIcon(android.graphics.drawable.Drawable icon)

        mItem.setIcon(icon);
        return this;
    
public android.view.SubMenusetIcon(int iconRes)

        mItem.setIcon(iconRes);
        return this;
    
public voidsetQwertyMode(boolean isQwerty)

        mParentMenu.setQwertyMode(isQwerty);
    
public voidsetShortcutsVisible(boolean shortcutsVisible)

        mParentMenu.setShortcutsVisible(shortcutsVisible);