Class AppTheme<T extends AppTheme<T>>

java.lang.Object
com.pranavpandey.android.dynamic.theme.AppTheme<T>
Type Parameters:
T - The type of the dynamic theme.
All Implemented Interfaces:
AccentTheme<T>, AutoTheme<T>, BackgroundAware<T>, BackgroundTheme<T>, BaseTheme<T>, CodeTheme<T>, CornerTheme<T>, DynamicColor<T>, ElevationTheme<T>, ErrorTheme<T>, FallbackTheme<T>, PrimaryTheme<T>, ResourceTheme<T>, StringTheme<T>, StrokeTheme<T>, StyleTheme<T>, SurfaceTheme<T>, TextTheme<T>, TranslucentTheme<T>, TypeTheme<T>
Direct Known Subclasses:
AppWidgetTheme

public abstract class AppTheme<T extends AppTheme<T>> extends Object implements BaseTheme<T>, FallbackTheme<T>, ResourceTheme<T>, DynamicColor<T>, TextTheme<T>, AutoTheme<T>, CornerTheme<T>, BackgroundAware<T>, StrokeTheme<T>, TranslucentTheme<T>, StyleTheme<T>, TypeTheme<T>, StringTheme<T>, CodeTheme<T>
An abstract class to implement an app theme.
  • Constructor Details

    • AppTheme

      public AppTheme()
  • Method Details

    • isDynamicColor

      public boolean isDynamicColor()
      Description copied from interface: DynamicColor
      Returns whether to the dynamic colors are used by this theme.
      Specified by:
      isDynamicColor in interface DynamicColor<T extends AppTheme<T>>
      Returns:
      true if the dynamic colors are used by this theme.
    • isStroke

      public boolean isStroke()
      Description copied from interface: StrokeTheme
      Returns whether the stroke is required for this theme.
      Specified by:
      isStroke in interface StrokeTheme<T extends AppTheme<T>>
      Returns:
      true if the stroke is required for this theme.
    • getThemeData

      @NonNull public String getThemeData()
      Description copied from interface: StringTheme
      Returns the sharable data for the theme.
      Specified by:
      getThemeData in interface StringTheme<T extends AppTheme<T>>
      Returns:
      The sharable data for the theme.
    • getCodeData

      @NonNull public String getCodeData()
      Description copied from interface: CodeTheme
      Returns the data for the theme code.
      Specified by:
      getCodeData in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The data for the theme code.
    • getCodeBackgroundColor

      @ColorInt public int getCodeBackgroundColor()
      Description copied from interface: CodeTheme
      Returns the color for the code background.
      Specified by:
      getCodeBackgroundColor in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The color for the code background.
    • getCodeStrokeColor

      @ColorInt public int getCodeStrokeColor()
      Description copied from interface: CodeTheme
      Returns the color for the code stroke.
      Specified by:
      getCodeStrokeColor in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The color for the code stroke.
    • getCodeDataColor

      @ColorInt public int getCodeDataColor()
      Description copied from interface: CodeTheme
      Returns the color for the code data.
      Specified by:
      getCodeDataColor in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The color for the code data.
    • getCodeFinderColor

      @ColorInt public int getCodeFinderColor()
      Description copied from interface: CodeTheme
      Returns the color for the code finder.
      Specified by:
      getCodeFinderColor in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The color for the finder data.
    • getCodeOverlayColor

      @ColorInt public int getCodeOverlayColor()
      Description copied from interface: CodeTheme
      Returns the color for the code overlay.
      Specified by:
      getCodeOverlayColor in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The color for the code overlay.
    • getCodeContrastRatio

      public float getCodeContrastRatio()
      Description copied from interface: CodeTheme
      Returns the code contrast ratio for by this theme.
      Specified by:
      getCodeContrastRatio in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The code contrast ratio for by this theme.
    • getCodeStyle

      public int getCodeStyle()
      Description copied from interface: CodeTheme
      Returns the style for the theme code.
      Specified by:
      getCodeStyle in interface CodeTheme<T extends AppTheme<T>>
      Returns:
      The style for the theme code.
    • toJsonString

      @NonNull public String toJsonString()
      Description copied from interface: StringTheme
      Converts this theme into its JSON equivalent.
      Specified by:
      toJsonString in interface StringTheme<T extends AppTheme<T>>
      Returns:
      The JSON equivalent of this theme.