package IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0.PGPF6hQ_2.QxJ9d_1;

import IMuAHx_6.Mqv2r_3.KQgRr5e_0.QxJ9d_1.FSaI4_7.PGPF6hQ_2;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.Region;
import java.util.ArrayList;
import java.util.List;
/* compiled from: PathsDrawable.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends PGPF6hQ_2 {
    public static final Region KQgRr5e_0 = new Region();
    public static final Region QxJ9d_1 = new Region(X6FRs_4.Xgtqvk_8.KQgRr5e_0.KQgRr5e_0.INVALID_ID, X6FRs_4.Xgtqvk_8.KQgRr5e_0.KQgRr5e_0.INVALID_ID, Integer.MAX_VALUE, Integer.MAX_VALUE);

    /* renamed from: IFxWkV_5  reason: collision with root package name */
    public int f3074IFxWkV_5;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Bitmap f241KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public List<Path> f242KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public boolean f243KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with other field name */
    public List<String> f244Mqv2r_3;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public List<Path> f245PGPF6hQ_2;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public List<Integer> f247QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public int f3076X6FRs_4;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public int f240KQgRr5e_0 = 1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public int f246QxJ9d_1 = 1;
    public int PGPF6hQ_2 = 0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public int f3075Mqv2r_3 = 0;

    public boolean KQgRr5e_0() {
        Integer num;
        Integer num2;
        Integer num3;
        int i;
        List<Path> list = this.f242KQgRr5e_0;
        Integer num4 = null;
        if (list != null) {
            Integer num5 = null;
            num2 = null;
            num3 = null;
            for (Path path : list) {
                KQgRr5e_0.setPath(path, QxJ9d_1);
                Rect bounds = KQgRr5e_0.getBounds();
                num4 = Integer.valueOf(Math.min(num4 == null ? bounds.top : num4.intValue(), bounds.top));
                num5 = Integer.valueOf(Math.min(num5 == null ? bounds.left : num5.intValue(), bounds.left));
                num2 = Integer.valueOf(Math.max(num2 == null ? bounds.right : num2.intValue(), bounds.right));
                num3 = Integer.valueOf(Math.max(num3 == null ? bounds.bottom : num3.intValue(), bounds.bottom));
            }
            num = num4;
            num4 = num5;
        } else {
            num = null;
            num2 = null;
            num3 = null;
        }
        this.PGPF6hQ_2 = num4 == null ? 0 : num4.intValue();
        this.f3075Mqv2r_3 = num == null ? 0 : num.intValue();
        this.f240KQgRr5e_0 = num2 == null ? 0 : num2.intValue() - this.PGPF6hQ_2;
        this.f246QxJ9d_1 = num3 == null ? 0 : num3.intValue() - this.f3075Mqv2r_3;
        if (this.f3076X6FRs_4 == 0) {
            this.f3076X6FRs_4 = this.f240KQgRr5e_0;
        }
        if (this.f3074IFxWkV_5 == 0) {
            this.f3074IFxWkV_5 = this.f246QxJ9d_1;
        }
        Rect bounds2 = getBounds();
        int i2 = this.f240KQgRr5e_0;
        if (i2 != 0 && (i = this.f246QxJ9d_1) != 0) {
            int i3 = bounds2.left;
            int i4 = bounds2.top;
            super.setBounds(i3, i4, i2 + i3, i + i4);
            return true;
        }
        if (this.f3076X6FRs_4 == 0) {
            this.f3076X6FRs_4 = 1;
        }
        if (this.f3074IFxWkV_5 == 0) {
            this.f3074IFxWkV_5 = 1;
        }
        this.f246QxJ9d_1 = 1;
        this.f240KQgRr5e_0 = 1;
        return false;
    }

    public void PGPF6hQ_2(int i) {
        Rect bounds = getBounds();
        float width = (i * 1.0f) / bounds.width();
        setBounds((int) (bounds.left * width), (int) (bounds.top * width), (int) (bounds.right * width), (int) (bounds.bottom * width));
    }

    public void QxJ9d_1(int i) {
        Rect bounds = getBounds();
        float height = (i * 1.0f) / bounds.height();
        setBounds((int) (bounds.left * height), (int) (bounds.top * height), (int) (bounds.right * height), (int) (bounds.bottom * height));
    }

    @Override // android.graphics.drawable.Drawable
    public void draw(Canvas canvas) {
        Rect bounds = getBounds();
        int width = bounds.width();
        int height = bounds.height();
        if (((PGPF6hQ_2) this).KQgRr5e_0.getAlpha() == 255) {
            canvas.save();
            canvas.translate(bounds.left - this.PGPF6hQ_2, bounds.top - this.f3075Mqv2r_3);
            if (this.f242KQgRr5e_0 != null) {
                for (int i = 0; i < this.f242KQgRr5e_0.size(); i++) {
                    List<Integer> list = this.f247QxJ9d_1;
                    if (list != null && i < list.size()) {
                        ((PGPF6hQ_2) this).KQgRr5e_0.setColor(this.f247QxJ9d_1.get(i).intValue());
                    }
                    canvas.drawPath(this.f242KQgRr5e_0.get(i), ((PGPF6hQ_2) this).KQgRr5e_0);
                }
                ((PGPF6hQ_2) this).KQgRr5e_0.setAlpha(255);
            }
            canvas.restore();
            return;
        }
        KQgRr5e_0(width, height);
        if (this.f243KQgRr5e_0) {
            this.f241KQgRr5e_0.eraseColor(0);
            KQgRr5e_0(new Canvas(this.f241KQgRr5e_0));
            this.f243KQgRr5e_0 = false;
        }
        canvas.drawBitmap(this.f241KQgRr5e_0, bounds.left, bounds.top, ((PGPF6hQ_2) this).KQgRr5e_0);
    }

    @Override // android.graphics.drawable.Drawable
    public void setBounds(int i, int i2, int i3, int i4) {
        int i5 = i3 - i;
        int i6 = i4 - i2;
        List<Path> list = this.f245PGPF6hQ_2;
        if (list != null && list.size() > 0 && (i5 != this.f240KQgRr5e_0 || i6 != this.f246QxJ9d_1)) {
            int i7 = this.PGPF6hQ_2;
            int i8 = this.f3075Mqv2r_3;
            float f = i5;
            float f2 = i6;
            this.f242KQgRr5e_0 = KQgRr5e_0.KQgRr5e_0((f * 1.0f) / this.f3076X6FRs_4, (f2 * 1.0f) / this.f3074IFxWkV_5, this.f245PGPF6hQ_2, this.f244Mqv2r_3);
            if (KQgRr5e_0()) {
                return;
            }
            this.f240KQgRr5e_0 = i5;
            this.f246QxJ9d_1 = i6;
            this.PGPF6hQ_2 = (int) (((i7 * 1.0f) * f) / this.f3076X6FRs_4);
            this.f3075Mqv2r_3 = (int) (((i8 * 1.0f) * f2) / this.f3074IFxWkV_5);
            super.setBounds(i, i2, i3, i4);
            return;
        }
        super.setBounds(i, i2, i3, i4);
    }

    @Override // android.graphics.drawable.Drawable
    public void setBounds(Rect rect) {
        setBounds(rect.left, rect.top, rect.right, rect.bottom);
    }

    public boolean KQgRr5e_0(String... strArr) {
        this.f3074IFxWkV_5 = 0;
        this.f3076X6FRs_4 = 0;
        this.f244Mqv2r_3 = new ArrayList();
        ArrayList arrayList = new ArrayList();
        this.f245PGPF6hQ_2 = arrayList;
        this.f242KQgRr5e_0 = arrayList;
        for (String str : strArr) {
            this.f244Mqv2r_3.add(str);
            this.f245PGPF6hQ_2.add(KQgRr5e_0.KQgRr5e_0(str));
        }
        return KQgRr5e_0();
    }

    public void KQgRr5e_0(int i, int i2, int i3, int i4) {
        this.PGPF6hQ_2 = i;
        this.f3075Mqv2r_3 = i2;
        this.f240KQgRr5e_0 = i3;
        this.f3076X6FRs_4 = i3;
        this.f246QxJ9d_1 = i4;
        this.f3074IFxWkV_5 = i4;
        Rect bounds = getBounds();
        int i5 = bounds.left;
        int i6 = bounds.top;
        super.setBounds(i5, i6, i3 + i5, i4 + i6);
    }

    public void KQgRr5e_0(int... iArr) {
        this.f247QxJ9d_1 = new ArrayList();
        for (int i : iArr) {
            this.f247QxJ9d_1.add(Integer.valueOf(i));
        }
    }

    public final void KQgRr5e_0(Canvas canvas) {
        canvas.translate(-this.PGPF6hQ_2, -this.f3075Mqv2r_3);
        if (this.f242KQgRr5e_0 != null) {
            for (int i = 0; i < this.f242KQgRr5e_0.size(); i++) {
                List<Integer> list = this.f247QxJ9d_1;
                if (list != null && i < list.size()) {
                    ((PGPF6hQ_2) this).KQgRr5e_0.setColor(this.f247QxJ9d_1.get(i).intValue());
                }
                canvas.drawPath(this.f242KQgRr5e_0.get(i), ((PGPF6hQ_2) this).KQgRr5e_0);
            }
        }
    }

    public final void KQgRr5e_0(int i, int i2) {
        Bitmap bitmap = this.f241KQgRr5e_0;
        if (bitmap != null && i == bitmap.getWidth() && i2 == this.f241KQgRr5e_0.getHeight()) {
            return;
        }
        this.f241KQgRr5e_0 = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
        this.f243KQgRr5e_0 = true;
    }
}
