package IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.Mqv2r_3;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.widget.ImageView;
/* compiled from: CircleImageView.java */
@SuppressLint({"ViewConstructor"})
/* loaded from: classes.dex */
public class KQgRr5e_0 extends ImageView {
    public int KQgRr5e_0;

    /* compiled from: CircleImageView.java */
    /* renamed from: IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.Mqv2r_3.KQgRr5e_0$KQgRr5e_0  reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public class C0013KQgRr5e_0 extends OvalShape {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public Paint f212KQgRr5e_0 = new Paint();

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public RadialGradient f213KQgRr5e_0;

        public C0013KQgRr5e_0(int i) {
            KQgRr5e_0.this.KQgRr5e_0 = i;
            KQgRr5e_0((int) super.rect().width());
        }

        public final void KQgRr5e_0(int i) {
            float f = i / 2.0f;
            RadialGradient radialGradient = new RadialGradient(f, f, KQgRr5e_0.this.KQgRr5e_0, new int[]{1023410176, 0}, (float[]) null, Shader.TileMode.CLAMP);
            this.f213KQgRr5e_0 = radialGradient;
            this.f212KQgRr5e_0.setShader(radialGradient);
        }

        @Override // android.graphics.drawable.shapes.OvalShape, android.graphics.drawable.shapes.RectShape, android.graphics.drawable.shapes.Shape
        public void draw(Canvas canvas, Paint paint) {
            KQgRr5e_0 kQgRr5e_0 = KQgRr5e_0.this;
            float width = kQgRr5e_0.getWidth() / 2.0f;
            float height = kQgRr5e_0.getHeight() / 2.0f;
            canvas.drawCircle(width, height, width, this.f212KQgRr5e_0);
            canvas.drawCircle(width, height, width - KQgRr5e_0.this.KQgRr5e_0, paint);
        }

        @Override // android.graphics.drawable.shapes.RectShape, android.graphics.drawable.shapes.Shape
        public void onResize(float f, float f2) {
            super.onResize(f, f2);
            KQgRr5e_0((int) f);
        }
    }

    public KQgRr5e_0(Context context, int i) {
        super(context);
        ShapeDrawable shapeDrawable;
        float f = getResources().getDisplayMetrics().density;
        int i2 = (int) (1.75f * f);
        int i3 = (int) (0.0f * f);
        this.KQgRr5e_0 = (int) (3.5f * f);
        if (Build.VERSION.SDK_INT >= 21) {
            shapeDrawable = new ShapeDrawable(new OvalShape());
            setElevation(f * 4.0f);
        } else {
            ShapeDrawable shapeDrawable2 = new ShapeDrawable(new C0013KQgRr5e_0(this.KQgRr5e_0));
            setLayerType(1, shapeDrawable2.getPaint());
            shapeDrawable2.getPaint().setShadowLayer(this.KQgRr5e_0, i3, i2, 503316480);
            int i4 = this.KQgRr5e_0;
            setPadding(i4, i4, i4, i4);
            shapeDrawable = shapeDrawable2;
        }
        shapeDrawable.getPaint().setColor(i);
        if (Build.VERSION.SDK_INT >= 16) {
            setBackground(shapeDrawable);
        } else {
            setBackgroundDrawable(shapeDrawable);
        }
    }

    @Override // android.widget.ImageView, android.view.View
    public void onMeasure(int i, int i2) {
        super.onMeasure(i, i2);
        if (Build.VERSION.SDK_INT < 21) {
            super.setMeasuredDimension(getMeasuredWidth() + (this.KQgRr5e_0 * 2), getMeasuredHeight() + (this.KQgRr5e_0 * 2));
        }
    }
}
