jimu-decompiled/sources/androidx/appcompat/widget/AppCompatImageView.java
2025-05-13 19:24:51 +02:00

174 lines
5.9 KiB
Java

package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.widget.ImageView;
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.TintableImageSourceView;
/* loaded from: classes.dex */
public class AppCompatImageView extends ImageView implements TintableBackgroundView, TintableImageSourceView {
private final AppCompatBackgroundHelper a;
private final AppCompatImageHelper b;
public AppCompatImageView(Context context) {
this(context, null);
}
@Override // android.widget.ImageView, android.view.View
protected void drawableStateChanged() {
super.drawableStateChanged();
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.a();
}
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // androidx.core.view.TintableBackgroundView
public ColorStateList getSupportBackgroundTintList() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.b();
}
return null;
}
@Override // androidx.core.view.TintableBackgroundView
public PorterDuff.Mode getSupportBackgroundTintMode() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.c();
}
return null;
}
@Override // androidx.core.widget.TintableImageSourceView
public ColorStateList getSupportImageTintList() {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
return appCompatImageHelper.b();
}
return null;
}
@Override // androidx.core.widget.TintableImageSourceView
public PorterDuff.Mode getSupportImageTintMode() {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
return appCompatImageHelper.c();
}
return null;
}
@Override // android.widget.ImageView, android.view.View
public boolean hasOverlappingRendering() {
return this.b.d() && super.hasOverlappingRendering();
}
@Override // android.view.View
public void setBackgroundDrawable(Drawable drawable) {
super.setBackgroundDrawable(drawable);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.a(drawable);
}
}
@Override // android.view.View
public void setBackgroundResource(int i) {
super.setBackgroundResource(i);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.a(i);
}
}
@Override // android.widget.ImageView
public void setImageBitmap(Bitmap bitmap) {
super.setImageBitmap(bitmap);
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // android.widget.ImageView
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // android.widget.ImageView
public void setImageResource(int i) {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a(i);
}
}
@Override // android.widget.ImageView
public void setImageURI(Uri uri) {
super.setImageURI(uri);
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // androidx.core.view.TintableBackgroundView
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.b(colorStateList);
}
}
@Override // androidx.core.view.TintableBackgroundView
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.a;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.a(mode);
}
}
@Override // androidx.core.widget.TintableImageSourceView
public void setSupportImageTintList(ColorStateList colorStateList) {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a(colorStateList);
}
}
@Override // androidx.core.widget.TintableImageSourceView
public void setSupportImageTintMode(PorterDuff.Mode mode) {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a(mode);
}
}
public AppCompatImageView(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public AppCompatImageView(Context context, AttributeSet attributeSet, int i) {
super(TintContextWrapper.b(context), attributeSet, i);
this.a = new AppCompatBackgroundHelper(this);
this.a.a(attributeSet, i);
this.b = new AppCompatImageHelper(this);
this.b.a(attributeSet, i);
}
}