Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

TintableCompoundDrawablesView

public interface TintableCompoundDrawablesView

androidx.core.widget.TintableCompoundDrawablesView


Interface which allows TextView and subclasses to tint compound drawables with TextViewCompat when running on API v22 devices or lower.

Summary

Public methods

abstract ColorStateList getSupportCompoundDrawablesTintList()

Return the tint applied to the compound drawables, if specified.

abstract PorterDuff.Mode getSupportCompoundDrawablesTintMode()

Returns the blending mode used to apply the tint to the compound drawables, if specified.

abstract void setSupportCompoundDrawablesTintList(ColorStateList tint)

Applies a tint to the compound drawables.

abstract void setSupportCompoundDrawablesTintMode(PorterDuff.Mode tintMode)

Specifies the blending mode used to apply the tint specified by setSupportCompoundDrawablesTintList(ColorStateList) to the compound drawables.

Public methods

getSupportCompoundDrawablesTintList

public abstract ColorStateList getSupportCompoundDrawablesTintList ()

Return the tint applied to the compound drawables, if specified.

Returns
ColorStateList the tint applied to the compound drawables

getSupportCompoundDrawablesTintMode

public abstract PorterDuff.Mode getSupportCompoundDrawablesTintMode ()

Returns the blending mode used to apply the tint to the compound drawables, if specified.

Returns
PorterDuff.Mode the blending mode used to apply the tint to the compound drawables

setSupportCompoundDrawablesTintList

public abstract void setSupportCompoundDrawablesTintList (ColorStateList tint)

Applies a tint to the compound drawables. Does not modify the current tint mode, which is PorterDuff.Mode.SRC_IN by default.

Subsequent calls to TextView.setCompoundDrawables(Drawable, Drawable, Drawable, Drawable) and related methods will automatically mutate the drawables and apply the specified tint and tint mode.

Parameters
tint ColorStateList: the tint to apply, may be null to clear tint

setSupportCompoundDrawablesTintMode

public abstract void setSupportCompoundDrawablesTintMode (PorterDuff.Mode tintMode)

Specifies the blending mode used to apply the tint specified by setSupportCompoundDrawablesTintList(ColorStateList) to the compound drawables. The default mode is PorterDuff.Mode.SRC_IN.

Parameters
tintMode PorterDuff.Mode: the blending mode used to apply the tint, may be null to clear tint