Class DynamicWidgetTheme
java.lang.Object
com.pranavpandey.android.dynamic.theme.AppTheme<DynamicAppTheme>
com.pranavpandey.android.dynamic.support.model.DynamicAppTheme
com.pranavpandey.android.dynamic.support.model.DynamicWidgetTheme
- All Implemented Interfaces:
Parcelable
,AccentTheme<DynamicAppTheme>
,AutoTheme<DynamicAppTheme>
,BackgroundAware<DynamicAppTheme>
,BackgroundTheme<DynamicAppTheme>
,BaseTheme<DynamicAppTheme>
,CodeTheme<DynamicAppTheme>
,CornerTheme<DynamicAppTheme>
,DynamicColor<DynamicAppTheme>
,ElevationTheme<DynamicAppTheme>
,ErrorTheme<DynamicAppTheme>
,FallbackTheme<DynamicAppTheme>
,PrimaryTheme<DynamicAppTheme>
,ResourceTheme<DynamicAppTheme>
,StringTheme<DynamicAppTheme>
,StrokeTheme<DynamicAppTheme>
,StyleTheme<DynamicAppTheme>
,SurfaceTheme<DynamicAppTheme>
,TextTheme<DynamicAppTheme>
,TranslucentTheme<DynamicAppTheme>
,TypeTheme<DynamicAppTheme>
,WidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
- Direct Known Subclasses:
DynamicRemoteTheme
public class DynamicWidgetTheme
extends DynamicAppTheme
implements WidgetTheme<DynamicWidgetTheme,DynamicAppTheme>
An app widget theme to store various colors and attributes for app widget which can be
modified at runtime.
-
Nested Class Summary
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Parcelable.Creator<DynamicWidgetTheme>
Parcelable creator to create from parcel.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
ConstructorDescriptionConstructor to initialize an object of this class.DynamicWidgetTheme
(int widgetId) Constructor to initialize an object of this class.DynamicWidgetTheme
(int widgetId, AppTheme<?> theme) Constructor to initialize an object of this class.Read an object of this class from the parcel.DynamicWidgetTheme
(AppTheme<?> theme) Constructor to initialize an object of this class.DynamicWidgetTheme
(String theme) Constructor to initialize an object of this class from the theme string. -
Method Summary
Modifier and TypeMethodDescriptionint
getAccentColor
(boolean resolve, boolean inverse) int
getAccentColorDark
(boolean resolve, boolean inverse) int
getBackgroundColor
(boolean resolve, boolean inverse) int
getCornerRadius
(boolean resolve) int
getCornerSize
(boolean resolve) int
getErrorColor
(boolean resolve, boolean inverse) int
int
getPrimaryColor
(boolean resolve, boolean inverse) int
getPrimaryColorDark
(boolean resolve, boolean inverse) int
int
getSurfaceColor
(boolean resolve, boolean inverse) int
getTextPrimaryColor
(boolean resolve, boolean inverse) int
getTextPrimaryColorInverse
(boolean resolve, boolean inverse) int
getTextSecondaryColor
(boolean resolve, boolean inverse) int
getTextSecondaryColorInverse
(boolean resolve, boolean inverse) getThemeFallback
(boolean resolve) int
getTintAccentColor
(boolean resolve, boolean inverse) int
getTintAccentColorDark
(boolean resolve, boolean inverse) int
getTintBackgroundColor
(boolean resolve, boolean inverse) int
getTintErrorColor
(boolean resolve, boolean inverse) int
getTintPrimaryColor
(boolean resolve, boolean inverse) int
getTintPrimaryColorDark
(boolean resolve, boolean inverse) int
getTintSurfaceColor
(boolean resolve, boolean inverse) int
getType
(boolean resolve) int
setHeader
(int header) setHeaderString
(String header) setWidgetId
(int widgetId) toJsonString
(boolean resolve, boolean inverse) toString()
void
writeToParcel
(Parcel dest, int flags) Methods inherited from class com.pranavpandey.android.dynamic.support.model.DynamicAppTheme
autoGenerateColors, autoGenerateColors, describeContents, getAccentColor, getAccentColor, getAccentColorDark, getAccentColorDark, getAlpha, getBackgroundAware, getBackgroundAware, getBackgroundColor, getBackgroundColor, getContrast, getContrast, getContrastRatio, getCornerRadius, getCornerSize, getDynamicColors, getElevation, getElevation, getErrorColor, getErrorColor, getFontScale, getFontScale, getFontScaleRelative, getHighlightColor, getHighlightColor, getOpacity, getOpacity, getPrimaryColor, getPrimaryColor, getPrimaryColorDark, getPrimaryColorDark, getStyle, getSurfaceColor, getSurfaceColor, getTextPrimaryColor, getTextPrimaryColor, getTextPrimaryColorInverse, getTextPrimaryColorInverse, getTextSecondaryColor, getTextSecondaryColor, getTextSecondaryColorInverse, getTextSecondaryColorInverse, getThemeRes, getTintAccentColor, getTintAccentColor, getTintAccentColorDark, getTintAccentColorDark, getTintBackgroundColor, getTintBackgroundColor, getTintErrorColor, getTintErrorColor, getTintPrimaryColor, getTintPrimaryColor, getTintPrimaryColorDark, getTintPrimaryColorDark, getTintSurfaceColor, getTintSurfaceColor, getType, isBackgroundAware, isBackgroundSurface, isDarkTheme, isElevation, isFontScale, isHost, isInverseTheme, isShowDividers, isTranslucent, setAccentColor, setAccentColor, setAccentColorDark, setAccentColorDark, setBackgroundAware, setBackgroundColor, setBackgroundColor, setContrast, setCornerRadius, setCornerSize, setElevation, setErrorColor, setErrorColor, setFontScale, setHost, setOpacity, setPrimaryColor, setPrimaryColor, setPrimaryColorDark, setPrimaryColorDark, setStyle, setSurfaceColor, setSurfaceColor, setTextPrimaryColor, setTextPrimaryColor, setTextPrimaryColorInverse, setTextSecondaryColor, setTextSecondaryColor, setTextSecondaryColorInverse, setThemeRes, setTintAccentColor, setTintAccentColorDark, setTintBackgroundColor, setTintErrorColor, setTintPrimaryColor, setTintPrimaryColorDark, setTintSurfaceColor, setType
Methods inherited from class com.pranavpandey.android.dynamic.theme.AppTheme
getCodeBackgroundColor, getCodeContrastRatio, getCodeData, getCodeDataColor, getCodeFinderColor, getCodeOverlayColor, getCodeStrokeColor, getCodeStyle, getThemeData, isDynamicColor, isStroke, toJsonString
-
Field Details
-
CREATOR
Parcelable creator to create from parcel.
-
-
Constructor Details
-
DynamicWidgetTheme
public DynamicWidgetTheme()Constructor to initialize an object of this class. -
DynamicWidgetTheme
public DynamicWidgetTheme(int widgetId) Constructor to initialize an object of this class.- Parameters:
widgetId
- The widget id to be used.
-
DynamicWidgetTheme
Constructor to initialize an object of this class from the theme string.- Parameters:
theme
- The theme string to initialize the instance.- Throws:
JsonSyntaxException
-
DynamicWidgetTheme
Read an object of this class from the parcel.- Parameters:
in
- The parcel to read the values.
-
-
Method Details
-
writeToParcel
- Specified by:
writeToParcel
in interfaceParcelable
- Overrides:
writeToParcel
in classDynamicAppTheme
-
getThemeFallback
- Specified by:
getThemeFallback
in interfaceFallbackTheme<DynamicAppTheme>
- Overrides:
getThemeFallback
in classDynamicAppTheme
-
getBackgroundColor
- Specified by:
getBackgroundColor
in interfaceBackgroundTheme<DynamicAppTheme>
- Overrides:
getBackgroundColor
in classDynamicAppTheme
-
getTintBackgroundColor
- Specified by:
getTintBackgroundColor
in interfaceBackgroundTheme<DynamicAppTheme>
- Overrides:
getTintBackgroundColor
in classDynamicAppTheme
-
getSurfaceColor
- Specified by:
getSurfaceColor
in interfaceSurfaceTheme<DynamicAppTheme>
- Overrides:
getSurfaceColor
in classDynamicAppTheme
-
getTintSurfaceColor
- Specified by:
getTintSurfaceColor
in interfaceSurfaceTheme<DynamicAppTheme>
- Overrides:
getTintSurfaceColor
in classDynamicAppTheme
-
getPrimaryColor
- Specified by:
getPrimaryColor
in interfacePrimaryTheme<DynamicAppTheme>
- Overrides:
getPrimaryColor
in classDynamicAppTheme
-
getPrimaryColorDark
- Specified by:
getPrimaryColorDark
in interfacePrimaryTheme<DynamicAppTheme>
- Overrides:
getPrimaryColorDark
in classDynamicAppTheme
-
getTintPrimaryColor
- Specified by:
getTintPrimaryColor
in interfacePrimaryTheme<DynamicAppTheme>
- Overrides:
getTintPrimaryColor
in classDynamicAppTheme
-
getTintPrimaryColorDark
- Specified by:
getTintPrimaryColorDark
in interfacePrimaryTheme<DynamicAppTheme>
- Overrides:
getTintPrimaryColorDark
in classDynamicAppTheme
-
getAccentColor
- Specified by:
getAccentColor
in interfaceAccentTheme<DynamicAppTheme>
- Overrides:
getAccentColor
in classDynamicAppTheme
-
getAccentColorDark
- Specified by:
getAccentColorDark
in interfaceAccentTheme<DynamicAppTheme>
- Overrides:
getAccentColorDark
in classDynamicAppTheme
-
getTintAccentColor
- Specified by:
getTintAccentColor
in interfaceAccentTheme<DynamicAppTheme>
- Overrides:
getTintAccentColor
in classDynamicAppTheme
-
getTintAccentColorDark
- Specified by:
getTintAccentColorDark
in interfaceAccentTheme<DynamicAppTheme>
- Overrides:
getTintAccentColorDark
in classDynamicAppTheme
-
getErrorColor
- Specified by:
getErrorColor
in interfaceErrorTheme<DynamicAppTheme>
- Overrides:
getErrorColor
in classDynamicAppTheme
-
getTintErrorColor
- Specified by:
getTintErrorColor
in interfaceErrorTheme<DynamicAppTheme>
- Overrides:
getTintErrorColor
in classDynamicAppTheme
-
getTextPrimaryColor
- Specified by:
getTextPrimaryColor
in interfaceTextTheme<DynamicAppTheme>
- Overrides:
getTextPrimaryColor
in classDynamicAppTheme
-
getTextSecondaryColor
- Specified by:
getTextSecondaryColor
in interfaceTextTheme<DynamicAppTheme>
- Overrides:
getTextSecondaryColor
in classDynamicAppTheme
-
getTextPrimaryColorInverse
- Specified by:
getTextPrimaryColorInverse
in interfaceTextTheme<DynamicAppTheme>
- Overrides:
getTextPrimaryColorInverse
in classDynamicAppTheme
-
getTextSecondaryColorInverse
- Specified by:
getTextSecondaryColorInverse
in interfaceTextTheme<DynamicAppTheme>
- Overrides:
getTextSecondaryColorInverse
in classDynamicAppTheme
-
getCornerRadius
public int getCornerRadius(boolean resolve) - Specified by:
getCornerRadius
in interfaceCornerTheme<DynamicAppTheme>
- Overrides:
getCornerRadius
in classDynamicAppTheme
-
getCornerSize
public int getCornerSize(boolean resolve) - Specified by:
getCornerSize
in interfaceCornerTheme<DynamicAppTheme>
- Overrides:
getCornerSize
in classDynamicAppTheme
-
getStrokeColor
- Specified by:
getStrokeColor
in interfaceStrokeTheme<DynamicAppTheme>
- Overrides:
getStrokeColor
in classDynamicAppTheme
-
getType
public int getType(boolean resolve) - Specified by:
getType
in interfaceTypeTheme<DynamicAppTheme>
- Overrides:
getType
in classDynamicAppTheme
-
toJsonString
- Specified by:
toJsonString
in interfaceStringTheme<DynamicAppTheme>
- Overrides:
toJsonString
in classDynamicAppTheme
-
toDynamicString
- Specified by:
toDynamicString
in interfaceStringTheme<DynamicAppTheme>
- Overrides:
toDynamicString
in classDynamicAppTheme
-
getWidgetId
public int getWidgetId()- Specified by:
getWidgetId
in interfaceWidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
-
setWidgetId
- Specified by:
setWidgetId
in interfaceWidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
-
getHeader
public int getHeader()- Specified by:
getHeader
in interfaceWidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
-
getHeaderString
- Specified by:
getHeaderString
in interfaceWidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
-
setHeader
- Specified by:
setHeader
in interfaceWidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
-
setHeaderString
- Specified by:
setHeaderString
in interfaceWidgetTheme<DynamicWidgetTheme,
DynamicAppTheme>
-
toString
- Overrides:
toString
in classDynamicAppTheme
-