# TintableCompoundButton

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/TintableCompoundButton.java+class:androidx.core.widget.TintableCompoundButton) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public interface TintableCompoundButton
```

<br />

Known direct subclasses [AppCompatCheckBox](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatCheckBox), [AppCompatRadioButton](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatRadioButton)

|---|---|
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatCheckBox` | A `https://developer.android.com/reference/android/widget/CheckBox.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatRadioButton` | A `https://developer.android.com/reference/android/widget/RadioButton.html` which supports compatible features on older versions of the platform, including: |

*** ** * ** ***

Interface which allows a `https://developer.android.com/reference/android/widget/CompoundButton.html` to receive tinting calls from `CompoundButtonCompat` when running on API v20 devices or lower.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/res/ColorStateList.html` | `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#getSupportButtonTintList()()` Returns the tint applied to the button drawable |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html` | `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#getSupportButtonTintMode()()` Returns the blending mode used to apply the tint to the button drawable |
| `abstract void` | `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#setSupportButtonTintList(android.content.res.ColorStateList)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/res/ColorStateList.html tint)` Applies a tint to the button drawable. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#setSupportButtonTintMode(android.graphics.PorterDuff.Mode)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html tintMode)` Specifies the blending mode which should be used to apply the tint specified by `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#setSupportButtonTintList(android.content.res.ColorStateList)` to the button drawable. |

## Public methods

### getSupportButtonTintList

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
abstract @Nullable ColorStateList getSupportButtonTintList()
```

Returns the tint applied to the button drawable

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#setSupportButtonTintList(android.content.res.ColorStateList)` |   |

### getSupportButtonTintMode

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
abstract @Nullable PorterDuff.Mode getSupportButtonTintMode()
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#setSupportButtonTintMode(android.graphics.PorterDuff.Mode)` |   |

### setSupportButtonTintList

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
abstract void setSupportButtonTintList(@Nullable ColorStateList tint)
```

Applies a tint to the button drawable. Does not modify the current tint mode, which is `https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html#SRC_IN` by default.

Subsequent calls to `https://developer.android.com/reference/android/widget/CompoundButton.html#setButtonDrawable(android.graphics.drawable.Drawable)` should automatically mutate the drawable and apply the specified tint and tint mode.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/res/ColorStateList.html tint` | the tint to apply, may be `null` to clear tint |

### setSupportButtonTintMode

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
abstract void setSupportButtonTintMode(@Nullable PorterDuff.Mode tintMode)
```

Specifies the blending mode which should be used to apply the tint specified by `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#setSupportButtonTintList(android.content.res.ColorStateList)` to the button drawable. The default mode is `https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html#SRC_IN`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html tintMode` | the blending mode used to apply the tint, may be `null` to clear tint |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/widget/TintableCompoundButton#getSupportButtonTintMode()` |   |
| `https://developer.android.com/reference/androidx/core/graphics/drawable/DrawableCompat#setTintMode(android.graphics.drawable.Drawable,android.graphics.PorterDuff.Mode)` |   |