The second Android 11 Developer Preview is now available, test it out and share your feedback.

Emphasis

@Immutable interface Emphasis
androidx.ui.material.Emphasis

Emphasis allows certain parts of a component to be accentuated, or shown with lower contrast to reflect importance / state inside a component. For example, inside a disabled button, text should have an emphasis level of EmphasisLevels.disabled, to show that the button is currently not active / able to be interacted with.

Emphasis works by adjusting the color provided by contentColor, so that emphasis levels cascade through a subtree without requiring components to be aware of their context.

The default implementations convey emphasis by changing the alpha / opacity of color, to increase / reduce contrast for a particular element.

To set emphasis for a particular subtree, see ProvideEmphasis.

To define the emphasis levels in your application, see EmphasisLevels and EmphasisAmbient

  • note that this should not typically be customized, as the default values are optimized for accessibility and contrast on different surfaces.

For more information on emphasis and ensuring legibility for content, see Text legibility

Summary

Public methods

abstract Color
emphasize(color: Color)

Applies emphasis to the given color.

Public methods

emphasize

abstract fun emphasize(color: Color): Color

Applies emphasis to the given color.