Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ImageViewCompat

open class ImageViewCompat
kotlin.Any
   ↳ androidx.core.widget.ImageViewCompat

Helper for accessing features in ImageView.

Summary

Public methods

open static ColorStateList?
getImageTintList(@NonNull view: ImageView)

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

open static Mode?
getImageTintMode(@NonNull view: ImageView)

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

open static Unit
setImageTintList(@NonNull view: ImageView, @Nullable tintList: ColorStateList?)

Applies a tint to the image drawable.

open static Unit
setImageTintMode(@NonNull view: ImageView, @Nullable mode: Mode?)

Specifies the blending mode used to apply the tint specified by setImageTintList(android.widget.ImageView, android.content.res.ColorStateList) to the image drawable.

Public methods

getImageTintList

@Nullable open static fun getImageTintList(@NonNull view: ImageView): ColorStateList?

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

getImageTintMode

@Nullable open static fun getImageTintMode(@NonNull view: ImageView): Mode?

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

setImageTintList

open static fun setImageTintList(@NonNull view: ImageView, @Nullable tintList: ColorStateList?): Unit

Applies a tint to the image drawable.

setImageTintMode

open static fun setImageTintMode(@NonNull view: ImageView, @Nullable mode: Mode?): Unit

Specifies the blending mode used to apply the tint specified by setImageTintList(android.widget.ImageView, android.content.res.ColorStateList) to the image drawable. The default mode is PorterDuff.Mode#SRC_IN.