Class DynamicTheme
- All Implemented Interfaces:
DynamicListener,DynamicResolver,DynamicProductFlavor
It must be initialized before using any activity or widget as they are heavily dependent on this class to generate colors dynamically.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceConstant values for the theme styles version. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey for the theme preference.static final intDefault accent color used by this theme if no color is supplied.static final intDefault primary color used by this theme if no color is supplied.static final intDefault dark primary color used by this theme if no color is supplied.static final intDefault primary color used by this theme if no color is supplied.static final floatDefault shift amount to generate the darker color.static final intDefault text primary color used by this theme if no color is supplied.static final intDefault text secondary color used by this theme if no color is supplied.static final longNormal delay in milliseconds for updating the views.static final longTheme change delay in milliseconds which will be useful in some situations like changing the app theme, updating the widgets, etc.static final intDefault font scale for the theme. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDynamicListener(DynamicListener listener) Add a dynamic listener to receive the various callbacks.attach(DynamicListener localListener) Attach a local dynamic listener to this theme.attach(DynamicListener localListener, LayoutInflater.Factory2 layoutInflater) Attach a local dynamic listener to this theme.voidRemove all the dynamic listeners and themes.voidCopy the supplied theme data to the clipboard and show aSnackbar.voidcopyThemeString(Context context, String theme) Copy the supplied theme string to the clipboard and show aSnackbar.voiddeleteLocalTheme(DynamicListener listener) Delete the supplied listener theme from the shared preferences.Generates default theme according to the current settings.intgenerateErrorColor(int primary, int secondary) Generates error color according to the supplied colors.intgenerateStrokeColor(int color) Generates stroke color according to the supplied color.intgenerateSurfaceColor(int color) Generates surface color according to the supplied color.intgenerateSystemColor(int color) Generates dark variant of the supplied color.intgenerateSystemSecondaryColor(int color) Generates tint of the supplied color.get()Get the theme according to the current state.get(boolean resolve) Get the theme according to the supplied parameter.Get the theme used by the application.Get the dynamic colors used by this resolver.getColors(boolean resolve) Get the dynamic colors used by this resolver.Returns the context used by this listener.Get the default theme according to the current state.getDefault(boolean resolve) Get the default theme according to the supplied parameter.Get the default theme used by the application.intgetDefaultBackgroundColor(boolean night) Generates default background color according to the application theme.intgetDefaultColor(int colorType) This method will be called to resolve the default color according to it's type.intReturns the default contrast with color to tint the background aware views accordingly.Get the default theme used by the local context.Returns the resolver used by the dynamic theme.AppTheme<?>This method will be called to return the dynamic app theme for this listener.Returns the saved dynamic themes currently in use or to be resumed later.Get the main thread handler.static DynamicThemeRetrieves the singleton instance ofDynamicTheme.Get the application listener used by this theme.getLocal()Get the theme used by the local context.Get the local listener used by this theme.Get the local listener used by this theme.getLocalTheme(DynamicListener listener) Returns the supplied listener theme from the shared preferences.intGet the local theme styles version.Returns end time for the night theme.Returns start time for the night theme.Get the power manager used by the application.Class<?>Get the preview activity used by this manager.Get the theme used by the remote elements.getRemoteTheme(String theme) Returns the dynamic remote theme from the JSON string.intThis method will be called to get the intended theme styles version for this listener.intgetSystemContrast(int fallback) Try to get the contrast from the system.intgetSystemThemeRes(DynamicListener listener, AppTheme<?> theme) Returns the style resource used by the system.getTheme()Get the dynamic theme instance used by this resolver.Returns the dynamic app theme from the JSON string.intThis method will be called to return the theme style resource for this listener.intgetThemeRes(AppTheme<?> theme) This method will be called to return the theme style resource for this listener.Get the UI mode manager used by the application.intGet the application theme styles version.intgetWidgetCornerRadius(int fallback) Try to get the corner radius for the widget background from the system.getWidgetTheme(String theme) Returns the dynamic widget theme from the JSON string.voidinitialize(DynamicListener listener, DynamicResolver dynamicResolver) Initialize this class with default values.static voidinitializeInstance(DynamicListener listener, DynamicResolver dynamicResolver) Initialize theme when application starts.Initialize remote colors according to the base colors.voidinvalidTheme(Context context) Show a invalid themeSnackbar.booleanReturns whether to apply the dynamic colors for this listener.booleanReturns whether the dynamic colors are enabled for this listener.booleanisDynamicListener(DynamicListener listener) Checks whether a dynamic listener is already registered.booleanisNight()Checks for the night time.booleanisNight(int theme) Checks for the night time according to the supplied value.booleanChecks for the night time according to the supplied value.booleanisNightMode(boolean resolve) Checks whether the night mode is enabled for this listener.booleanReturns whether to register a shared preferences listener for this listener.booleanReturns whether the power save mode is enabled.booleanReturns whether the dynamic colors should be extracted from the system for this listener.booleanChecks whether the system night mode is enabled.booleanReturns whether the dynamic colors should be extracted from the wallpaper for this listener.voidonAutoThemeChanged(boolean context) This method will be called when the auto theme change event occurs according to the time.voidSet the initialized instance tonullwhen app terminates for better theme results when theme is changed.voidonDynamicChanged(boolean context, boolean recreate) This method will be called when the dynamic change event occurs (like theme, locale, etc.).voidonDynamicColorsChanged(DynamicColors colors, boolean context) This method will be called when the dynamic color change event occurs according to the wallpaper.voidonDynamicConfigurationChanged(boolean locale, boolean fontScale, boolean orientation, boolean uiMode, boolean density) This method will be called when the dynamic configuration change event occurs (like locale, font scale, orientation, ui mode, etc.).voidonLocalDestroy(DynamicListener listener) Set the initialized instance tonullwhen local destroys for better theme results when theme is changed.voidThis method will be called when the navigation bar theme has been changed.voidonPowerSaveModeChanged(boolean powerSaveMode) This method will be called when the power save mode has been changed.voidRecreate local activity to update all the views with new theme.voidremoveDynamicListener(DynamicListener listener) Remove a dynamic listener.intresolveAppTheme(int theme, int night, boolean data) Resolves current theme according to the supplied implementation.intresolveAppTheme(String theme, String night, boolean data) Resolves current theme according to the supplied implementation.intresolveBackgroundAware(int backgroundAware) Resolve background aware according to the constant value.intresolveColorType(int colorType) Resolve color according to the color type.booleanresolveNightTheme(int theme, int implementation, boolean data) Resolves night theme according to the selected implementation.booleanresolveNightTheme(String theme, String implementation, boolean data) Resolves night theme according to the selected implementation.intresolveSystemColor(boolean isNight) Resolves system color according to the API level and night mode.intResolves the theme version according to the attached local.voidSave the local context theme in shared preferences.voidShow a theme savedSnackbar.voidsetDynamicResolver(DynamicResolver resolver) Sets the resolver used by the dynamic theme.voidsetDynamicThemeWork(boolean enqueue) Sets the dynamic theme work to schedule auto theme event according to the time.setListener(DynamicListener listener) Set the application listener for this theme.setLocalTheme(int themeRes, AppTheme<?> theme) Initialize colors from the supplied local dynamic app theme.setLocalThemeRes(int themeRes, AppTheme<?> theme) Initialize colors from the supplied local theme resource.voidsetLocalVersion(int version) Set the local theme styles version.booleanReturns whether the navigation bar theme should be applied for the activity.voidsetPreviewActivity(Class<?> previewActivity) Sets the preview activity for this instance.setRemoteTheme(AppTheme<?> theme) Initialize colors from the supplied remote dynamic app theme.Initialize colors from the supplied dynamic app theme.setThemeRes(int themeRes, AppTheme<?> theme, boolean initializeRemoteColors) Initialize colors from the supplied theme resource.voidsetVersion(int version) Set the application theme styles version.voidsetWallpaperColors(boolean enable, boolean context) Sets theWallpaperManager.OnColorsChangedListenerto enable dynamic colors from the wallpaper on API 27 and above.toString()
-
Field Details
-
ADS_PREF_THEME_KEY
Key for the theme preference.- See Also:
-
DELAY_NORMAL
public static final long DELAY_NORMALNormal delay in milliseconds for updating the views.- See Also:
-
DELAY_THEME_CHANGE
public static final long DELAY_THEME_CHANGETheme change delay in milliseconds which will be useful in some situations like changing the app theme, updating the widgets, etc.- See Also:
-
COLOR_SHIFT_DARK_DEFAULT
public static final float COLOR_SHIFT_DARK_DEFAULTDefault shift amount to generate the darker color.- See Also:
-
COLOR_BACKGROUND_DEFAULT
Default primary color used by this theme if no color is supplied. -
COLOR_PRIMARY_DEFAULT
Default primary color used by this theme if no color is supplied. -
COLOR_PRIMARY_DARK_DEFAULT
Default dark primary color used by this theme if no color is supplied. -
COLOR_ACCENT_DEFAULT
Default accent color used by this theme if no color is supplied. -
COLOR_TEXT_PRIMARY_DEFAULT
Default text primary color used by this theme if no color is supplied.- See Also:
-
COLOR_TEXT_SECONDARY_DEFAULT
Default text secondary color used by this theme if no color is supplied.- See Also:
-
FONT_SCALE_DEFAULT
public static final int FONT_SCALE_DEFAULTDefault font scale for the theme.- See Also:
-
-
Method Details
-
setDynamicThemeWork
public void setDynamicThemeWork(boolean enqueue) Sets the dynamic theme work to schedule auto theme event according to the time.- Parameters:
enqueue-trueto enqueue the dynamic theme work.
-
setWallpaperColors
public void setWallpaperColors(boolean enable, boolean context) Sets theWallpaperManager.OnColorsChangedListenerto enable dynamic colors from the wallpaper on API 27 and above. Otherwise, use the custom implementation for older API levels.- Parameters:
enable-trueto enable wallpaper colors listener.context-trueif there is a context change and it must be reinitialized.- See Also:
-
getInstance
Retrieves the singleton instance ofDynamicTheme.Must be called before accessing the public methods.
- Returns:
- The singleton instance of
DynamicTheme.
-
getHandler
Get the main thread handler.- Returns:
- The main thread handler.
-
initializeRemoteColors
Initialize remote colors according to the base colors.They can be set individually by calling the appropriate methods.
- Returns:
- The
DynamicThemeobject to allow for chaining of calls to set methods.
-
resolveBackgroundAware
public int resolveBackgroundAware(int backgroundAware) Resolve background aware according to the constant value.- Parameters:
backgroundAware- The background aware to be resolved.- Returns:
- The resolved background aware value.
Either
Theme.BackgroundAware.ENABLEorTheme.BackgroundAware.DISABLE. - See Also:
-
resolveColorType
Resolve color according to the color type.- Parameters:
colorType- The color type to be resolved.- Returns:
- The resolved color value.
- See Also:
-
getVersion
public int getVersion()Get the application theme styles version.- Returns:
- The application theme styles version.
-
setVersion
public void setVersion(int version) Set the application theme styles version.- Parameters:
version- The version to be set.
-
getLocalVersion
public int getLocalVersion()Get the local theme styles version.- Returns:
- The local theme styles version.
-
setLocalVersion
public void setLocalVersion(int version) Set the local theme styles version.- Parameters:
version- The version to be set.
-
resolveVersion
public int resolveVersion()Resolves the theme version according to the attached local.- Returns:
- The theme version according to the attached local.
- See Also:
-
getListener
Get the application listener used by this theme.- Returns:
- The application context used by this theme.
-
getLocalListener
Get the local listener used by this theme.- Returns:
- The local listener used by this theme.
-
getLocalContext
Get the local listener used by this theme.- Returns:
- The local listener used by this theme.
-
getUiModeManager
Get the UI mode manager used by the application.- Returns:
- The UI mode manager used by the application.
-
getPowerManager
Get the power manager used by the application.- Returns:
- The power manager used by the application.
-
isPowerSaveMode
public boolean isPowerSaveMode()Returns whether the power save mode is enabled.- Returns:
trueif the power save mode is enabled.
-
getDefaultApplication
Get the default theme used by the application.- Returns:
- The default theme used by the application.
-
getApplication
Get the theme used by the application.- Returns:
- The theme used by the application.
-
getDefaultLocal
Get the default theme used by the local context.- Returns:
- The default theme used by the local context.
-
getLocal
Get the theme used by the local context.- Returns:
- The theme used by the local context.
-
getRemote
Get the theme used by the remote elements.- Returns:
- The theme used by the remote elements.
-
getDynamicThemes
Returns the saved dynamic themes currently in use or to be resumed later.- Returns:
- The saved dynamic themes currently in use or to be resumed later.
-
getPreviewActivity
Get the preview activity used by this manager.- Returns:
- The preview activity used by this manager.
-
setPreviewActivity
Sets the preview activity for this instance.- Parameters:
previewActivity- The preview activity class to be set.
-
get
Get the theme according to the supplied parameter.Either application theme or local theme.
- Parameters:
resolve-trueto resolve the local theme if present.- Returns:
- The theme according to the supplied parameter.
-
get
Get the theme according to the current state.Either application theme or local theme.
- Returns:
- The theme according to the current state.
-
getDefault
Get the default theme according to the supplied parameter.Either default application theme or default local theme.
- Parameters:
resolve-trueto resolve the default local theme if present.- Returns:
- The default theme according to the supplied parameter.
-
getDefault
Get the default theme according to the current state.Either default application theme or default local theme.
- Returns:
- The default theme according to the current state.
- See Also:
-
recreateLocal
public void recreateLocal()Recreate local activity to update all the views with new theme. -
onDestroy
public void onDestroy()Set the initialized instance tonullwhen app terminates for better theme results when theme is changed. -
getDefaultBackgroundColor
Generates default background color according to the application theme.- Parameters:
night-trueif the night mode is enabled.- Returns:
- The generated background color.
-
getSystemContrast
public int getSystemContrast(int fallback) Try to get the contrast from the system.- Parameters:
fallback- The fallback contrast to be used in case of any issues.- Returns:
- The contrast from the system.
-
getWidgetCornerRadius
Try to get the corner radius for the widget background from the system.- Parameters:
fallback- The fallback radius to be used in case of any issues.- Returns:
- The corner radius for the widget background from the system.
-
getDefaultContrastWith
Returns the default contrast with color to tint the background aware views accordingly.- Returns:
- The default contrast with color.
-
generateDefaultTheme
Generates default theme according to the current settings.- Returns:
- The generated default theme.
-
generateStrokeColor
Generates stroke color according to the supplied color.- Parameters:
color- The color to generate the stroke color.- Returns:
- The generated stroke color.
-
generateSurfaceColor
Generates surface color according to the supplied color.- Parameters:
color- The color to generate the surface color.- Returns:
- The generated surface color.
-
generateErrorColor
Generates error color according to the supplied colors.- Parameters:
primary- The primary color to generate the error color.secondary- The secondary color to generate the error color.- Returns:
- The generated error color.
-
generateSystemColor
Generates dark variant of the supplied color.- Parameters:
color- The color to generate the dark variant.- Returns:
- The generated dark variant of the color.
-
generateSystemSecondaryColor
Generates tint of the supplied color.- Parameters:
color- The color to generate the tint.- Returns:
- The generated tint of the color.
-
getDynamicResolver
Returns the resolver used by the dynamic theme.- Returns:
- The resolver used by the dynamic theme.
-
clearDynamicListeners
public void clearDynamicListeners()Remove all the dynamic listeners and themes. -
getProductFlavor
- Specified by:
getProductFlavorin interfaceDynamicProductFlavor
-
getContext
Description copied from interface:DynamicListenerReturns the context used by this listener.- Specified by:
getContextin interfaceDynamicListener- Returns:
- The context used by this listener.
-
getRequiredThemeVersion
public int getRequiredThemeVersion()Description copied from interface:DynamicListenerThis method will be called to get the intended theme styles version for this listener.- Specified by:
getRequiredThemeVersionin interfaceDynamicListener- Returns:
- The intended theme styles version for this listener.
-
isNightMode
public boolean isNightMode(boolean resolve) Description copied from interface:DynamicListenerChecks whether the night mode is enabled for this listener.- Specified by:
isNightModein interfaceDynamicListener- Parameters:
resolve-trueto resolve based on the theme data.- Returns:
trueif the night mode is enabled for this listener.
-
getThemeRes
Description copied from interface:DynamicListenerThis method will be called to return the theme style resource for this listener.Override this method to supply your own customised style.
- Specified by:
getThemeResin interfaceDynamicListener- Returns:
- The theme style resource for this listener.
- See Also:
-
getDynamicTheme
Description copied from interface:DynamicListenerThis method will be called to return the dynamic app theme for this listener.Override this method to supply your own customised theme.
- Specified by:
getDynamicThemein interfaceDynamicListener- Returns:
- The dynamic app theme for this listener.
-
isDynamicColors
public boolean isDynamicColors()Description copied from interface:DynamicListenerReturns whether the dynamic colors are enabled for this listener.- Specified by:
isDynamicColorsin interfaceDynamicListener- Returns:
trueif the dynamic colors are enabled for this listener.
-
isDynamicColor
public boolean isDynamicColor()Description copied from interface:DynamicListenerReturns whether to apply the dynamic colors for this listener.- Specified by:
isDynamicColorin interfaceDynamicListener- Returns:
trueif the dynamic colors should be applied for this listener.
-
isSystemColor
public boolean isSystemColor()Description copied from interface:DynamicListenerReturns whether the dynamic colors should be extracted from the system for this listener.- Specified by:
isSystemColorin interfaceDynamicListener- Returns:
trueif the dynamic colors should be extracted from the system for this listener
-
isWallpaperColor
public boolean isWallpaperColor()Description copied from interface:DynamicListenerReturns whether the dynamic colors should be extracted from the wallpaper for this listener.- Specified by:
isWallpaperColorin interfaceDynamicListener- Returns:
trueif the dynamic colors should be extracted from the wallpaper for this listener
-
getDefaultColor
Description copied from interface:DynamicListenerThis method will be called to resolve the default color according to it's type.It is useful in resolving the color if the default theme also has auto values.
- Specified by:
getDefaultColorin interfaceDynamicListener- Parameters:
colorType- The color type to be resolved.- Returns:
- The resolved default color according to the color type.
- See Also:
-
onDynamicChanged
public void onDynamicChanged(boolean context, boolean recreate) Description copied from interface:DynamicListenerThis method will be called when the dynamic change event occurs (like theme, locale, etc.).Recreate the activity or application here to adapt changes.
- Specified by:
onDynamicChangedin interfaceDynamicListener- Parameters:
context-trueif there is a context change and it must be reinitialized.recreate-trueif listener must be recreated to adapt the changes.
-
onDynamicConfigurationChanged
public void onDynamicConfigurationChanged(boolean locale, boolean fontScale, boolean orientation, boolean uiMode, boolean density) Description copied from interface:DynamicListenerThis method will be called when the dynamic configuration change event occurs (like locale, font scale, orientation, ui mode, etc.).It will provide more control on
DynamicListener.onDynamicChanged(boolean, boolean)method call.- Specified by:
onDynamicConfigurationChangedin interfaceDynamicListener- Parameters:
locale-trueif locale is changed.fontScale-trueif font scale is changed.orientation-trueif there is an orientation change.uiMode-trueif ui mode is changed.density-trueif configuration density is changed.- See Also:
-
onAutoThemeChanged
public void onAutoThemeChanged(boolean context) Description copied from interface:DynamicListenerThis method will be called when the auto theme change event occurs according to the time.Recreate the activity or application here to adapt changes.
- Specified by:
onAutoThemeChangedin interfaceDynamicListener- Parameters:
context-trueif there is a context change and it must be reinitialized.
-
onPowerSaveModeChanged
public void onPowerSaveModeChanged(boolean powerSaveMode) Description copied from interface:DynamicListenerThis method will be called when the power save mode has been changed.It will be called only on API 21 and above.
- Specified by:
onPowerSaveModeChangedin interfaceDynamicListener- Parameters:
powerSaveMode-trueif the device is in power save mode.
-
toString
-
saveLocalTheme
public void saveLocalTheme()Save the local context theme in shared preferences. -
getTheme
Returns the dynamic app theme from the JSON string.- Parameters:
theme- The dynamic app theme JSON string to be converted.- Returns:
- The dynamic app theme from the JSON string.
-
getWidgetTheme
Returns the dynamic widget theme from the JSON string.- Parameters:
theme- The dynamic widget theme JSON string to be converted.- Returns:
- The dynamic widget theme from the JSON string.
-
getRemoteTheme
Returns the dynamic remote theme from the JSON string.- Parameters:
theme- The dynamic remote theme JSON string to be converted.- Returns:
- The dynamic remote theme from the JSON string.
-
getTheme
Description copied from interface:DynamicResolverGet the dynamic theme instance used by this resolver.- Specified by:
getThemein interfaceDynamicResolver- Returns:
- The dynamic theme instance used by this resolver.
-
getColors
Description copied from interface:DynamicResolverGet the dynamic colors used by this resolver.- Specified by:
getColorsin interfaceDynamicResolver- Parameters:
resolve-trueto resolve the dynamic colors.- Returns:
- The dynamic colors used by this resolver.
-
getColors
Description copied from interface:DynamicResolverGet the dynamic colors used by this resolver.- Specified by:
getColorsin interfaceDynamicResolver- Returns:
- The dynamic colors used by this resolver.
-
isSystemNightMode
public boolean isSystemNightMode()Description copied from interface:DynamicResolverChecks whether the system night mode is enabled.- Specified by:
isSystemNightModein interfaceDynamicResolver- Returns:
trueif the system night mode is enabled.
-
resolveSystemColor
public int resolveSystemColor(boolean isNight) Description copied from interface:DynamicResolverResolves system color according to the API level and night mode.- Specified by:
resolveSystemColorin interfaceDynamicResolver- Parameters:
isNight-trueto resolve the night color.- Returns:
- The system UI color according to the Android version and night mode.
-
isNight
public boolean isNight()Description copied from interface:DynamicResolverChecks for the night time.Useful to apply themes based on the day and night.
- Specified by:
isNightin interfaceDynamicResolver- Returns:
trueif it is night.
-
isNight
public boolean isNight(int theme) Description copied from interface:DynamicResolverChecks for the night time according to the supplied value.Useful to apply themes based on the day and night.
- Specified by:
isNightin interfaceDynamicResolver- Parameters:
theme- The integer value of the theme.- Returns:
trueif it is night.
-
isNight
Description copied from interface:DynamicResolverChecks for the night time according to the supplied value.Useful to apply themes based on the day and night.
- Specified by:
isNightin interfaceDynamicResolver- Parameters:
theme- The string value of the theme.- Returns:
trueif it is night.
-
getNightTimeStart
Description copied from interface:DynamicResolverReturns start time for the night theme.- Specified by:
getNightTimeStartin interfaceDynamicResolver- Returns:
- The start time for the night theme.
-
getNightTimeEnd
Description copied from interface:DynamicResolverReturns end time for the night theme.- Specified by:
getNightTimeEndin interfaceDynamicResolver- Returns:
- The end time for the night theme.
-
resolveNightTheme
public boolean resolveNightTheme(int theme, int implementation, boolean data) Description copied from interface:DynamicResolverResolves night theme according to the selected implementation.- Specified by:
resolveNightThemein interfaceDynamicResolver- Parameters:
theme- The app theme to resolve the auto night theme.implementation- The implementation for the night theme.data-trueto resolve based on the theme data.- Returns:
trueif the night theme is enabled according to the selected implementation.
-
resolveNightTheme
Description copied from interface:DynamicResolverResolves night theme according to the selected implementation.- Specified by:
resolveNightThemein interfaceDynamicResolver- Parameters:
theme- The app theme to resolve the auto night theme.implementation- The implementation for the night theme.data-trueto resolve based on the theme data.- Returns:
trueif the night theme is enabled according to the selected implementation.
-
resolveAppTheme
public int resolveAppTheme(int theme, int night, boolean data) Description copied from interface:DynamicResolverResolves current theme according to the supplied implementation.- Specified by:
resolveAppThemein interfaceDynamicResolver- Parameters:
theme- The theme to be resolved.night- The implementation for the night theme.data-trueto resolve based on the theme data.- Returns:
- The resolved theme constant according to the supplied implementation.
- See Also:
-
resolveAppTheme
Description copied from interface:DynamicResolverResolves current theme according to the supplied implementation.- Specified by:
resolveAppThemein interfaceDynamicResolver- Parameters:
theme- The theme to be resolved.night- The implementation for the night theme.data-trueto resolve based on the theme data.- Returns:
- The resolved theme constant according to the supplied implementation.
- See Also:
-
copyThemeString
Copy the supplied theme string to the clipboard and show aSnackbar.- Parameters:
context- The context to get theClipboardManager.theme- The theme string to be copied.
-
copyTheme
Copy the supplied theme data to the clipboard and show aSnackbar.- Parameters:
context- The context to get theClipboardManager.theme- The theme data to be copied.
-
saveTheme
Show a theme savedSnackbar.- Parameters:
context- The context to get theSnackbar.
-
invalidTheme
Show a invalid themeSnackbar.- Parameters:
context- The context to get theSnackbar.