All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent, BaseWidget, DynamicTintWidget, DynamicWidget
Direct Known Subclasses:
DynamicEmptyView, DynamicHeader, DynamicItemViewDialog, DynamicSpinnerView

public class DynamicItemView extends DynamicView implements DynamicWidget
A DynamicView with an icon, title and subtitle functionality that can be used to show various information according to the requirement.

Use getItemView() method to set click listeners or to perform other operations.

  • Constructor Details

  • Method Details

    • onLoadAttributes

      @CallSuper protected void onLoadAttributes(@Nullable AttributeSet attrs)
      Description copied from class: DynamicView
      Load values from the supplied attribute set.
      Overrides:
      onLoadAttributes in class DynamicView
      Parameters:
      attrs - The attribute set to load the values.
    • getLayoutRes

      @LayoutRes protected int getLayoutRes()
      Description copied from class: DynamicView
      This method will be called to get the layout resource for this view.

      Supply the view layout resource here to do the inflation.

      Specified by:
      getLayoutRes in class DynamicView
      Returns:
      The layout resource for this view.
    • onInflate

      protected void onInflate()
      Description copied from class: DynamicView
      This method will be called after loading the attributed.

      Initialize the view layout here.

      Specified by:
      onInflate in class DynamicView
    • setColor

      public void setColor()
      Description copied from interface: DynamicWidget
      Set color for this widget according to the supplied values.
      Specified by:
      setColor in interface DynamicWidget
      Overrides:
      setColor in class DynamicView
    • onUpdate

      public void onUpdate()
      Description copied from class: DynamicView
      This method will be called whenever there is a change in the view attributes or parameters.

      It is better to do any real time calculation like updating the value string or checked state in this method.

      Specified by:
      onUpdate in class DynamicView
    • onEnabled

      protected void onEnabled(boolean enabled)
      Description copied from class: DynamicView
      This method will be called whenever there is a change in the view state.

      Either enabled or disabled, other views like icon, title, color, etc. must be updated here to reflect the overall view state.

      Overrides:
      onEnabled in class DynamicView
      Parameters:
      enabled - true if this view is enabled and can receive click events.
    • getBackgroundView

      @Nullable public View getBackgroundView()
      Description copied from class: DynamicView
      This method will be called to return the optional background view.

      It will be useful in tinting the background according to the contrast with color.

      Specified by:
      getBackgroundView in class DynamicView
      Returns:
      The optional background view.
    • getIcon

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

      public void setIcon(@Nullable Drawable icon)
      Set the icon used by this view.
      Parameters:
      icon - The icon to be set.
    • getTitle

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

      public void setTitle(@Nullable CharSequence title)
      Set the title used by this view.
      Parameters:
      title - The title to be set.
    • getSubtitle

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

      public void setSubtitle(@Nullable CharSequence subtitle)
      Set the subtitle used by this view.
      Parameters:
      subtitle - The subtitle to be set.
    • isShowDivider

      public boolean isShowDivider()
      Returns whether to show the horizontal divider.

      Useful to display in a list view.

      Returns:
      true to show the horizontal divider.
    • setShowDivider

      public void setShowDivider(boolean showDivider)
      Set the horizontal divider fro this view.

      Useful to display in a list view.

      Parameters:
      showDivider - true to show the horizontal divider.
    • isFillSpace

      public boolean isFillSpace()
      Returns whether to fill the empty icon space if applicable.
      Returns:
      true to fill the empty icon space if applicable.
    • setFillSpace

      public void setFillSpace(boolean fillSpace)
      Controls the fill empty space behavior for this view.
      Parameters:
      fillSpace - true to fill the empty icon space.
    • getVisibilityIconView

      public int getVisibilityIconView()
      Returns the visibility of the icon view.
      Returns:
      The visibility of the icon view.
    • getItemView

      @NonNull public ViewGroup getItemView()
      Get the root element of this view.
      Returns:
      The root element of this view
    • getIconView

      @Nullable public ImageView getIconView()
      Get the image view to show the icon used by this view.
      Returns:
      The image view to show the icon used by this view.
    • getIconFooterView

      @Nullable public ImageView getIconFooterView()
      Get the image view to show the footer icon used by this view.
      Returns:
      The image view to show the footer icon used by this view.
    • getTitleView

      @Nullable public TextView getTitleView()
      Get the text view to show the title used by this view.
      Returns:
      The text view to show the title used by this view.
    • getSubtitleView

      @Nullable public TextView getSubtitleView()
      Get the text view to show the subtitle used by this view.
      Returns:
      The text view to show the subtitle used by this view.
    • getDivider

      @Nullable public View getDivider()
      Get the view to show the divider used by this view.
      Returns:
      The view to show the divider used by this view.