187 lines
5.0 KiB
Java
187 lines
5.0 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 o.WpN;
|
||
|
import o.ZzE;
|
||
|
import o.nKv;
|
||
|
import o.zwp;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public class AppCompatImageView extends ImageView {
|
||
|
private final WpN mBackgroundTintHelper;
|
||
|
private boolean mHasLevel;
|
||
|
private final zwp mImageHelper;
|
||
|
|
||
|
public AppCompatImageView(Context context) {
|
||
|
this(context, null);
|
||
|
}
|
||
|
|
||
|
public AppCompatImageView(Context context, AttributeSet attributeSet) {
|
||
|
this(context, attributeSet, 0);
|
||
|
}
|
||
|
|
||
|
public AppCompatImageView(Context context, AttributeSet attributeSet, int i) {
|
||
|
super(ZzE.b(context), attributeSet, i);
|
||
|
this.mHasLevel = false;
|
||
|
nKv.b(getContext());
|
||
|
WpN wpN = new WpN(this);
|
||
|
this.mBackgroundTintHelper = wpN;
|
||
|
wpN.fy_(attributeSet, i);
|
||
|
zwp zwpVar = new zwp(this);
|
||
|
this.mImageHelper = zwpVar;
|
||
|
zwpVar.gs_(attributeSet, i);
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView
|
||
|
public void setImageResource(int i) {
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
zwpVar.a(i);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView
|
||
|
public void setImageDrawable(Drawable drawable) {
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null && drawable != null && !this.mHasLevel) {
|
||
|
zwpVar.gt_(drawable);
|
||
|
}
|
||
|
super.setImageDrawable(drawable);
|
||
|
zwp zwpVar2 = this.mImageHelper;
|
||
|
if (zwpVar2 != null) {
|
||
|
zwpVar2.e();
|
||
|
if (this.mHasLevel) {
|
||
|
return;
|
||
|
}
|
||
|
this.mImageHelper.b();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView
|
||
|
public void setImageBitmap(Bitmap bitmap) {
|
||
|
super.setImageBitmap(bitmap);
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
zwpVar.e();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView
|
||
|
public void setImageURI(Uri uri) {
|
||
|
super.setImageURI(uri);
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
zwpVar.e();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void setBackgroundResource(int i) {
|
||
|
super.setBackgroundResource(i);
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
wpN.c(i);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void setBackgroundDrawable(Drawable drawable) {
|
||
|
super.setBackgroundDrawable(drawable);
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
wpN.fz_(drawable);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
wpN.fB_(colorStateList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public ColorStateList getSupportBackgroundTintList() {
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
return wpN.fw_();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
wpN.fC_(mode);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
return wpN.fx_();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public void setSupportImageTintList(ColorStateList colorStateList) {
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
zwpVar.gu_(colorStateList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public ColorStateList getSupportImageTintList() {
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
return zwpVar.gq_();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public void setSupportImageTintMode(PorterDuff.Mode mode) {
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
zwpVar.gv_(mode);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public PorterDuff.Mode getSupportImageTintMode() {
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
return zwpVar.gr_();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView, android.view.View
|
||
|
protected void drawableStateChanged() {
|
||
|
super.drawableStateChanged();
|
||
|
WpN wpN = this.mBackgroundTintHelper;
|
||
|
if (wpN != null) {
|
||
|
wpN.a();
|
||
|
}
|
||
|
zwp zwpVar = this.mImageHelper;
|
||
|
if (zwpVar != null) {
|
||
|
zwpVar.e();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView, android.view.View
|
||
|
public boolean hasOverlappingRendering() {
|
||
|
return this.mImageHelper.a() && super.hasOverlappingRendering();
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.ImageView
|
||
|
public void setImageLevel(int i) {
|
||
|
super.setImageLevel(i);
|
||
|
this.mHasLevel = true;
|
||
|
}
|
||
|
}
|