All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent, BaseWidget, DynamicTintWidget, DynamicWidget
Direct Known Subclasses:
DynamicInfoViewBig, DynamicInfoViewBigAuthor

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

Links can be clickable or pass null URL to just show or completely hide them.

  • Constructor Details

  • Method Details

    • onLoadAttributes

      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 for this view.
      Parameters:
      icon - The icon to be set.
    • getIconBig

      @Nullable public Drawable getIconBig()
      Get the big fallback icon used by this view.
      Returns:
      The big fallback icon used by this view.
    • setIconBig

      public void setIconBig(@Nullable Drawable iconBig)
      Set the big fallback icon for this view.
      Parameters:
      iconBig - The big fallback 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 for 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 for this view.
      Parameters:
      subtitle - The subtitle to be set.
    • getDescription

      @Nullable public CharSequence getDescription()
      Get the description used by this view.
      Returns:
      The description used by this view.
    • setDescription

      public void setDescription(@Nullable CharSequence description)
      Set the description for this view.
      Parameters:
      description - The description to be set.
    • getStatus

      @Nullable public CharSequence getStatus()
      Get the status used by this view.
      Returns:
      The status used by this view.
    • setStatus

      public void setStatus(@Nullable CharSequence status)
      Set the status for this view.
      Parameters:
      status - The status to be set.
    • getLinks

      @Nullable public CharSequence[] getLinks()
      Get the title for the links used by this view.
      Returns:
      The title for the links used by this view.
    • setLinks

      public void setLinks(@Nullable CharSequence[] links)
      Set the title for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      links - The titles for the links to be set.
    • getLinksSubtitles

      @Nullable public CharSequence[] getLinksSubtitles()
      Get the subtitle for the links used by this view.
      Returns:
      The subtitle for the links used by this view.
    • setLinksSubtitles

      public void setLinksSubtitles(@Nullable CharSequence[] linksSubtitles)
      Set the subtitle for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      linksSubtitles - The subtitles for the links to be set.
    • getLinksUrls

      @Nullable public CharSequence[] getLinksUrls()
      Get the URL for the links used by this view.
      Returns:
      The URL for the links used by this view.
    • setLinksUrls

      public void setLinksUrls(@Nullable CharSequence[] linksUrls)
      Set the URL for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      linksUrls - The urls for the links to be set.
    • getLinksIconsId

      @ArrayRes public int getLinksIconsId()
      Get the icons array resource for the links used by this view.
      Returns:
      The icons array resource for the links used by this view.
    • setLinksIconsId

      public void setLinksIconsId(@ArrayRes int linksIconsResId)
      Set the icons array resource for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      linksIconsResId - The icon drawables array resource for the links to be set.
    • getLinksColorsId

      @ArrayRes public int getLinksColorsId()
      Get the icon tint colors array resource for the links used by this view.
      Returns:
      The icon tint colors array resource for the links used by this view.
    • setLinksColorsId

      public void setLinksColorsId(@ArrayRes int linksColorsResId)
      Set the icon tint colors array resource for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      linksColorsResId - The icon tint colors array resource for the links to be set.
    • getLinksDrawables

      @Nullable public Drawable[] getLinksDrawables()
      Get the icon for the links used by this view.
      Returns:
      The icon for the links used by this view.
    • setLinksDrawables

      public void setLinksDrawables(@Nullable Drawable[] linksDrawables)
      Set the icon for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      linksDrawables - The icon drawables for the links to be set.
    • getLinksColors

      @Nullable public Integer[] getLinksColors()
      Get the icon tint color for the links used by this view.
      Returns:
      The icon tint color for the links used by this view.
    • setLinksColors

      public void setLinksColors(@Nullable Integer[] linksColors)
      Set the icon tint color for the links used by this view.

      Automatic refresh is disabled due to the stability reasons.

      Please call onUpdate() to refresh the view.

      Parameters:
      linksColors - The icon tint color for the links to be set.
    • getVisibilityIconView

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

      @NonNull public ViewGroup getInfoView()
      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.
    • getIconBigView

      @Nullable public ImageView getIconBigView()
      Get the image view to show big fallback icon used by this view.
      Returns:
      The image view to show big fallback 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.
    • getDescriptionView

      @Nullable public TextView getDescriptionView()
      Get the text view to show the description used by this view.
      Returns:
      The text view to show the description used by this view.
    • getStatusView

      @Nullable public TextView getStatusView()
      Get the text view to show the status used by this view.
      Returns:
      The text view to show the status used by this view.
    • getLinksView

      @Nullable public RecyclerView getLinksView()
      Get the recycler view to show the links associated with this view.
      Returns:
      The recycler view to show the links associated with this view.