Class DynamicThemePreview

All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent, BaseWidget, DynamicTintWidget, DynamicWidget

public class DynamicThemePreview extends ThemePreview<DynamicAppTheme>
A ThemePreview to show the DynamicAppTheme preview according to the selected values.
  • Constructor Details

  • Method Details

    • 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.
    • getDefaultTheme

      @NonNull public DynamicAppTheme getDefaultTheme()
      Description copied from class: ThemePreview
      Returns the default dynamic theme used by this preview.
      Specified by:
      getDefaultTheme in class ThemePreview<DynamicAppTheme>
      Returns:
      The default dynamic theme used by this preview.
    • 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
    • onUpdate

      protected 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
    • getActionView

      @NonNull public View getActionView()
      Description copied from class: ThemePreview
      Returns the action view used by this preview.
      Specified by:
      getActionView in class ThemePreview<DynamicAppTheme>
      Returns:
      The action view used by this preview.
    • getStatusBar

      public ImageView getStatusBar()
      Get the status bar used by this preview.
      Returns:
      The status bar used by this preview.
    • getBackgroundCard

      public ImageView getBackgroundCard()
      Get the background image view used by this preview.
      Returns:
      The background image view used by this preview.
    • getHeader

      public ViewGroup getHeader()
      Get the header background used by this preview.
      Returns:
      The header background used by this preview.
    • getHeaderIcon

      public ImageView getHeaderIcon()
      Get the header icon used by this preview.
      Returns:
      The header title used by this preview.
    • getHeaderTitle

      public ImageView getHeaderTitle()
      Get the header title used by this preview.
      Returns:
      The header title used by this preview.
    • getHeaderMenu

      public ImageView getHeaderMenu()
      Get the header menu used by this preview.
      Returns:
      The header menu used by this preview.
    • getHeaderShadow

      public ImageView getHeaderShadow()
      Get the header shadow used by this preview.
      Returns:
      The header shadow used by this preview.
    • getIcon

      public ImageView getIcon()
      Get the icon used by this preview.
      Returns:
      The icon used by this preview.
    • getTextPrimary

      public ImageView getTextPrimary()
      Get the primary text used by this preview.
      Returns:
      The primary text used by this preview.
    • getTextSecondary

      public ImageView getTextSecondary()
      Get the secondary text used by this preview.
      Returns:
      The secondary text used by this preview.
    • getTextTintBackground

      public ImageView getTextTintBackground()
      Get the background tint text used by this preview.
      Returns:
      The background tint text used by this preview.
    • getFAB

      public FloatingActionButton getFAB()
      Get the FAB used by this preview.
      Returns:
      The FAB used by this preview.