Class DynamicThemeResolver
java.lang.Object
com.pranavpandey.android.dynamic.support.theme.DynamicThemeResolver
- All Implemented Interfaces:
DynamicResolver
A
DynamicResolver to resolve the theme.-
Constructor Summary
ConstructorsConstructorDescriptionDynamicThemeResolver(DynamicTheme theme) Constructor to initialize an object of this class.DynamicThemeResolver(DynamicTheme theme, DynamicColors colors, DynamicColors colorsLocal) Constructor to initialize an object of this class. -
Method Summary
Modifier and TypeMethodDescriptionGet the dynamic colors used by this resolver.getColors(boolean resolve) Get the dynamic colors used by this resolver.Returns end time for the night theme.Returns start time for the night theme.getTheme()Get the dynamic theme instance used by this resolver.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.booleanChecks whether the system night mode is enabled.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.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.
-
Constructor Details
-
Method Details
-
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:
-