java.lang.Object
com.pranavpandey.android.dynamic.support.model.DynamicMenu
All Implemented Interfaces:
Parcelable

public class DynamicMenu extends Object implements Parcelable
A model class to store Menu menu information with an icon and a text.
  • Field Details

  • Constructor Details

    • DynamicMenu

      public DynamicMenu(@Nullable Drawable icon, @Nullable CharSequence title)
      Constructor to initialize an object of this class.
      Parameters:
      icon - The icon for this menu.
      title - The title for this menu.
    • DynamicMenu

      public DynamicMenu(@Nullable Drawable icon, @Nullable CharSequence title, @Nullable CharSequence subtitle)
      Constructor to initialize an object of this class.
      Parameters:
      icon - The icon for this menu.
      title - The title for this menu.
      subtitle - The subtitle for this menu.
    • DynamicMenu

      public DynamicMenu(@Nullable Drawable icon, @Nullable CharSequence title, @Nullable CharSequence subtitle, boolean hasSubmenu)
      Constructor to initialize an object of this class.
      Parameters:
      icon - The icon for this menu.
      title - The title for this menu.
      subtitle - The subtitle for this menu.
      hasSubmenu - true to enable submenu.
    • DynamicMenu

      public DynamicMenu(@NonNull Parcel in)
      Read an object of this class from the parcel.
      Parameters:
      in - The parcel to read the values.
  • Method Details

    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface Parcelable
    • writeToParcel

      public void writeToParcel(Parcel dest, int flags)
      Specified by:
      writeToParcel in interface Parcelable
    • getIcon

      @Nullable public Drawable getIcon()
      Get the icon used by this menu.
      Returns:
      The icon used by this menu.
    • setIcon

      @NonNull public DynamicMenu setIcon(@Nullable Drawable icon)
      Set the icon used by this menu.
      Parameters:
      icon - The icon to be set.
      Returns:
      The DynamicMenu object to allow for chaining of calls to set methods.
    • getTitle

      @Nullable public CharSequence getTitle()
      Get the title used by this menu.
      Returns:
      The title used by this menu.
    • setTitle

      @NonNull public DynamicMenu setTitle(@Nullable CharSequence title)
      Set the title used by this menu.
      Parameters:
      title - The title to be set.
      Returns:
      The DynamicMenu object to allow for chaining of calls to set methods.
    • getSubtitle

      @Nullable public CharSequence getSubtitle()
      Get the subtitle used by this menu.
      Returns:
      The subtitle used by this menu.
    • setSubtitle

      @NonNull public DynamicMenu setSubtitle(@Nullable CharSequence subtitle)
      Set the subtitle used by this menu.
      Parameters:
      subtitle - The subtitle to be set.
      Returns:
      The DynamicMenu object to allow for chaining of calls to set methods.
    • isHasSubmenu

      public boolean isHasSubmenu()
      Returns whether this menu has a submenu.
      Returns:
      true if this menu has a submenu.
    • setHasSubmenu

      @NonNull public DynamicMenu setHasSubmenu(boolean hasSubmenu)
      Sets if this menu has a submenu.
      Parameters:
      hasSubmenu - true to enable submenu.
      Returns:
      The DynamicMenu object to allow for chaining of calls to set methods.