79 lines
2.9 KiB
Java
79 lines
2.9 KiB
Java
package androidx.core.widget;
|
|
|
|
import android.content.res.ColorStateList;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.os.Build;
|
|
import android.widget.ImageView;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ImageViewCompat {
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static ColorStateList a(ImageView imageView) {
|
|
if (Build.VERSION.SDK_INT >= 21) {
|
|
return imageView.getImageTintList();
|
|
}
|
|
if (imageView instanceof TintableImageSourceView) {
|
|
return ((TintableImageSourceView) imageView).getSupportImageTintList();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static PorterDuff.Mode b(ImageView imageView) {
|
|
if (Build.VERSION.SDK_INT >= 21) {
|
|
return imageView.getImageTintMode();
|
|
}
|
|
if (imageView instanceof TintableImageSourceView) {
|
|
return ((TintableImageSourceView) imageView).getSupportImageTintMode();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static void a(ImageView imageView, ColorStateList colorStateList) {
|
|
if (Build.VERSION.SDK_INT >= 21) {
|
|
imageView.setImageTintList(colorStateList);
|
|
if (Build.VERSION.SDK_INT == 21) {
|
|
Drawable drawable = imageView.getDrawable();
|
|
boolean z = (imageView.getImageTintList() == null || imageView.getImageTintMode() == null) ? false : true;
|
|
if (drawable == null || !z) {
|
|
return;
|
|
}
|
|
if (drawable.isStateful()) {
|
|
drawable.setState(imageView.getDrawableState());
|
|
}
|
|
imageView.setImageDrawable(drawable);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (imageView instanceof TintableImageSourceView) {
|
|
((TintableImageSourceView) imageView).setSupportImageTintList(colorStateList);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static void a(ImageView imageView, PorterDuff.Mode mode) {
|
|
if (Build.VERSION.SDK_INT >= 21) {
|
|
imageView.setImageTintMode(mode);
|
|
if (Build.VERSION.SDK_INT == 21) {
|
|
Drawable drawable = imageView.getDrawable();
|
|
boolean z = (imageView.getImageTintList() == null || imageView.getImageTintMode() == null) ? false : true;
|
|
if (drawable == null || !z) {
|
|
return;
|
|
}
|
|
if (drawable.isStateful()) {
|
|
drawable.setState(imageView.getDrawableState());
|
|
}
|
|
imageView.setImageDrawable(drawable);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (imageView instanceof TintableImageSourceView) {
|
|
((TintableImageSourceView) imageView).setSupportImageTintMode(mode);
|
|
}
|
|
}
|
|
}
|