Methods Summary |
---|
private void | findExpandedIndex()
final MenuItemImpl expandedItem = mMenu.getExpandedItem();
if (expandedItem != null) {
final ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
final int count = items.size();
for (int i = 0; i < count; i++) {
final MenuItemImpl item = items.get(i);
if (item == expandedItem) {
mExpandedIndex = i;
return;
}
}
}
|
public int | getCount()
ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
if (mExpandedIndex < 0) {
return items.size();
}
return items.size() - 1;
|
public com.android.internal.view.menu.MenuItemImpl | getItem(int position)
ArrayList<MenuItemImpl> items = mMenu.getNonActionItems();
if (mExpandedIndex >= 0 && position >= mExpandedIndex) {
position++;
}
return items.get(position);
|
public long | getItemId(int position)
// Since a menu item's ID is optional, we'll use the position as an
// ID for the item in the AdapterView
return position;
|
public android.view.View | getView(int position, android.view.View convertView, android.view.ViewGroup parent)
if (convertView == null) {
LayoutInflater mInflater = LayoutInflater.from(context);
convertView = mInflater.inflate(com.android.internal.R.layout.popup_menu_item_layout,
parent, false);
}
MenuView.ItemView itemView = (MenuView.ItemView) convertView;
itemView.initialize(getItem(position), 0);
return convertView;
|