DynamicColorsOptions
public
class
DynamicColorsOptions
extends Object
java.lang.Object
|
↳ |
com.google.android.material.color.DynamicColorsOptions
|
Wrapper class for specifying dynamic colors options when applying dynamic colors. Clients have
the options to provide a custom theme overlay, set the precondition that decides if dynamic
colors should be applied, set the callback method and/or set the color source image to apply
content-based dynamic colors.
Summary
Nested classes |
class |
DynamicColorsOptions.Builder
Builder class for specifying options when applying dynamic colors.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public methods
getContentBasedSeedColor
public Integer getContentBasedSeedColor ()
Returns the seed color extracted from the color source image.
getPrecondition
public DynamicColors.Precondition getPrecondition ()
Returns the precondition that decides if dynamic colors should be applied.
getThemeOverlay
public int getThemeOverlay ()
Returns the resource ID of the theme overlay that provides dynamic color definition.
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,["# DynamicColorsOptions\n\nSummary: [Nested Classes](#nestedclasses) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nDynamicColorsOptions\n====================\n\n\n`\npublic\n\n\nclass\nDynamicColorsOptions\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|--------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.google.android.material.color.DynamicColorsOptions |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nWrapper class for specifying dynamic colors options when applying dynamic colors. Clients have\nthe options to provide a custom theme overlay, set the precondition that decides if dynamic\ncolors should be applied, set the callback method and/or set the color source image to apply\ncontent-based dynamic colors.\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [DynamicColorsOptions.Builder](/reference/com/google/android/material/color/DynamicColorsOptions.Builder) Builder class for specifying options when applying dynamic colors. |\n\n| ### Public methods ||\n|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` Integer` | ` `[getContentBasedSeedColor](/reference/com/google/android/material/color/DynamicColorsOptions#getContentBasedSeedColor())`() ` Returns the seed color extracted from the color source image. |\n| ` `[DynamicColors.OnAppliedCallback](/reference/com/google/android/material/color/DynamicColors.OnAppliedCallback) | ` `[getOnAppliedCallback](/reference/com/google/android/material/color/DynamicColorsOptions#getOnAppliedCallback())`() ` Returns the callback method after dynamic colors have been applied. |\n| ` `[DynamicColors.Precondition](/reference/com/google/android/material/color/DynamicColors.Precondition) | ` `[getPrecondition](/reference/com/google/android/material/color/DynamicColorsOptions#getPrecondition())`() ` Returns the precondition that decides if dynamic colors should be applied. |\n| ` int` | ` `[getThemeOverlay](/reference/com/google/android/material/color/DynamicColorsOptions#getThemeOverlay())`() ` Returns the resource ID of the theme overlay that provides dynamic color definition. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic methods\n--------------\n\n### getContentBasedSeedColor\n\n```\npublic Integer getContentBasedSeedColor ()\n```\n\nReturns the seed color extracted from the color source image.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|--------|\n| `Integer` | \u003cbr /\u003e |\n\n### getOnAppliedCallback\n\n```\npublic DynamicColors.OnAppliedCallback getOnAppliedCallback ()\n```\n\nReturns the callback method after dynamic colors have been applied.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------------------------------------------------------------------|--------|\n| [DynamicColors.OnAppliedCallback](/reference/com/google/android/material/color/DynamicColors.OnAppliedCallback) | \u003cbr /\u003e |\n\n### getPrecondition\n\n```\npublic DynamicColors.Precondition getPrecondition ()\n```\n\nReturns the precondition that decides if dynamic colors should be applied.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------------------------------------|--------|\n| [DynamicColors.Precondition](/reference/com/google/android/material/color/DynamicColors.Precondition) | \u003cbr /\u003e |\n\n### getThemeOverlay\n\n```\npublic int getThemeOverlay ()\n```\n\nReturns the resource ID of the theme overlay that provides dynamic color definition.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]