apply To Activities If Available
Applies dynamic colors to all activities with the theme overlay designated by the theme attribute dynamicColorThemeOverlay
by registering a ActivityLifecycleCallbacks to your application.
Parameters
The target application.
See also
for more detailed info and examples.
Applies dynamic colors to all activities based on the provided DynamicColorsOptions, by registering a ActivityLifecycleCallbacks to your application.
A normal usage of this method should happen only once in onCreate or any methods that run before any of your activities are created. For example:
public class YourApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
DynamicColors.applyToActivitiesWithCallbacks(this);
}
}
Parameters
The target application.
The dynamic colors options object that specifies the theme resource ID, precondition to decide if dynamic colors should be applied and the callback function for after dynamic colors have been applied.
Deprecated
Use applyToActivitiesIfAvailable instead.
Applies dynamic colors to all activities with the given theme overlay by registering a to your application.
Parameters
The target application.
The resource ID of the theme overlay that provides dynamic color definition.
Deprecated
Use applyToActivitiesIfAvailable instead.
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.
Parameters
The target application.
The precondition to decide if dynamic colors should be applied.
Deprecated
Use applyToActivitiesIfAvailable instead.
Applies dynamic colors to all activities with the given theme overlay according to the given precondition by registering a ActivityLifecycleCallbacks to your application.
Parameters
The target application.
The resource ID of the theme overlay that provides dynamic color definition.
The precondition to decide if dynamic colors should be applied.