# TintableBackgroundView

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

*** ** * ** ***


```
public interface TintableBackgroundView
```

<br />

Known direct subclasses [AppCompatAutoCompleteTextView](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatAutoCompleteTextView), [AppCompatButton](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatButton), [AppCompatCheckBox](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatCheckBox), [AppCompatCheckedTextView](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatCheckedTextView), [AppCompatEditText](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatEditText), [AppCompatImageButton](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatImageButton), [AppCompatImageView](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatImageView), [AppCompatMultiAutoCompleteTextView](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView), [AppCompatRadioButton](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatRadioButton), [AppCompatSpinner](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatSpinner), [AppCompatTextView](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatTextView), [AppCompatToggleButton](https://developer.android.com/reference/androidx/appcompat/widget/AppCompatToggleButton)

|---|---|
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatAutoCompleteTextView` | A `https://developer.android.com/reference/android/widget/AutoCompleteTextView.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatButton` | A `https://developer.android.com/reference/android/widget/Button.html` which supports compatible features on older versions of the platform, including: |
| `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/AppCompatCheckedTextView` | A `https://developer.android.com/reference/android/widget/CheckedTextView.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatEditText` | A `https://developer.android.com/reference/android/widget/EditText.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatImageButton` | A `https://developer.android.com/reference/android/widget/ImageButton.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatImageView` | A `https://developer.android.com/reference/android/widget/ImageView.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView` | A `https://developer.android.com/reference/android/widget/MultiAutoCompleteTextView.html` which supports compatible features on older version 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: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatSpinner` | A `https://developer.android.com/reference/android/widget/Spinner.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatTextView` | A `https://developer.android.com/reference/android/widget/TextView.html` which supports compatible features on older versions of the platform, including: |
| `https://developer.android.com/reference/androidx/appcompat/widget/AppCompatToggleButton` | A `https://developer.android.com/reference/android/widget/ToggleButton.html` which supports compatible features on older versions of the platform, including: |

Known indirect subclasses [EmojiAppCompatButton](https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatButton), [EmojiAppCompatEditText](https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatEditText), [EmojiAppCompatTextView](https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatTextView), [GuidedActionAppCompatEditText](https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAppCompatEditText), [ImageFilterButton](https://developer.android.com/reference/androidx/constraintlayout/utils/widget/ImageFilterButton), [ImageFilterView](https://developer.android.com/reference/androidx/constraintlayout/utils/widget/ImageFilterView), [MotionButton](https://developer.android.com/reference/androidx/constraintlayout/utils/widget/MotionButton)

|---|---|
| `https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatButton` | AppCompatButton widget enhanced with emoji capability by using `https://developer.android.com/reference/androidx/emoji/widget/EmojiTextViewHelper`. |
| `https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatEditText` | AppCompatEditText widget enhanced with emoji capability by using `https://developer.android.com/reference/androidx/emoji/widget/EmojiEditTextHelper`. |
| `https://developer.android.com/reference/androidx/emoji/widget/EmojiAppCompatTextView` | AppCompatTextView widget enhanced with emoji capability by using `https://developer.android.com/reference/androidx/emoji/widget/EmojiTextViewHelper`. |
| `https://developer.android.com/reference/androidx/leanback/widget/GuidedActionAppCompatEditText` | A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment. |
| `https://developer.android.com/reference/androidx/constraintlayout/utils/widget/ImageFilterButton` | An AppCompatImageButton that can display, combine and filter images. |
| `https://developer.android.com/reference/androidx/constraintlayout/utils/widget/ImageFilterView` | An ImageView that can display, combine and filter images. |
| `https://developer.android.com/reference/androidx/constraintlayout/utils/widget/MotionButton` | A MotionButton is an AppCompatButton that can round its edges. |

*** ** * ** ***

Interface which allows a `https://developer.android.com/reference/android/view/View.html` to receive background tinting calls from `https://developer.android.com/reference/androidx/core/view/ViewCompat` 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/view/TintableBackgroundView#getSupportBackgroundTintList()()` Return the tint applied to the background drawable, if specified. |
| `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/view/TintableBackgroundView#getSupportBackgroundTintMode()()` Return the blending mode used to apply the tint to the background drawable, if specified. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/view/TintableBackgroundView#setSupportBackgroundTintList(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 background drawable. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/view/TintableBackgroundView#setSupportBackgroundTintMode(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 used to apply the tint specified by `https://developer.android.com/reference/androidx/core/view/TintableBackgroundView#setSupportBackgroundTintList(android.content.res.ColorStateList)`} to the background drawable. |

## Public methods

### getSupportBackgroundTintList

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

```
abstract @Nullable ColorStateList getSupportBackgroundTintList()
```

Return the tint applied to the background drawable, if specified.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/res/ColorStateList.html` | the tint applied to the background drawable |

### getSupportBackgroundTintMode

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

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

Return the blending mode used to apply the tint to the background drawable, if specified.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html` | the blending mode used to apply the tint to the background drawable |

### setSupportBackgroundTintList

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

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

Applies a tint to the background 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 `View.setBackground(Drawable)` will 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 |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/TintableBackgroundView#getSupportBackgroundTintList()` |   |

### setSupportBackgroundTintMode

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

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

Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/androidx/core/view/TintableBackgroundView#setSupportBackgroundTintList(android.content.res.ColorStateList)`} to the background 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/view/TintableBackgroundView#getSupportBackgroundTintMode()` |   |