Package com.skydoves.powermenu
Class MenuBaseAdapter
-
- All Implemented Interfaces:
-
android.widget.Adapter,android.widget.ListAdapter,android.widget.SpinnerAdapter,com.skydoves.powermenu.IMenuItem
public class MenuBaseAdapter<T> extends BaseAdapter implements IMenuItem<T>
MenuBaseAdapter is the base adapter class for CustomPowerMenu.
-
-
Field Summary
Fields Modifier and Type Field Description public final List<T>itemListpublic ListViewlistViewpublic intselectedPositionpublic StringpreferenceNamepublic final static intIGNORE_ITEM_VIEW_TYPEpublic final static intNO_SELECTION
-
Constructor Summary
Constructors Constructor Description MenuBaseAdapter()MenuBaseAdapter(ListView listView)
-
Method Summary
Modifier and Type Method Description List<T>getItemList()gets the item list. ListViewgetListView()gets the ListView. voidsetListView(ListView listView)sets the ListView. intgetSelectedPosition()gets the selected item position. voidsetSelectedPosition(int position)sets the selected item position. StringgetPreferenceName()intgetCount()ObjectgetItem(int index)longgetItemId(int index)ViewgetView(int index, View view, ViewGroup viewGroup)voidaddItem(T item)add an item. voidaddItem(int position, T item)add an item on a specific position. voidaddItemList(List<T> itemList)add an item list. voidremoveItem(T item)removes an item of the list. voidremoveItem(int position)removes an item on a specific position. voidclearItems()clears all the items of the list. intgetContentViewHeight()gets the content view height of the list. voidsetPreference(String preferenceName)-
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getAutofillOptions, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MenuBaseAdapter
MenuBaseAdapter()
-
MenuBaseAdapter
MenuBaseAdapter(ListView listView)
-
-
Method Detail
-
getItemList
List<T> getItemList()
gets the item list.
-
getListView
ListView getListView()
gets the ListView.
-
setListView
void setListView(ListView listView)
sets the ListView.
- Parameters:
listView- ListView.
-
getSelectedPosition
int getSelectedPosition()
gets the selected item position.
-
setSelectedPosition
void setSelectedPosition(int position)
sets the selected item position.
- Parameters:
position- a selected item position.
-
getPreferenceName
String getPreferenceName()
-
getCount
int getCount()
-
getItemId
long getItemId(int index)
-
addItem
void addItem(int position, T item)
add an item on a specific position.
- Parameters:
position- position of the list.item- an item.
-
addItemList
void addItemList(List<T> itemList)
add an item list.
- Parameters:
itemList- an item list.
-
removeItem
void removeItem(T item)
removes an item of the list.
- Parameters:
item- an item.
-
removeItem
void removeItem(int position)
removes an item on a specific position.
- Parameters:
position- an item position.
-
clearItems
void clearItems()
clears all the items of the list.
-
getContentViewHeight
int getContentViewHeight()
gets the content view height of the list.
-
setPreference
void setPreference(String preferenceName)
-
-
-
-