# CheckedTextViewCompat

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

*** ** * ** ***


```
public final class CheckedTextViewCompat
```

<br />

*** ** * ** ***

Helper for accessing `https://developer.android.com/reference/android/widget/CheckedTextView.html`.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `@https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "textView.getCheckMarkDrawable()") [getCheckMarkDrawable](https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#getCheckMarkDrawable(android.widget.CheckedTextView))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView)` **This method is deprecated.** Call `https://developer.android.com/reference/android/widget/CheckedTextView.html#getCheckMarkDrawable()` directly. <br /> |
| `static @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/CheckedTextViewCompat#getCheckMarkTintList(android.widget.CheckedTextView)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView)` Returns the tint applied to the check mark drawable |
| `static @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/CheckedTextViewCompat#getCheckMarkTintMode(android.widget.CheckedTextView)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView)` name android:checkMarkTintMode |
| `static void` | `https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#setCheckMarkTintList(android.widget.CheckedTextView,android.content.res.ColorStateList)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView, @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 check mark drawable. |
| `static void` | `https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#setCheckMarkTintMode(android.widget.CheckedTextView,android.graphics.PorterDuff.Mode)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView, @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/widget/CheckedTextViewCompat#setCheckMarkTintList(android.widget.CheckedTextView,android.content.res.ColorStateList)`} to the check mark drawable. |

## Public methods

### getCheckMarkDrawable

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

```
@ReplaceWith(expression = "textView.getCheckMarkDrawable()")
public static @Nullable Drawable [getCheckMarkDrawable](https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#getCheckMarkDrawable(android.widget.CheckedTextView))(@NonNull CheckedTextView textView)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Call `https://developer.android.com/reference/android/widget/CheckedTextView.html#getCheckMarkDrawable()` directly.

Returns the drawable used as the check mark image

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/CheckedTextView.html#setCheckMarkDrawable(android.graphics.drawable.Drawable)` |   |

### getCheckMarkTintList

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

```
public static @Nullable ColorStateList getCheckMarkTintList(@NonNull CheckedTextView textView)
```

Returns the tint applied to the check mark drawable

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#setCheckMarkTintList(android.widget.CheckedTextView,android.content.res.ColorStateList)` |   |

### getCheckMarkTintMode

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

```
public static @Nullable PorterDuff.Mode getCheckMarkTintMode(@NonNull CheckedTextView textView)
```

name android:checkMarkTintMode

| 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 check mark drawable |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#setCheckMarkTintMode(android.widget.CheckedTextView,android.graphics.PorterDuff.Mode)` |   |

### setCheckMarkTintList

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

```
public static void setCheckMarkTintList(
    @NonNull CheckedTextView textView,
    @Nullable ColorStateList tint
)
```

Applies a tint to the check mark 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/CheckedTextView.html#setCheckMarkDrawable(android.graphics.drawable.Drawable)` should automatically mutate the drawable and apply the specified tint and tint mode using `https://developer.android.com/reference/androidx/core/graphics/drawable/DrawableCompat#setTintList(android.graphics.drawable.Drawable,android.content.res.ColorStateList)`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView` | CheckedTextView for which to apply the tint. |
| `@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/widget/CheckedTextViewCompat#setCheckMarkTintList(android.widget.CheckedTextView,android.content.res.ColorStateList)` |   |

### setCheckMarkTintMode

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

```
public static void setCheckMarkTintMode(
    @NonNull CheckedTextView textView,
    @Nullable PorterDuff.Mode tintMode
)
```

Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/androidx/core/widget/CheckedTextViewCompat#setCheckMarkTintList(android.widget.CheckedTextView,android.content.res.ColorStateList)`} to the check mark 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/NonNull.html https://developer.android.com/reference/android/widget/CheckedTextView.html textView` | CheckedTextView for which to apply the tint mode. |
| `@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/CheckedTextViewCompat#getCheckMarkTintMode(android.widget.CheckedTextView)` |   |
| `https://developer.android.com/reference/androidx/core/graphics/drawable/DrawableCompat#setTintMode(android.graphics.drawable.Drawable,android.graphics.PorterDuff.Mode)` |   |