package n;

import N1.C0198b;
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.widget.ImageView;

/* JADX INFO: renamed from: n.u, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C1237u extends ImageView {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final C0198b f14942q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final A1.H f14943r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public boolean f14944s;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1237u(Context context, int i) {
        super(context, null, i);
        H0.a(context);
        this.f14944s = false;
        G0.a(this, getContext());
        C0198b c0198b = new C0198b(this);
        this.f14942q = c0198b;
        c0198b.n(null, i);
        A1.H h8 = new A1.H(this);
        this.f14943r = h8;
        h8.j(null, i);
    }

    @Override // android.widget.ImageView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            c0198b.b();
        }
        A1.H h8 = this.f14943r;
        if (h8 != null) {
            h8.b();
        }
    }

    public ColorStateList getSupportBackgroundTintList() {
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            return c0198b.k();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            return c0198b.l();
        }
        return null;
    }

    public ColorStateList getSupportImageTintList() {
        k7.i iVar;
        A1.H h8 = this.f14943r;
        if (h8 == null || (iVar = (k7.i) h8.f67t) == null) {
            return null;
        }
        return (ColorStateList) iVar.f14082c;
    }

    public PorterDuff.Mode getSupportImageTintMode() {
        k7.i iVar;
        A1.H h8 = this.f14943r;
        if (h8 == null || (iVar = (k7.i) h8.f67t) == null) {
            return null;
        }
        return (PorterDuff.Mode) iVar.f14083d;
    }

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

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            c0198b.p();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            c0198b.q(i);
        }
    }

    @Override // android.widget.ImageView
    public void setImageBitmap(Bitmap bitmap) {
        super.setImageBitmap(bitmap);
        A1.H h8 = this.f14943r;
        if (h8 != null) {
            h8.b();
        }
    }

    @Override // android.widget.ImageView
    public void setImageDrawable(Drawable drawable) {
        A1.H h8 = this.f14943r;
        if (h8 != null && drawable != null && !this.f14944s) {
            h8.f65r = drawable.getLevel();
        }
        super.setImageDrawable(drawable);
        if (h8 != null) {
            h8.b();
            if (this.f14944s) {
                return;
            }
            ImageView imageView = (ImageView) h8.f66s;
            if (imageView.getDrawable() != null) {
                imageView.getDrawable().setLevel(h8.f65r);
            }
        }
    }

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

    @Override // android.widget.ImageView
    public void setImageResource(int i) {
        A1.H h8 = this.f14943r;
        if (h8 != null) {
            ImageView imageView = (ImageView) h8.f66s;
            if (i != 0) {
                Drawable drawableL = android.support.v4.media.session.a.l(imageView.getContext(), i);
                if (drawableL != null) {
                    S.a(drawableL);
                }
                imageView.setImageDrawable(drawableL);
            } else {
                imageView.setImageDrawable(null);
            }
            h8.b();
        }
    }

    @Override // android.widget.ImageView
    public void setImageURI(Uri uri) {
        super.setImageURI(uri);
        A1.H h8 = this.f14943r;
        if (h8 != null) {
            h8.b();
        }
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            c0198b.v(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C0198b c0198b = this.f14942q;
        if (c0198b != null) {
            c0198b.w(mode);
        }
    }

    public void setSupportImageTintList(ColorStateList colorStateList) {
        A1.H h8 = this.f14943r;
        if (h8 != null) {
            if (((k7.i) h8.f67t) == null) {
                h8.f67t = new k7.i();
            }
            k7.i iVar = (k7.i) h8.f67t;
            iVar.f14082c = colorStateList;
            iVar.f14081b = true;
            h8.b();
        }
    }

    public void setSupportImageTintMode(PorterDuff.Mode mode) {
        A1.H h8 = this.f14943r;
        if (h8 != null) {
            if (((k7.i) h8.f67t) == null) {
                h8.f67t = new k7.i();
            }
            k7.i iVar = (k7.i) h8.f67t;
            iVar.f14083d = mode;
            iVar.f14080a = true;
            h8.b();
        }
    }
}
