DynamicColors

open class DynamicColors

Utility for applying dynamic colors to application/activities.

Types

Link copied to clipboard
The interface that provides a callback method after dynamic colors have been applied.
Link copied to clipboard
interface Precondition
The interface that provides a precondition to decide if dynamic colors should be applied.

Functions

Link copied to clipboard
open fun applyIfAvailable(@NonNull activity: Activity)
Applies dynamic colors to the given activity with the theme overlay designated by the theme attribute dynamicColorThemeOverlay.
open fun applyIfAvailable(@NonNull activity: Activity, @NonNull precondition: DynamicColors.Precondition)
Applies dynamic colors to the given activity with the theme overlay designated by the theme attribute dynamicColorThemeOverlay according to the given precondition.
open fun applyIfAvailable(@NonNull activity: Activity, @StyleRes theme: Int)
Applies dynamic colors to the given activity with the given theme overlay.
Link copied to clipboard
Applies dynamic colors to all activities with the theme overlay designated by the theme attribute dynamicColorThemeOverlay by registering a ActivityLifecycleCallbacks to your application.
Applies dynamic colors to all activities with the theme overlay designated by the theme attribute dynamicColorThemeOverlay according to the given precondition by registering a ActivityLifecycleCallbacks to your application.
open fun applyToActivitiesIfAvailable(@NonNull application: Application, @NonNull dynamicColorsOptions: DynamicColorsOptions)
Applies dynamic colors to all activities based on the provided DynamicColorsOptions, by registering a ActivityLifecycleCallbacks to your application.
open fun applyToActivitiesIfAvailable(@NonNull application: Application, @StyleRes theme: Int)
Applies dynamic colors to all activities with the given theme overlay by registering a to your application.
Applies dynamic colors to all activities with the given theme overlay according to the given precondition by registering a ActivityLifecycleCallbacks to your application.
Link copied to clipboard
Applies dynamic colors to the given activity.
open fun applyToActivityIfAvailable(@NonNull activity: Activity, @NonNull dynamicColorsOptions: DynamicColorsOptions)
Applies dynamic colors to the given activity with DynamicColorsOptions provided.
Link copied to clipboard
Returns true if dynamic colors are available on the current SDK level.
Link copied to clipboard
open fun wrapContextIfAvailable(@NonNull originalContext: Context): Context
Wraps the given context with the theme overlay designated by the theme attribute dynamicColorThemeOverlay.
open fun wrapContextIfAvailable(@NonNull originalContext: Context, @NonNull dynamicColorsOptions: DynamicColorsOptions): Context
Wraps the given context with the given theme overlay provided in DynamicColorsOptions.
open fun wrapContextIfAvailable(@NonNull originalContext: Context, @StyleRes theme: Int): Context
Wraps the given context with the given theme overlay.