# ImageViewCompat

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

*** ** * ** ***


```
public class ImageViewCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/widget/ImageView.html`.

## Summary

| ### Public methods |
|---|---|
| `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/ImageViewCompat#getImageTintList(android.widget.ImageView)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ImageView.html view)` Return the tint applied to the image drawable, if specified. |
| `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/ImageViewCompat#getImageTintMode(android.widget.ImageView)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ImageView.html view)` Return the blending mode used to apply the tint to the image drawable, if specified. |
| `static void` | `https://developer.android.com/reference/androidx/core/widget/ImageViewCompat#setImageTintList(android.widget.ImageView,android.content.res.ColorStateList)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ImageView.html view, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/res/ColorStateList.html tintList )` Applies a tint to the image drawable. |
| `static void` | `https://developer.android.com/reference/androidx/core/widget/ImageViewCompat#setImageTintMode(android.widget.ImageView,android.graphics.PorterDuff.Mode)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ImageView.html view, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html mode)` Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/androidx/core/widget/ImageViewCompat#setImageTintList(android.widget.ImageView,android.content.res.ColorStateList)` to the image drawable. |

## Public methods

### getImageTintList

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

```
public static @Nullable ColorStateList getImageTintList(@NonNull ImageView view)
```

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

### getImageTintMode

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

```
public static @Nullable PorterDuff.Mode getImageTintMode(@NonNull ImageView view)
```

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

### setImageTintList

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

```
public static void setImageTintList(
    @NonNull ImageView view,
    @Nullable ColorStateList tintList
)
```

Applies a tint to the image drawable.

### setImageTintMode

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

```
public static void setImageTintMode(@NonNull ImageView view, @Nullable PorterDuff.Mode mode)
```

Specifies the blending mode used to apply the tint specified by `https://developer.android.com/reference/androidx/core/widget/ImageViewCompat#setImageTintList(android.widget.ImageView,android.content.res.ColorStateList)` to the image drawable. The default mode is `https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html#SRC_IN`.