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.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.widget.ImageView;
import defpackage.AbstractC0912;
import defpackage.AbstractC2340;
import defpackage.C1404;
import defpackage.C2531;
import defpackage.C4132;

/* JADX INFO: loaded from: classes3.dex */
public class AppCompatImageView extends ImageView {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final C4132 f151;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public boolean f152;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C1404 f153;

    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(context, attributeSet, i);
        this.f152 = false;
        AbstractC2340.m6017(getContext(), this);
        C4132 c4132 = new C4132(this);
        this.f151 = c4132;
        c4132.m9047(attributeSet, i);
        C1404 c1404 = new C1404(this);
        this.f153 = c1404;
        c1404.m4033(attributeSet, i);
    }

    @Override // android.widget.ImageView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            c4132.m9036();
        }
        C1404 c1404 = this.f153;
        if (c1404 != null) {
            c1404.m4026();
        }
    }

    public ColorStateList getSupportBackgroundTintList() {
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            return c4132.m9055();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            return c4132.m9058();
        }
        return null;
    }

    public ColorStateList getSupportImageTintList() {
        C2531 c2531;
        C1404 c1404 = this.f153;
        if (c1404 == null || (c2531 = (C2531) c1404.f5809) == null) {
            return null;
        }
        return (ColorStateList) c2531.f9796;
    }

    public PorterDuff.Mode getSupportImageTintMode() {
        C2531 c2531;
        C1404 c1404 = this.f153;
        if (c1404 == null || (c2531 = (C2531) c1404.f5809) == null) {
            return null;
        }
        return (PorterDuff.Mode) c2531.f9798;
    }

    @Override // android.widget.ImageView, android.view.View
    public final boolean hasOverlappingRendering() {
        return !(((ImageView) this.f153.f5807).getBackground() instanceof RippleDrawable) && super.hasOverlappingRendering();
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            c4132.m9051();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            c4132.m9048(i);
        }
    }

    @Override // android.widget.ImageView
    public void setImageBitmap(Bitmap bitmap) {
        super.setImageBitmap(bitmap);
        C1404 c1404 = this.f153;
        if (c1404 != null) {
            c1404.m4026();
        }
    }

    @Override // android.widget.ImageView
    public void setImageDrawable(Drawable drawable) {
        C1404 c1404 = this.f153;
        if (c1404 != null && drawable != null && !this.f152) {
            c1404.f5808 = drawable.getLevel();
        }
        super.setImageDrawable(drawable);
        if (c1404 != null) {
            c1404.m4026();
            if (this.f152) {
                return;
            }
            ImageView imageView = (ImageView) c1404.f5807;
            if (imageView.getDrawable() != null) {
                imageView.getDrawable().setLevel(c1404.f5808);
            }
        }
    }

    @Override // android.widget.ImageView
    public void setImageLevel(int i) {
        super.setImageLevel(i);
        this.f152 = true;
    }

    @Override // android.widget.ImageView
    public void setImageResource(int i) {
        C1404 c1404 = this.f153;
        if (c1404 != null) {
            ImageView imageView = (ImageView) c1404.f5807;
            if (i != 0) {
                Drawable drawable = ᵥˇᵛˎ.ᵶˇᵱ(imageView.getContext(), i);
                if (drawable != null) {
                    AbstractC0912.m3160(drawable);
                }
                imageView.setImageDrawable(drawable);
            } else {
                imageView.setImageDrawable(null);
            }
            c1404.m4026();
        }
    }

    @Override // android.widget.ImageView
    public void setImageURI(Uri uri) {
        super.setImageURI(uri);
        C1404 c1404 = this.f153;
        if (c1404 != null) {
            c1404.m4026();
        }
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            c4132.m9046(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C4132 c4132 = this.f151;
        if (c4132 != null) {
            c4132.m9045(mode);
        }
    }

    public void setSupportImageTintList(ColorStateList colorStateList) {
        C1404 c1404 = this.f153;
        if (c1404 != null) {
            if (((C2531) c1404.f5809) == null) {
                c1404.f5809 = new C2531();
            }
            C2531 c2531 = (C2531) c1404.f5809;
            c2531.f9796 = colorStateList;
            c2531.f9795 = true;
            c1404.m4026();
        }
    }

    public void setSupportImageTintMode(PorterDuff.Mode mode) {
        C1404 c1404 = this.f153;
        if (c1404 != null) {
            if (((C2531) c1404.f5809) == null) {
                c1404.f5809 = new C2531();
            }
            C2531 c2531 = (C2531) c1404.f5809;
            c2531.f9798 = mode;
            c2531.f9797 = true;
            c1404.m4026();
        }
    }
}
