Stay organized with collections
Save and categorize content based on your preferences.
DynamicColors.Precondition
public
static
interface
DynamicColors.Precondition
com.google.android.material.color.DynamicColors.Precondition
|
The interface that provides a precondition to decide if dynamic colors should be applied.
Summary
Public methods |
abstract
boolean
|
shouldApplyDynamicColors(Activity activity, int theme)
Return true if dynamic colors should be applied on the given activity with the given
theme overlay.
|
Public methods
shouldApplyDynamicColors
public abstract boolean shouldApplyDynamicColors (Activity activity,
int theme)
Return true
if dynamic colors should be applied on the given activity with the given
theme overlay.
Parameters |
activity |
Activity |
theme |
int |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DynamicColors.Precondition\n==========================\n\n\n`\npublic\nstatic\n\n\ninterface\nDynamicColors.Precondition\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------------------|\n| com.google.android.material.color.DynamicColors.Precondition |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe interface that provides a precondition to decide if dynamic colors should be applied.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[shouldApplyDynamicColors](/reference/com/google/android/material/color/DynamicColors.Precondition#shouldApplyDynamicColors(android.app.Activity,%20int))`(Activity activity, int theme) ` Return `true` if dynamic colors should be applied on the given activity with the given theme overlay. |\n\nPublic methods\n--------------\n\n### shouldApplyDynamicColors\n\n```\npublic abstract boolean shouldApplyDynamicColors (Activity activity, \n int theme)\n```\n\nReturn `true` if dynamic colors should be applied on the given activity with the given\ntheme overlay.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-------------------|\n| `activity` | `Activity` \u003cbr /\u003e |\n| `theme` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |"]]