Package com.skydoves.powermenu
Class MenuListAdapter
-
- All Implemented Interfaces:
-
android.widget.Adapter,android.widget.ListAdapter,android.widget.SpinnerAdapter,com.skydoves.powermenu.IMenuItem,com.skydoves.powermenu.IPowerMenuAdapter
public class MenuListAdapter extends MenuBaseAdapter<T> implements IPowerMenuAdapter
MenuListAdapter extends MenuBaseAdapter.
This is the PowerMenu's default adapter.
-
-
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 MenuListAdapter(ListView listView)
-
Method Summary
Modifier and Type Method Description ViewgetView(int index, View view, ViewGroup viewGroup)voidsetSelectedPosition(int position)sets the selected item position. voidsetTextColor(@ColorInt() int color)sets the color of the default item text. voidsetMenuColor(@ColorInt() int color)sets the color of the menu item color. voidsetSelectedTextColor(@ColorInt() int color)sets the color of the selected item text. voidsetSelectedMenuColor(@ColorInt() int color)sets the color of the selected menu item color. voidsetSelectedEffect(boolean selectedEffect)sets the selected effects what changing colors of the selected menu item. voidsetTextSize(@Sp() int size)sets the size of the item text. voidsetIconSize(int iconSize)sets an icon size of the menu item. voidsetIconColor(int iconColor)sets an icon color of the menu item. voidsetIconPadding(int iconPadding)sets a padding value between icon and menu item. voidsetTextGravity(int gravity)sets the android.view.Gravity of the item. voidsetTextTypeface(Typeface typeface)sets the Typeface of the item. -
Methods inherited from class com.skydoves.powermenu.MenuBaseAdapter
addItem, addItem, addItemList, clearItems, getContentViewHeight, getCount, getItem, getItemId, getItemList, getListView, getPreferenceName, getSelectedPosition, removeItem, removeItem, setListView, setPreference -
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getAutofillOptions, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver -
Methods inherited from class android.widget.Adapter
getCount, getItem, getItemId, getView -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MenuListAdapter
MenuListAdapter(ListView listView)
-
-
Method Detail
-
setSelectedPosition
void setSelectedPosition(int position)
sets the selected item position.
- Parameters:
position- a selected item position.
-
setTextColor
void setTextColor(@ColorInt() int color)
sets the color of the default item text.
- Parameters:
color- color value.
-
setMenuColor
void setMenuColor(@ColorInt() int color)
sets the color of the menu item color.
- Parameters:
color- color value.
-
setSelectedTextColor
void setSelectedTextColor(@ColorInt() int color)
sets the color of the selected item text.
- Parameters:
color- color value.
-
setSelectedMenuColor
void setSelectedMenuColor(@ColorInt() int color)
sets the color of the selected menu item color.
- Parameters:
color- color value.
-
setSelectedEffect
void setSelectedEffect(boolean selectedEffect)
sets the selected effects what changing colors of the selected menu item.
- Parameters:
selectedEffect- enable or unable.
-
setTextSize
void setTextSize(@Sp() int size)
sets the size of the item text.
- Parameters:
size- size value.
-
setIconSize
void setIconSize(int iconSize)
sets an icon size of the menu item.
- Parameters:
iconSize- icon size of the menu item.
-
setIconColor
void setIconColor(int iconColor)
sets an icon color of the menu item.
- Parameters:
iconColor- icon color of the menu item.
-
setIconPadding
void setIconPadding(int iconPadding)
sets a padding value between icon and menu item.
- Parameters:
iconPadding- padding value between icon and menu item.
-
setTextGravity
void setTextGravity(int gravity)
sets the android.view.Gravity of the item.
- Parameters:
gravity- gravity value.
-
setTextTypeface
void setTextTypeface(Typeface typeface)
sets the Typeface of the item.
- Parameters:
typeface- typeface value.
-
-
-
-