mirror of
https://github.com/material-components/material-components-android.git
synced 2026-01-21 20:43:34 +08:00
[Docs] Updated dev doc for tonal surface colors in affected components.
PiperOrigin-RevId: 556901517
This commit is contained in:
parent
c04eaba902
commit
2114a11378
@ -236,7 +236,7 @@ floating action button (FAB), action item(s) and an overflow menu.
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
------------- | ------------------------ | ------------------------------------------ | -------------
|
||||
**Color** | `app:backgroundTint` | `setBackgroundTint`<br>`getBackgroundTint` | `?attr/colorSurface`
|
||||
**Color** | `app:backgroundTint` | `setBackgroundTint`<br>`getBackgroundTint` | `?attr/colorSurfaceContainer`
|
||||
**Elevation** | `app:elevation` | `setElevation` | `3dp`
|
||||
**Height** | `android:minHeight` | `setMinimumHeight`<br>`getMinimumHeight` | `80dp`
|
||||
**Shadows** | `app:addElevationShadow` | N/A | `false`
|
||||
|
||||
@ -264,7 +264,7 @@ The following is an anatomy diagram for the bottom navigation bar:
|
||||
|
||||
**Element** | **Attribute** | **Related methods** | **Default value**
|
||||
----------------- | --------------------- | ------------------- | -----------------
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurfaceContainer`
|
||||
**Elevation** | `app:elevation` | `setElevation` | `3dp`
|
||||
**Compat Shadow** | `compatShadowEnabled` | N/A | `false`
|
||||
|
||||
|
||||
@ -421,8 +421,8 @@ Content can also be added below the drag handle. (see [Using bottom sheets](#usi
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
-------------- | --------------------- | --------------------------------- | -------------
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`
|
||||
**Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceLargeComponent`
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurfaceContainerLow`
|
||||
**Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceCornerExtraLarge`
|
||||
**Elevation** | `android:elevation` | N/A | `1dp`
|
||||
**Max width** | `android:maxWidth` | `setMaxWidth`<br/>`getMaxWidth` | `640dp`
|
||||
**Max height** | `android:maxHeight` | `setMaxHeight`<br/>`getMaxHeight` | N/A
|
||||
|
||||
@ -143,7 +143,7 @@ Element | Attribute | Related method(s) |
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
---------------- | --------------------- | ---------------------------------------------------------------------------- | -------------
|
||||
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`getBackgroundTintList` | `?attr/colorSurface` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_background_color_selector.xml))
|
||||
**Color** | `app:backgroundTint` | `setBackgroundColor`<br/>`setBackgroundTintList`<br/>`getBackgroundTintList` | `?attr/colorSurfaceContainerLow` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/res/color/m3_text_button_background_color_selector.xml))
|
||||
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`setStrokeColorResource`<br/>`getStrokeColor` | `null`
|
||||
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`setStrokeWidthResource`<br/>`getStrokeWidth` | `0dp`
|
||||
**Shape** | `app:shapeAppearance` | `setShapeAppearanceModel`<br/>`getShapeAppearanceModel` | `?attr/shapeAppearanceSmallComponent`
|
||||
|
||||
@ -367,7 +367,7 @@ shown in the [card examples](#card-examples) section.
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
-------------------- | ------------------------- | ------------------------------------------------------------------- | -------------
|
||||
**Color** | `app:cardBackgroundColor` | `setCardBackgroundColor`<br/>`getCardBackgroundColor` | `?attr/colorSurface` or `?attr/colorSurfaceVariant` (filled style)
|
||||
**Color** | `app:cardBackgroundColor` | `setCardBackgroundColor`<br/>`getCardBackgroundColor` | `?attr/colorSurface` (outlined style)</br>`?attr/colorSurfaceContainerHighest` (filled style)</br>`?attr/colorSurfaceContainerLow` (elevated style)
|
||||
**Foreground color** | `app:cardForegroundColor` | `setCardForegroundColor`<br/>`getCardForegroundColor` | `@android:color/transparent` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/card/res/color/m3_card_foreground_color.xml))
|
||||
**Stroke color** | `app:strokeColor` | `setStrokeColor`<br/>`getStrokeColor`<br/>`getStrokeColorStateList` | `?attr/colorOutline` (unchecked)<br/>`?attr/colorSecondary` (checked)
|
||||
**Stroke width** | `app:strokeWidth` | `setStrokeWidth`<br/>`getStrokeWidth` | `1dp` (outlined style)<br/>`0dp` (elevated or filled style)
|
||||
|
||||
@ -294,6 +294,13 @@ The following diagram shows the elements of a date picker:
|
||||
6. Current date
|
||||
7. Selected date
|
||||
|
||||
### Container
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
--------- | --------------------- | ----------------- | -------------
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurfaceContainerHigh`
|
||||
**Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceCornerExtraLarge`
|
||||
|
||||
### Title
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
|
||||
@ -126,8 +126,8 @@ particular type), a background scrim, and, optionally, title and buttons.
|
||||
|
||||
Element | **Attribute** | **Related methods** | **Default value**
|
||||
----------------------------------- | -------------------------------------------------------- | ------------------------------------------------------ | -----------------
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`
|
||||
**Shape** | `app:shapeAppearance`<br/>`app:shapeAppearanceOverlay` | N/A | `?attr/shapeAppearanceMediumComponent` with a corner size of `28dp`
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurfaceContainerHigh`
|
||||
**Shape** | `app:shapeAppearance`<br/>`app:shapeAppearanceOverlay` | N/A | `?attr/shapeAppearanceCornerExtraLarge`
|
||||
**Background inset start and end** | `app:backgroundInsetStart`<br/>`app:backgroundInsetEnd` | `setBackgroundInsetStart`<br/>`setBackgroundInsetEnd` | `24dp`
|
||||
**Background inset top and bottom** | `app:backgroundInsetTop`<br/>`app:backgroundInsetBottom` | `setBackgroundInsetTop`<br/>`setBackgroundInsetBottom` | `80dp`
|
||||
|
||||
|
||||
@ -426,7 +426,7 @@ The following are menu anatomy diagrams showing all possible elements:
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
-------------- | ----------------------------- | ----------------- | -------------
|
||||
**Background** | `android:popupMenuBackground` | N/A | `?attr/popupMenuBackground`
|
||||
**Color** | N/A | N/A | `?attr/colorSurface`
|
||||
**Color** | N/A | N/A | `?attr/colorSurfaceContainer`
|
||||
**Elevation** | `android:popupElevation` | N/A | `3dp`
|
||||
|
||||
#### Text attributes
|
||||
@ -571,17 +571,17 @@ For all attributes that apply to the `TextInputLayout`, see the
|
||||
#### `MaterialAutoCompleteTextView` attributes (input text, dropdown menu)
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
----------------------------------------- | ------------------------------------------------------------------- |-----------------------------------------------------------------------------------------------------| -------------
|
||||
----------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------------
|
||||
**Input text** | `android:text` | `setText`<br/>`getText` | `@null`
|
||||
**Typography** | `android:textAppearance` | `setTextAppearance` | `?attr/textAppearanceBodyLarge`
|
||||
**Input accepted** | `android:inputType` | `N/A` | framework's default
|
||||
**Input text color** | `android:textColor` | `setTextColor`<br/>`getTextColors`<br/>`getCurrentTextColor` | `?android:textColorPrimary`
|
||||
**Cursor color** | N/A (color comes from the theme attr `?attr/colorControlActivated`) | N/A | `?attr/colorPrimary`
|
||||
**Dropdown menu<br/>container color** | `app:dropDownBackgroundTint` | `setDropDownBackgroundTint`<br/>`setDropDownBackgroundTintList`<br/>`getDropDownBackgroundTintList` | `@null`</br>(which means `colorSurface` with</br> elevation overlay will be used)
|
||||
**Dropdown menu<br/>container color** | `app:dropDownBackgroundTint` | `setDropDownBackgroundTint`<br/>`setDropDownBackgroundTintList`<br/>`getDropDownBackgroundTintList` | `colorSurfaceContainer`
|
||||
**Dropdown menu elevation** | `android:popupElevation` | `getPopupElevation` | `3dp`
|
||||
**Simple items** | `app:simpleItems` | `setSimpleItems` | `null`
|
||||
**Simple item layout** | `app:simpleItemLayout` | N/A | `@layout/m3_auto_complete_simple_item`
|
||||
**Selected simple item color** | `app:simpleItemSelectedColor` | `setSimpleItemSelectedColor`<br/>`getSimpleItemSelectedColor` | `?attr/colorSurfaceVariant`
|
||||
**Selected simple item color** | `app:simpleItemSelectedColor` | `setSimpleItemSelectedColor`<br/>`getSimpleItemSelectedColor` | `?attr/colorSurfaceContainerHighest`
|
||||
**Selected simple item<br/>ripple color** | `app:simpleItemSelectedRippleColor` | `setSimpleItemSelectedRippleColor`<br/>`getSimpleItemSelectedRippleColor` | `@color/m3_simple_item_ripple_color`
|
||||
|
||||
#### Styles
|
||||
|
||||
@ -263,12 +263,12 @@ subtitles, and an optional scrim.
|
||||
|
||||
Element | Attribute(s) | Related method(s) | Default value
|
||||
----------------------- | ------------------------------------------------------------------- | ------------------------------------------------ | -------------
|
||||
**Color** | `android:background` | `setBackground`<br>`getBackground` | `?attr/colorSurface`
|
||||
**Color** | `android:background` | `setBackground`<br>`getBackground` | `?attr/colorSurfaceContainerLow`
|
||||
**Shape** | `app:shapeAppearance`<br>`app:shapeAppearanceOverlay` | N/A | `null`
|
||||
**Elevation** | `app:elevation` (can be used on `NavigationView` or `DrawerLayout`) | `setElevation`<br>`getElevation` | `0dp` (`NavigationView`) or `1dp` (`DrawerLayout`)
|
||||
**Max width** | `android:maxWidth` | N/A | `280dp`
|
||||
**Fits system windows** | `android:fitsSystemWindows` | `setFitsSystemWindows`<br>`getFitsSystemWindows` | `true`
|
||||
**Drawer corner size** | `drawerLayoutCornerSize` | N/A | `16dp`
|
||||
**Drawer corner size** | `drawerLayoutCornerSize` | N/A | `16dp`
|
||||
|
||||
### Header attributes
|
||||
|
||||
|
||||
@ -293,7 +293,7 @@ Element | Attribute | Related method(s)
|
||||
----------------------------- | --------------------------- | --------------------------------------------------------- | -------------
|
||||
**Track thickness** | `app:trackThickness` | `setTrackThickness`</br>`getTrackThickness` | `4dp`
|
||||
**Indicator color** | `app:indicatorColor` | `setIndicatorColor`</br>`getIndicatorColor` | `colorPrimary`
|
||||
**Track color** | `app:trackColor` | `setTrackColor`</br>`getTrackColor` | `indicatorColor` at `disabledAlpha`
|
||||
**Track color** | `app:trackColor` | `setTrackColor`</br>`getTrackColor` | `colorSurfaceContainerHighest` (linear)</br>`@android:color/transparent` (circular)
|
||||
**Track corner radius** | `app:trackCornerRadius` | `setTrackCornerRadius`</br>`getTrackCornerRadius` | `0dp`
|
||||
**Show animation behavior** | `app:showAnimationBehavior` | `setShowAnimationBehavior`</br>`getShowAnimationBehavior` | `none`
|
||||
**Hide animation behavior** | `app:hideAnimationBehavior` | `setHideAnimationBehavior`</br>`getHideAnimationBehavior` | `none`
|
||||
|
||||
@ -105,7 +105,7 @@ Element | Attribute | Related method(s)
|
||||
**Search text appearance** | `android:textAppearance` | `setTextAppearance`<br/>`getTextAppearance` | `@style/TextAppearance.Material3.SearchBar`
|
||||
**Search text** | `android:text` | `setText`<br/>`getText` | `null`
|
||||
**Search hint** | `android:hint` | `setHint`<br/>`getHint` | `null`
|
||||
**Color** | `app:backgroundTint` | -- | `?attr/colorSurface`
|
||||
**Color** | `app:backgroundTint` | -- | `?attr/colorSurfaceContainerHigh`
|
||||
**Flag for default margins** | `app:defaultMarginsEnabled` | -- | `true`
|
||||
**Flag for navigation icon** | `app:hideNavigationIcon` | -- | `false`
|
||||
|
||||
@ -218,7 +218,7 @@ Element | Attribute | Related meth
|
||||
**Search text appearance** | `android:textAppearance` | `setTextAppearance`<br/>`getTextAppearance` | `@style/TextAppearance.Material3.SearchBar`
|
||||
**Search text** | `android:text` | `setText`<br/>`getText` | `null`
|
||||
**Search hint** | `android:hint` | `setHint`<br/>`getHint` | `null`
|
||||
**Color** | `app:backgroundTint` | -- | `?attr/colorSurface`
|
||||
**Color** | `app:backgroundTint` | -- | `?attr/colorSurfaceContainerHigh`
|
||||
**Flag for navigation icon** | `app:hideNavigationIcon` | -- | `true`
|
||||
**Flag for `DrawerArrowDrawable`** | `app:useDrawerArrowDrawable` | -- | `false`
|
||||
**Flag for soft keyboard** | `app:autoShowKeyboard` | -- | `true`
|
||||
|
||||
@ -264,15 +264,15 @@ Side sheets have a sheet, content, and, if modal, a scrim.
|
||||
|
||||
### Sheet attributes
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
-------------- |-----------------------------|---------------------------------------------------------| -------------
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
---------------------------- | --------------------------- | ------------------------------------------------------- | -------------
|
||||
**Color** | `app:backgroundTint` | N/A | `?attr/colorSurface`</br>`?attr/colorSurfaceContainerLow` (modal)
|
||||
**Coplanar sibling view id** | `app:coplanarSiblingViewId` | `setCoplanarSiblingViewId`<br/>`setCoplanarSiblingView` | N/A
|
||||
**Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceLargeComponent`
|
||||
**Sheet edge** | `android:layout_gravity` | `setSheetEdge` (modal only) | end
|
||||
**Elevation** | `android:elevation` | N/A | 0dp
|
||||
**Max width** | `android:maxWidth` | `setMaxWidth`<br/>`getMaxWidth` | N/A
|
||||
**Max height** | `android:maxHeight` | `setMaxHeight`<br/>`getMaxHeight` | N/A
|
||||
**Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceLargeComponent`
|
||||
**Sheet edge** | `android:layout_gravity` | `setSheetEdge` (modal only) | end
|
||||
**Elevation** | `android:elevation` | N/A | 0dp
|
||||
**Max width** | `android:maxWidth` | `setMaxWidth`<br/>`getMaxWidth` | N/A
|
||||
**Max height** | `android:maxHeight` | `setMaxHeight`<br/>`getMaxHeight` | N/A
|
||||
|
||||
### Behavior attributes
|
||||
|
||||
|
||||
@ -299,7 +299,7 @@ Element | Attribute | Related
|
||||
**Height** | `app:trackHeight` | `setTrackHeight`<br/>`getTrackHeight` | `4dp`
|
||||
**Color** | `app:trackColor` | `setTrackTintList`<br/>`getTrackTintList` | `null`
|
||||
**Color for track's active part** | `app:trackColorActive` | `setTrackActiveTintList`<br/>`getTrackActiveTintList` | `?attr/colorPrimary`
|
||||
**Color for track's inactive part** | `app:trackColorInactive` | `setTrackInactiveTintList`<br/>`getTrackInactiveTintList` | `?attr/colorSurfaceVariant`
|
||||
**Color for track's inactive part** | `app:trackColorInactive` | `setTrackInactiveTintList`<br/>`getTrackInactiveTintList` | `?attr/colorSurfaceContainerHighest`
|
||||
**Minimum separation for adjacent thumbs** | `app:minSeparation` | `setMinSeparation`<br/>`getMinSeparation` | `0dp`
|
||||
|
||||
**Note:** `app:trackColor` takes precedence over `app:trackColorActive` and
|
||||
|
||||
@ -155,17 +155,17 @@ switch by assigning `app:thumbIcon`. This icon will be centered and displayed on
|
||||
top of the thumb drawable.
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
--------- |---------------------|---------------------------------------------------| -------------
|
||||
--------- | ------------------- | ------------------------------------------------- | -------------
|
||||
**Icon** | `app:thumbIcon` | `setThumbIconDrawable`<br/>`getThumbIconDrawable` | `null`
|
||||
**Size** | `app:thumbIconSize` | `setThumbIconSize`<br/>`getThumbIconSize` | `16dp`
|
||||
**Color** | `app:thumbIconTint` | `setThumbIconTintList`<br/>`getThumbIconTintList` | `?attr/colorSurfaceVariant` (unchecked)<br/>`?attr/colorOnPrimaryContainer` (checked)
|
||||
**Color** | `app:thumbIconTint` | `setThumbIconTintList`<br/>`getThumbIconTintList` | `?attr/colorSurfaceContainerHighest` (unchecked)<br/>`?attr/colorOnPrimaryContainer` (checked)
|
||||
|
||||
### Track attributes
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
-------------------- | ------------------------- | ------------------------------------------------------------- | -------------
|
||||
**Track** | `app:track` | `setTrackDrawable`<br/>`getTrackDrawable` | `@drawable/mtrl_switch_track`
|
||||
**Color** | `app:trackTint` | `setTrackTintList`<br/>`getTrackTintList` | `?attr/colorSurfaceVariant` (unchecked)<br/>`?attr/colorPrimary` (checked)
|
||||
**Color** | `app:trackTint` | `setTrackTintList`<br/>`getTrackTintList` | `?attr/colorSurfaceContainerHighest` (unchecked)<br/>`?attr/colorPrimary` (checked)
|
||||
**Decoration** | `app:trackDecoration` | `setTrackDecorationDrawable`<br/>`getTrackDecorationDrawable` | `@drawable/mtrl_switch_track_decoration`<br/>(Shows an outline of the track.)
|
||||
**Decoration color** | `app:trackDecorationTint` | `setTrackDecorationTintList`<br/>`getTrackDecorationTintList` | `?attr/colorOutline` (unchecked)<br/>`@android:color/transparent` (checked)
|
||||
|
||||
|
||||
@ -462,7 +462,7 @@ indicator, optional helper/error text and optional leading/trailing icons.
|
||||
|
||||
Element | Attribute | Related method(s) | Default value
|
||||
---------------------- | ------------------------ | --------------------------------------------------------------------------------------- | -------------
|
||||
**Color** | `app:boxBackgroundColor` | `setBoxBackgroundColor`<br/>`setBoxBackgroundColorResource`<br/>`getBoxBackgroundColor` | `?attr/colorSurfaceVariant` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/textfield/res/color/m3_textfield_filled_background_color.xml))
|
||||
**Color** | `app:boxBackgroundColor` | `setBoxBackgroundColor`<br/>`setBoxBackgroundColorResource`<br/>`getBoxBackgroundColor` | `?attr/colorSurfaceContainerHighest` (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/textfield/res/color/m3_textfield_filled_background_color.xml))
|
||||
**Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceSmallComponent`
|
||||
**Text field enabled** | `android:enabled` | `setEnabled` | `true`
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ Element | Attribute | Related metho
|
||||
**Title** | `N/A` | `Builder.setTitleText` | `Select Time`
|
||||
**Keyboard Icon** | `app:keyboardIcon` | `N/A` | `@drawable/ic_keyboard_black_24dp`
|
||||
**Clock Icon** | `app:clockIcon` | `N/A` | `@drawable/ic_clock_black_24dp`
|
||||
**Clock face Background Color** | `app:clockFaceBackgroundColor` | `N/A` | `?attr/colorSurfaceVariant`
|
||||
**Clock face Background Color** | `app:clockFaceBackgroundColor` | `N/A` | `?attr/colorSurfaceContainerHighest`
|
||||
**Clock hand color** | `app:clockNumberTextColor` | `N/A` | `?attr/colorPrimary`
|
||||
**Clock Number Text Color** | `app:clockNumberTextColor` | `N/A` | `?attr/colorOnBackground`
|
||||
|
||||
|
||||
@ -407,7 +407,7 @@ Element | Attribute
|
||||
**`CollapsingToolbarLayout` scrim animation duration** | `app:scrimAnimationDuration` | `setScrimAnimationDuration`<br>`getScrimAnimationDuration` | `600`
|
||||
**`CollapsingToolbarLayout` collapsing animation interpolator** | `app:titlePositionInterpolator` | `setTitlePositionInterpolator` | `@null`
|
||||
**`AppBarLayout` lift on scroll** | `app:liftOnScroll` | `setLiftOnScroll`<br>`isLiftOnScroll` | `true`
|
||||
**`AppBarLayout` lift on scroll color** | `app:liftOnScrollColor` | N/A | `@null` (defaults to elevation overlay color)
|
||||
**`AppBarLayout` lift on scroll color** | `app:liftOnScrollColor` | N/A | `?attr/colorSurfaceContainer`
|
||||
**`AppBarLayout` lift on scroll target view** | `app:liftOnScrollTargetViewId` | `setLiftOnScrollTargetViewId`<br>`getLiftOnScrollTargetViewId` | `@null`
|
||||
**`AppBarLayout` scroll effect** | `app:layout_scrollEffect` | `setScrollEffect`<br>`getScrollEffect` | `none`
|
||||
|
||||
|
||||
@ -70,29 +70,29 @@ combinations. These additional color attributes are as follows:
|
||||
|
||||
<!-- Auto-generated additional color table starts. Do not edit below or remove this comment. -->
|
||||
|
||||
Color Role | Android Attribute | Light Theme Baseline (Dynamic) Color | Dark Theme Baseline (Dynamic) Color
|
||||
------------------------- | ---------------------------- | ------------------------------------------------ | -----------------------------------
|
||||
Error | colorError | error40</br>(Same) | error80</br>(Same)
|
||||
On Error | colorOnError | white</br>(Same) | error20</br>(Same)
|
||||
Error Container | colorErrorContainer | error90</br>(Same) | error30</br>(Same)
|
||||
On Error Container | colorOnErrorContainer | error10</br>(Same) | error90</br>(Same)
|
||||
Outline | colorOutline | neutral_variant50</br>(system_neutral2_500) | neutral_variant60</br>(system_neutral2_400)
|
||||
Outline Variant | colorOutlineVariant | neutral_variant80</br>(system_neutral2_200) | neutral_variant30</br>(system_neutral2_700)
|
||||
Background | android:colorBackground | primary99</br>(system_neutral1_10) | neutral10</br>(system_neutral1_900)
|
||||
On Background | colorOnBackground | neutral10</br>(system_neutral1_900) | neutral90</br>(system_neutral1_100)
|
||||
Surface | colorSurface | primary99</br>(system_neutral1_10) | neutral10</br>(system_neutral1_900)
|
||||
On Surface | colorOnSurface | neutral10</br>(system_neutral1_900) | neutral90</br>(system_neutral1_100)
|
||||
Surface Variant | colorSurfaceVariant | neutral_variant90</br>(system_neutral2_100) | neutral_variant30</br>(system_neutral2_700)
|
||||
On Surface Variant | colorOnSurfaceVariant | neutral_variant30</br>(system_neutral2_700) | neutral_variant80</br>(system_neutral2_200)
|
||||
Inverse Surface | colorSurfaceInverse | neutral24</br>(system_neutral1_800) | neutral90</br>(system_neutral1_100)
|
||||
Inverse On Surface | colorOnSurfaceInverse | neutral95</br>(system_neutral1_50) | neutral24</br>(system_neutral1_800)
|
||||
Surface Bright | colorSurfaceBright | neutral98</br>(m3_ref_palette_dynamic_neutral98) | neutral24</br>(m3_ref_palette_dynamic_neutral24)
|
||||
Surface Dim | colorSurfaceDim | neutral87</br>(m3_ref_palette_dynamic_neutral87) | neutral6</br>(m3_ref_palette_dynamic_neutral6)
|
||||
Surface Container | colorSurfaceContainer | neutral94</br>(m3_ref_palette_dynamic_neutral94) | neutral12</br>(m3_ref_palette_dynamic_neutral12)
|
||||
Surface Container Low | colorSurfaceContainerLow | neutral96</br>(m3_ref_palette_dynamic_neutral96) | neutral10</br>(system_neutral1_900)
|
||||
Surface Container Lowest | colorSurfaceContainerLowest | white</br>(system_neutral1_0) | neutral4</br>(m3_ref_palette_dynamic_neutral4)
|
||||
Surface Container High | colorSurfaceContainerHigh | neutral92</br>(m3_ref_palette_dynamic_neutral92) | neutral17</br>(m3_ref_palette_dynamic_neutral17)
|
||||
Surface Container Highest | colorSurfaceContainerHighest | neutral90</br>(system_neutral1_100) | neutral24</br>(m3_ref_palette_dynamic_neutral22)
|
||||
Color Role | Android Attribute | Light Theme Baseline (Dynamic) Color | Dark Theme Baseline (Dynamic) Color
|
||||
------------------------- | ---------------------------- | -------------------------------------------------------- | -----------------------------------
|
||||
Error | colorError | error40</br>(Same) | error80</br>(Same)
|
||||
On Error | colorOnError | white</br>(Same) | error20</br>(Same)
|
||||
Error Container | colorErrorContainer | error90</br>(Same) | error30</br>(Same)
|
||||
On Error Container | colorOnErrorContainer | error10</br>(Same) | error90</br>(Same)
|
||||
Outline | colorOutline | neutral_variant50</br>(system_neutral2_500) | neutral_variant60</br>(system_neutral2_400)
|
||||
Outline Variant | colorOutlineVariant | neutral_variant80</br>(system_neutral2_200) | neutral_variant30</br>(system_neutral2_700)
|
||||
Background | android:colorBackground | neutral98</br>(m3_ref_palette_dynamic_neutral_variant98) | neutral6</br>(m3_ref_palette_dynamic_neutral_variant6)
|
||||
On Background | colorOnBackground | neutral10</br>(system_neutral1_900) | neutral90</br>(system_neutral1_100)
|
||||
Surface | colorSurface | neutral98</br>(m3_ref_palette_dynamic_neutral_variant98) | neutral6</br>(m3_ref_palette_dynamic_neutral_variant6)
|
||||
On Surface | colorOnSurface | neutral10</br>(system_neutral1_900) | neutral90</br>(system_neutral1_100)
|
||||
Surface Variant | colorSurfaceVariant | neutral_variant90</br>(system_neutral2_100) | neutral_variant30</br>(system_neutral2_700)
|
||||
On Surface Variant | colorOnSurfaceVariant | neutral_variant30</br>(system_neutral2_700) | neutral_variant80</br>(system_neutral2_200)
|
||||
Inverse Surface | colorSurfaceInverse | neutral20</br>(system_neutral1_800) | neutral90</br>(system_neutral1_100)
|
||||
Inverse On Surface | colorOnSurfaceInverse | neutral95</br>(system_neutral1_50) | neutral20</br>(system_neutral1_800)
|
||||
Surface Bright | colorSurfaceBright | neutral98</br>(m3_ref_palette_dynamic_neutral_variant98) | neutral24</br>(m3_ref_palette_dynamic_neutral_variant24)
|
||||
Surface Dim | colorSurfaceDim | neutral87</br>(m3_ref_palette_dynamic_neutral_variant87) | neutral6</br>(m3_ref_palette_dynamic_neutral_variant6)
|
||||
Surface Container | colorSurfaceContainer | neutral94</br>(m3_ref_palette_dynamic_neutral_variant94) | neutral12</br>(m3_ref_palette_dynamic_neutral_variant12)
|
||||
Surface Container Low | colorSurfaceContainerLow | neutral96</br>(m3_ref_palette_dynamic_neutral_variant96) | neutral10</br>(system_neutral2_900)
|
||||
Surface Container Lowest | colorSurfaceContainerLowest | white</br>(system_neutral2_0) | neutral4</br>(m3_ref_palette_dynamic_neutral_variant4)
|
||||
Surface Container High | colorSurfaceContainerHigh | neutral92</br>(m3_ref_palette_dynamic_neutral_variant92) | neutral17</br>(m3_ref_palette_dynamic_neutral_variant17)
|
||||
Surface Container Highest | colorSurfaceContainerHighest | neutral90</br>(system_neutral2_100) | neutral22</br>(m3_ref_palette_dynamic_neutral_variant22)
|
||||
|
||||
<!-- Auto-generated additional color table ends. Do not edit below or remove this comment. -->
|
||||
|
||||
@ -223,7 +223,7 @@ DynamicColors.applyToActivitiesIfAvailable(this, (activity, themeResId) -> {
|
||||
Or provide your own customized dynamic color theme overlays, likely inheriting
|
||||
from the Material3 theme overlays above, by doing:
|
||||
|
||||
``` java
|
||||
```java
|
||||
DynamicColors.applyToActivitiesIfAvailable(this, R.style.ThemeOverlay_MyApp_DynamicColors_DayNight);
|
||||
```
|
||||
|
||||
@ -637,7 +637,7 @@ produces the range of tones needed for both light and dark theme applications.
|
||||
We have provided the following two APIs in the `DynamicColorsOptions` class.
|
||||
|
||||
API Method | Description
|
||||
------------------------------ | ---------------------------------------
|
||||
------------------------------ | -----------
|
||||
#setContentBasedSource(Bitmap) | Provides a Bitmap from which a single source color is extracted as input
|
||||
#setContentBasedSource(int) | Provides a single source color as input
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user