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.AbstractC1991;
import defpackage.AbstractC3247;
import defpackage.C1611;
import defpackage.C1894;
import defpackage.C4782;

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

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final C4782 f151;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final C1611 f152;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public boolean 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.f153 = false;
        AbstractC3247.m7608(getContext(), this);
        C1611 c1611 = new C1611(this);
        this.f152 = c1611;
        c1611.m4617(attributeSet, i);
        C4782 c4782 = new C4782(this);
        this.f151 = c4782;
        c4782.m10092(attributeSet, i);
    }

    @Override // android.widget.ImageView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            c1611.m4619();
        }
        C4782 c4782 = this.f151;
        if (c4782 != null) {
            c4782.m10091();
        }
    }

    public ColorStateList getSupportBackgroundTintList() {
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            return c1611.m4620();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            return c1611.m4622();
        }
        return null;
    }

    public ColorStateList getSupportImageTintList() {
        C1894 c1894;
        C4782 c4782 = this.f151;
        if (c4782 == null || (c1894 = (C1894) c4782.f17767) == null) {
            return null;
        }
        return (ColorStateList) c1894.f7628;
    }

    public PorterDuff.Mode getSupportImageTintMode() {
        C1894 c1894;
        C4782 c4782 = this.f151;
        if (c4782 == null || (c1894 = (C1894) c4782.f17767) == null) {
            return null;
        }
        return (PorterDuff.Mode) c1894.f7631;
    }

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

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            c1611.m4618();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            c1611.m4602(i);
        }
    }

    @Override // android.widget.ImageView
    public void setImageBitmap(Bitmap bitmap) {
        super.setImageBitmap(bitmap);
        C4782 c4782 = this.f151;
        if (c4782 != null) {
            c4782.m10091();
        }
    }

    @Override // android.widget.ImageView
    public void setImageDrawable(Drawable drawable) {
        C4782 c4782 = this.f151;
        if (c4782 != null && drawable != null && !this.f153) {
            c4782.f17765 = drawable.getLevel();
        }
        super.setImageDrawable(drawable);
        if (c4782 != null) {
            c4782.m10091();
            if (this.f153) {
                return;
            }
            ImageView imageView = (ImageView) c4782.f17768;
            if (imageView.getDrawable() != null) {
                imageView.getDrawable().setLevel(c4782.f17765);
            }
        }
    }

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

    @Override // android.widget.ImageView
    public void setImageResource(int i) {
        C4782 c4782 = this.f151;
        if (c4782 != null) {
            ImageView imageView = (ImageView) c4782.f17768;
            if (i != 0) {
                Drawable drawable = ᵕˏᵛ.ˑᵥˁ(imageView.getContext(), i);
                if (drawable != null) {
                    AbstractC1991.m5513(drawable);
                }
                imageView.setImageDrawable(drawable);
            } else {
                imageView.setImageDrawable(null);
            }
            c4782.m10091();
        }
    }

    @Override // android.widget.ImageView
    public void setImageURI(Uri uri) {
        super.setImageURI(uri);
        C4782 c4782 = this.f151;
        if (c4782 != null) {
            c4782.m10091();
        }
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            c1611.m4611(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C1611 c1611 = this.f152;
        if (c1611 != null) {
            c1611.m4626(mode);
        }
    }

    public void setSupportImageTintList(ColorStateList colorStateList) {
        C4782 c4782 = this.f151;
        if (c4782 != null) {
            if (((C1894) c4782.f17767) == null) {
                c4782.f17767 = new C1894();
            }
            C1894 c1894 = (C1894) c4782.f17767;
            c1894.f7628 = colorStateList;
            c1894.f7630 = true;
            c4782.m10091();
        }
    }

    public void setSupportImageTintMode(PorterDuff.Mode mode) {
        C4782 c4782 = this.f151;
        if (c4782 != null) {
            if (((C1894) c4782.f17767) == null) {
                c4782.f17767 = new C1894();
            }
            C1894 c1894 = (C1894) c4782.f17767;
            c1894.f7631 = mode;
            c1894.f7629 = true;
            c4782.m10091();
        }
    }
}
