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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      View getView(int index, View view, ViewGroup viewGroup)
      void setSelectedPosition(int position) sets the selected item position.
      void setTextColor(@ColorInt() int color) sets the color of the default item text.
      void setMenuColor(@ColorInt() int color) sets the color of the menu item color.
      void setSelectedTextColor(@ColorInt() int color) sets the color of the selected item text.
      void setSelectedMenuColor(@ColorInt() int color) sets the color of the selected menu item color.
      void setSelectedEffect(boolean selectedEffect) sets the selected effects what changing colors of the selected menu item.
      void setTextSize(@Sp() int size) sets the size of the item text.
      void setIconSize(int iconSize) sets an icon size of the menu item.
      void setIconColor(int iconColor) sets an icon color of the menu item.
      void setIconPadding(int iconPadding) sets a padding value between icon and menu item.
      void setTextGravity(int gravity) sets the android.view.Gravity of the item.
      void setTextTypeface(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.