ColorContrastOptions
public
class
ColorContrastOptions
extends Object
java.lang.Object
|
↳ |
com.google.android.material.color.ColorContrastOptions
|
Wrapper class for specifying color contrast options when applying contrast to branded and custom
themes. Clients have the options to provide theme overlay resource ids for medium and high
contrast mode.
An example of the provided theme overlay resource ids could be one of the following:
- contrast in light mode: R.style.ThemeOverlay_XxxContrast_Light
- contrast in dark mode: R.style.ThemeOverlay_XxxContrast_Dark
- contrast in both light and dark mode: R.style.ThemeOverlay_XxxContrast_DayNight
Summary
Nested classes |
class |
ColorContrastOptions.Builder
Builder class for specifying options when applying contrast.
|
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
getHighContrastThemeOverlay
public int getHighContrastThemeOverlay ()
Returns the resource id of the high contrast theme overlay.
getMediumContrastThemeOverlay
public int getMediumContrastThemeOverlay ()
Returns the resource id of the medium contrast theme overlay.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ColorContrastOptions\n\nSummary: [Nested Classes](#nestedclasses) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nColorContrastOptions\n====================\n\n\n`\npublic\n\n\nclass\nColorContrastOptions\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.ColorContrastOptions |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nWrapper class for specifying color contrast options when applying contrast to branded and custom\nthemes. Clients have the options to provide theme overlay resource ids for medium and high\ncontrast mode.\n\nAn example of the provided theme overlay resource ids could be one of the following:\n\n- contrast in light mode: R.style.ThemeOverlay_XxxContrast_Light\n- contrast in dark mode: R.style.ThemeOverlay_XxxContrast_Dark\n- contrast in both light and dark mode: R.style.ThemeOverlay_XxxContrast_DayNight\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [ColorContrastOptions.Builder](/reference/com/google/android/material/color/ColorContrastOptions.Builder) Builder class for specifying options when applying contrast. |\n\n| ### Public methods ||\n|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` int` | ` `[getHighContrastThemeOverlay](/reference/com/google/android/material/color/ColorContrastOptions#getHighContrastThemeOverlay())`() ` Returns the resource id of the high contrast theme overlay. |\n| ` int` | ` `[getMediumContrastThemeOverlay](/reference/com/google/android/material/color/ColorContrastOptions#getMediumContrastThemeOverlay())`() ` Returns the resource id of the medium contrast theme overlay. |\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### getHighContrastThemeOverlay\n\n```\npublic int getHighContrastThemeOverlay ()\n```\n\nReturns the resource id of the high contrast theme overlay.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getMediumContrastThemeOverlay\n\n```\npublic int getMediumContrastThemeOverlay ()\n```\n\nReturns the resource id of the medium contrast theme overlay.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]