FileDocCategorySizeDatePackage
ExpandedMenuView.javaAPI DocAndroid 1.5 API3205Wed May 06 22:41:56 BST 2009com.android.internal.view.menu

ExpandedMenuView

public final class ExpandedMenuView extends android.widget.ListView implements android.widget.AdapterView.OnItemClickListener, com.android.internal.view.menu.MenuBuilder.ItemInvoker, MenuView
The expanded menu view is a list-like menu with all of the available menu items. It is opened by the user clicking no the 'More' button on the icon menu view.

Fields Summary
private MenuBuilder
mMenu
private int
mAnimations
Default animations for this menu
Constructors Summary
public ExpandedMenuView(android.content.Context context, android.util.AttributeSet attrs)
Instantiates the ExpandedMenuView that is linked with the provided MenuBuilder.

param
menu The model for the menu which this MenuView will display

        super(context, attrs);
        
        TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.MenuView, 0, 0);
        mAnimations = a.getResourceId(com.android.internal.R.styleable.MenuView_windowAnimationStyle, 0);
        a.recycle();

        setOnItemClickListener(this);
    
Methods Summary
public intgetWindowAnimations()

        return mAnimations;
    
public voidinitialize(MenuBuilder menu, int menuType)

        mMenu = menu;

        setAdapter(menu.new MenuAdapter(menuType));
    
public booleaninvokeItem(MenuItemImpl item)

        return mMenu.performItemAction(item, 0);
    
protected voidonDetachedFromWindow()

        super.onDetachedFromWindow();
        
        // Clear the cached bitmaps of children
        setChildrenDrawingCacheEnabled(false);
    
public voidonItemClick(android.widget.AdapterView parent, android.view.View v, int position, long id)

        invokeItem((MenuItemImpl) getAdapter().getItem(position));
    
protected booleanrecycleOnMeasure()

        return false;
    
public voidupdateChildren(boolean cleared)

        ListAdapter adapter = getAdapter();
        // Tell adapter of the change, it will notify the mListView
        if (adapter != null) {
            if (cleared) {
                ((BaseAdapter)adapter).notifyDataSetInvalidated();
            }
            else {
                ((BaseAdapter)adapter).notifyDataSetChanged();
            }
        }