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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the color for the code background.float
Returns the code contrast ratio for by this theme.Returns the data for the theme code.int
Returns the color for the code data.int
Returns the color for the code finder.int
Returns the color for the code overlay.int
Returns the color for the code stroke.int
Returns the style for the theme code.Returns the sharable data for the theme.boolean
Returns whether to the dynamic colors are used by this theme.boolean
isStroke()
Returns whether the stroke is required for this theme.Converts this theme into its JSON equivalent.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.AccentTheme
getAccentColor, getAccentColor, getAccentColor, getAccentColorDark, getAccentColorDark, getAccentColorDark, getTintAccentColor, getTintAccentColor, getTintAccentColor, getTintAccentColorDark, getTintAccentColorDark, getTintAccentColorDark, setAccentColor, setAccentColor, setAccentColorDark, setAccentColorDark, setTintAccentColor, setTintAccentColorDark
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.AutoTheme
autoGenerateColors, autoGenerateColors
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.BackgroundAware
getBackgroundAware, getBackgroundAware, getContrast, getContrast, getContrastRatio, isBackgroundAware, setBackgroundAware, setContrast
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.BackgroundTheme
getBackgroundColor, getBackgroundColor, getBackgroundColor, getTintBackgroundColor, getTintBackgroundColor, getTintBackgroundColor, isDarkTheme, isInverseTheme, isShowDividers, setBackgroundColor, setBackgroundColor, setTintBackgroundColor
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.BaseTheme
isHost, setHost
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.CornerTheme
getCornerRadius, getCornerRadius, getCornerSize, getCornerSize, setCornerRadius, setCornerSize
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.DynamicColor
getDynamicColors
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.ElevationTheme
getElevation, getElevation, isElevation, setElevation
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.ErrorTheme
getErrorColor, getErrorColor, getErrorColor, getTintErrorColor, getTintErrorColor, getTintErrorColor, setErrorColor, setErrorColor, setTintErrorColor
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.FallbackTheme
getThemeFallback
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.PrimaryTheme
getPrimaryColor, getPrimaryColor, getPrimaryColor, getPrimaryColorDark, getPrimaryColorDark, getPrimaryColorDark, getTintPrimaryColor, getTintPrimaryColor, getTintPrimaryColor, getTintPrimaryColorDark, getTintPrimaryColorDark, getTintPrimaryColorDark, setPrimaryColor, setPrimaryColor, setPrimaryColorDark, setPrimaryColorDark, setTintPrimaryColor, setTintPrimaryColorDark
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.ResourceTheme
getThemeRes, setThemeRes
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.StringTheme
toDynamicString, toJsonString
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.StrokeTheme
getStrokeColor
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.StyleTheme
getStyle, setStyle
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.SurfaceTheme
getSurfaceColor, getSurfaceColor, getSurfaceColor, getTintSurfaceColor, getTintSurfaceColor, getTintSurfaceColor, isBackgroundSurface, setSurfaceColor, setSurfaceColor, setTintSurfaceColor
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.TextTheme
getFontScale, getFontScale, getFontScaleRelative, getHighlightColor, getHighlightColor, getTextPrimaryColor, getTextPrimaryColor, getTextPrimaryColor, getTextPrimaryColorInverse, getTextPrimaryColorInverse, getTextPrimaryColorInverse, getTextSecondaryColor, getTextSecondaryColor, getTextSecondaryColor, getTextSecondaryColorInverse, getTextSecondaryColorInverse, getTextSecondaryColorInverse, isFontScale, setFontScale, setTextPrimaryColor, setTextPrimaryColor, setTextPrimaryColorInverse, setTextSecondaryColor, setTextSecondaryColor, setTextSecondaryColorInverse
Methods inherited from interface com.pranavpandey.android.dynamic.theme.base.TranslucentTheme
getAlpha, getOpacity, getOpacity, isTranslucent, setOpacity
-
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 interfaceDynamicColor<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 interfaceStrokeTheme<T extends AppTheme<T>>
- Returns:
true
if the stroke is required for this theme.
-
getThemeData
Description copied from interface:StringTheme
Returns the sharable data for the theme.- Specified by:
getThemeData
in interfaceStringTheme<T extends AppTheme<T>>
- Returns:
- The sharable data for the theme.
-
getCodeData
Description copied from interface:CodeTheme
Returns the data for the theme code.- Specified by:
getCodeData
in interfaceCodeTheme<T extends AppTheme<T>>
- Returns:
- The data for the theme code.
-
getCodeBackgroundColor
Description copied from interface:CodeTheme
Returns the color for the code background.- Specified by:
getCodeBackgroundColor
in interfaceCodeTheme<T extends AppTheme<T>>
- Returns:
- The color for the code background.
-
getCodeStrokeColor
Description copied from interface:CodeTheme
Returns the color for the code stroke.- Specified by:
getCodeStrokeColor
in interfaceCodeTheme<T extends AppTheme<T>>
- Returns:
- The color for the code stroke.
-
getCodeDataColor
Description copied from interface:CodeTheme
Returns the color for the code data.- Specified by:
getCodeDataColor
in interfaceCodeTheme<T extends AppTheme<T>>
- Returns:
- The color for the code data.
-
getCodeFinderColor
Description copied from interface:CodeTheme
Returns the color for the code finder.- Specified by:
getCodeFinderColor
in interfaceCodeTheme<T extends AppTheme<T>>
- Returns:
- The color for the finder data.
-
getCodeOverlayColor
Description copied from interface:CodeTheme
Returns the color for the code overlay.- Specified by:
getCodeOverlayColor
in interfaceCodeTheme<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 interfaceCodeTheme<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 interfaceCodeTheme<T extends AppTheme<T>>
- Returns:
- The style for the theme code.
-
toJsonString
Description copied from interface:StringTheme
Converts this theme into its JSON equivalent.- Specified by:
toJsonString
in interfaceStringTheme<T extends AppTheme<T>>
- Returns:
- The JSON equivalent of this theme.
-