Package icyllis.modernui.view.menu

# Class MenuAdapter

java.lang.Object
icyllis.modernui.widget.BaseAdapter
icyllis.modernui.view.menu.MenuAdapter

All Implemented Interfaces:
  `Adapter`, `ListAdapter`, `SpinnerAdapter`

public class MenuAdapter extends BaseAdapter

- ## Field Summary

  ### Fields inherited from interface icyllis.modernui.widget.Adapter

  `IGNORE_ITEM_VIEW_TYPE, NO_SELECTION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MenuAdapter(Context context, MenuBuilder menu, boolean overflowOnly)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MenuBuilder`
  `getAdapterMenu()`
  `int`
  `getCount()`
  How many items are in the data set represented by this Adapter.
  `boolean`
  `getForceShowIcon()`
  `MenuItemImpl`
  `getItem(int position)`
  Get the data item associated with the specified position in the data set.
  `long`
  `getItemId(int position)`
  Get the row id associated with the specified position in the list.
  `View`
  `getView(int position, View convertView, ViewGroup parent)`
  Get a View that displays the data at the specified position in the data set.
  `void`
  `notifyDataSetChanged()`
  Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.
  `void`
  `setForceShowIcon(boolean forceShow)`

  ### Methods inherited from class icyllis.modernui.widget.BaseAdapter

  `areAllItemsEnabled, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MenuAdapter

    public MenuAdapter(Context context, MenuBuilder menu, boolean overflowOnly)

- ## Method Details

  - ### getForceShowIcon

    public boolean getForceShowIcon()

  - ### setForceShowIcon

    public void setForceShowIcon(boolean forceShow)

  - ### getCount

    public int getCount()
    Description copied from interface: `Adapter`
    How many items are in the data set represented by this Adapter.
    Returns:
      Count of items.

  - ### getAdapterMenu

    public MenuBuilder getAdapterMenu()

  - ### getItem

    @NonNull public MenuItemImpl getItem(int position)
    Description copied from interface: `Adapter`
    Get the data item associated with the specified position in the data set.
    Parameters:
      `position` - Position of the item whose data we want within the adapter's data set.
    Returns:
      The data at the specified position, may be null.

  - ### getItemId

    public long getItemId(int position)
    Description copied from interface: `Adapter`
    Get the row id associated with the specified position in the list.
    Parameters:
      `position` - The position of the item within the adapter's data set whose row id we want.
    Returns:
      The id of the item at the specified position.

  - ### getView

    @NonNull public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent)
    Description copied from interface: `Adapter`
    Get a View that displays the data at the specified position in the data set. You can create a View manually.

    This method should not return null unless the item count is zero.

    Parameters:
      `position` - The position of the item within the adapter's data set of the item whose view we want.
      `convertView` - The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view. Heterogeneous lists can specify their number of view types, so that this View is always of the right type (see `Adapter.getViewTypeCount()` and `Adapter.getItemViewType(int)`).
      `parent` - The parent that this view will eventually be attached to
    Returns:
      A View corresponding to the data at the specified position.

  - ### notifyDataSetChanged

    public void notifyDataSetChanged()
    Description copied from class: `BaseAdapter`
    Notifies the attached observers that the underlying data has been changed and any View reflecting the data set should refresh itself.
    Overrides:
      `notifyDataSetChanged` in class `BaseAdapter`