TintableCompoundButton

interface TintableCompoundButton
androidx.core.widget.TintableCompoundButton

Interface which allows a android.widget.CompoundButton to receive tinting calls from CompoundButtonCompat when running on API v20 devices or lower.

Summary

Public methods

abstract ColorStateList?

Returns the tint applied to the button drawable

abstract Mode?

Returns the blending mode used to apply the tint to the button drawable

abstract Unit

Applies a tint to the button drawable.

abstract Unit
setSupportButtonTintMode(@Nullable tintMode: Mode?)

Specifies the blending mode which should be used to apply the tint specified by setSupportButtonTintList(ColorStateList) to the button drawable.

Public methods

getSupportButtonTintList

@Nullable abstract fun getSupportButtonTintList(): ColorStateList?

Returns the tint applied to the button drawable

getSupportButtonTintMode

@Nullable abstract fun getSupportButtonTintMode(): Mode?

Returns the blending mode used to apply the tint to the button drawable

setSupportButtonTintList

abstract fun setSupportButtonTintList(@Nullable tint: ColorStateList?): Unit

Applies a tint to the button drawable. Does not modify the current tint mode, which is PorterDuff.Mode#SRC_IN by default.

Subsequent calls to setButtonDrawable(Drawable) should automatically mutate the drawable and apply the specified tint and tint mode.

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

setSupportButtonTintMode

abstract fun setSupportButtonTintMode(@Nullable tintMode: Mode?): Unit

Specifies the blending mode which should be used to apply the tint specified by setSupportButtonTintList(ColorStateList) to the button drawable. The default mode is PorterDuff.Mode#SRC_IN.

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