package X6FRs_4.KQgRr5e_0.EuDEkJe_12.KQgRr5e_0;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.SystemClock;
import android.util.SparseArray;
/* compiled from: DrawableContainer.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends Drawable implements Drawable.Callback {

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public long f623KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public PGPF6hQ_2 f624KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public C0054QxJ9d_1 f625KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Rect f626KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Drawable f627KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Runnable f628KQgRr5e_0;
    public boolean PGPF6hQ_2;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public long f629QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public Drawable f630QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public boolean f631QxJ9d_1;
    public int KQgRr5e_0 = 255;
    public int QxJ9d_1 = -1;

    /* compiled from: DrawableContainer.java */
    /* loaded from: classes.dex */
    public class KQgRr5e_0 implements Runnable {
        public KQgRr5e_0() {
        }

        @Override // java.lang.Runnable
        public void run() {
            QxJ9d_1.this.KQgRr5e_0(true);
            QxJ9d_1.this.invalidateSelf();
        }
    }

    /* compiled from: DrawableContainer.java */
    /* renamed from: X6FRs_4.KQgRr5e_0.EuDEkJe_12.KQgRr5e_0.QxJ9d_1$QxJ9d_1  reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public static class C0054QxJ9d_1 implements Drawable.Callback {
        public Drawable.Callback KQgRr5e_0;

        public C0054QxJ9d_1 KQgRr5e_0(Drawable.Callback callback) {
            this.KQgRr5e_0 = callback;
            return this;
        }

        @Override // android.graphics.drawable.Drawable.Callback
        public void invalidateDrawable(Drawable drawable) {
        }

        @Override // android.graphics.drawable.Drawable.Callback
        public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
            Drawable.Callback callback = this.KQgRr5e_0;
            if (callback != null) {
                callback.scheduleDrawable(drawable, runnable, j);
            }
        }

        @Override // android.graphics.drawable.Drawable.Callback
        public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
            Drawable.Callback callback = this.KQgRr5e_0;
            if (callback != null) {
                callback.unscheduleDrawable(drawable, runnable);
            }
        }

        public Drawable.Callback KQgRr5e_0() {
            Drawable.Callback callback = this.KQgRr5e_0;
            this.KQgRr5e_0 = null;
            return callback;
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public PGPF6hQ_2 m369KQgRr5e_0() {
        throw null;
    }

    @SuppressLint({"WrongConstant"})
    @TargetApi(23)
    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final boolean m370KQgRr5e_0() {
        return isAutoMirrored() && getLayoutDirection() == 1;
    }

    @Override // android.graphics.drawable.Drawable
    public void applyTheme(Resources.Theme theme) {
        this.f624KQgRr5e_0.KQgRr5e_0(theme);
    }

    @Override // android.graphics.drawable.Drawable
    public boolean canApplyTheme() {
        return this.f624KQgRr5e_0.canApplyTheme();
    }

    @Override // android.graphics.drawable.Drawable
    public void draw(Canvas canvas) {
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            drawable.draw(canvas);
        }
        Drawable drawable2 = this.f630QxJ9d_1;
        if (drawable2 != null) {
            drawable2.draw(canvas);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public int getAlpha() {
        return this.KQgRr5e_0;
    }

    @Override // android.graphics.drawable.Drawable
    public int getChangingConfigurations() {
        return super.getChangingConfigurations() | this.f624KQgRr5e_0.getChangingConfigurations();
    }

    @Override // android.graphics.drawable.Drawable
    public final Drawable.ConstantState getConstantState() {
        if (this.f624KQgRr5e_0.m375KQgRr5e_0()) {
            this.f624KQgRr5e_0.QxJ9d_1 = getChangingConfigurations();
            return this.f624KQgRr5e_0;
        }
        return null;
    }

    @Override // android.graphics.drawable.Drawable
    public Drawable getCurrent() {
        return this.f627KQgRr5e_0;
    }

    @Override // android.graphics.drawable.Drawable
    public void getHotspotBounds(Rect rect) {
        Rect rect2 = this.f626KQgRr5e_0;
        if (rect2 != null) {
            rect.set(rect2);
        } else {
            super.getHotspotBounds(rect);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public int getIntrinsicHeight() {
        if (this.f624KQgRr5e_0.m379QxJ9d_1()) {
            return this.f624KQgRr5e_0.PGPF6hQ_2();
        }
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            return drawable.getIntrinsicHeight();
        }
        return -1;
    }

    @Override // android.graphics.drawable.Drawable
    public int getIntrinsicWidth() {
        if (this.f624KQgRr5e_0.m379QxJ9d_1()) {
            return this.f624KQgRr5e_0.IFxWkV_5();
        }
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            return drawable.getIntrinsicWidth();
        }
        return -1;
    }

    @Override // android.graphics.drawable.Drawable
    public int getMinimumHeight() {
        if (this.f624KQgRr5e_0.m379QxJ9d_1()) {
            return this.f624KQgRr5e_0.Mqv2r_3();
        }
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            return drawable.getMinimumHeight();
        }
        return 0;
    }

    @Override // android.graphics.drawable.Drawable
    public int getMinimumWidth() {
        if (this.f624KQgRr5e_0.m379QxJ9d_1()) {
            return this.f624KQgRr5e_0.X6FRs_4();
        }
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            return drawable.getMinimumWidth();
        }
        return 0;
    }

    @Override // android.graphics.drawable.Drawable
    public int getOpacity() {
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable == null || !drawable.isVisible()) {
            return -2;
        }
        return this.f624KQgRr5e_0.IMuAHx_6();
    }

    @Override // android.graphics.drawable.Drawable
    public void getOutline(Outline outline) {
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            drawable.getOutline(outline);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public boolean getPadding(Rect rect) {
        boolean padding;
        Rect m371KQgRr5e_0 = this.f624KQgRr5e_0.m371KQgRr5e_0();
        if (m371KQgRr5e_0 != null) {
            rect.set(m371KQgRr5e_0);
            padding = (m371KQgRr5e_0.right | ((m371KQgRr5e_0.left | m371KQgRr5e_0.top) | m371KQgRr5e_0.bottom)) != 0;
        } else {
            Drawable drawable = this.f627KQgRr5e_0;
            if (drawable != null) {
                padding = drawable.getPadding(rect);
            } else {
                padding = super.getPadding(rect);
            }
        }
        if (m370KQgRr5e_0()) {
            int i = rect.left;
            rect.left = rect.right;
            rect.right = i;
        }
        return padding;
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public void invalidateDrawable(Drawable drawable) {
        PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
        if (pGPF6hQ_2 != null) {
            pGPF6hQ_2.m377PGPF6hQ_2();
        }
        if (drawable != this.f627KQgRr5e_0 || getCallback() == null) {
            return;
        }
        getCallback().invalidateDrawable(this);
    }

    @Override // android.graphics.drawable.Drawable
    public boolean isAutoMirrored() {
        return this.f624KQgRr5e_0.f635KNBe_11;
    }

    @Override // android.graphics.drawable.Drawable
    public void jumpToCurrentState() {
        boolean z;
        Drawable drawable = this.f630QxJ9d_1;
        boolean z2 = true;
        if (drawable != null) {
            drawable.jumpToCurrentState();
            this.f630QxJ9d_1 = null;
            z = true;
        } else {
            z = false;
        }
        Drawable drawable2 = this.f627KQgRr5e_0;
        if (drawable2 != null) {
            drawable2.jumpToCurrentState();
            if (this.f631QxJ9d_1) {
                this.f627KQgRr5e_0.setAlpha(this.KQgRr5e_0);
            }
        }
        if (this.f629QxJ9d_1 != 0) {
            this.f629QxJ9d_1 = 0L;
            z = true;
        }
        if (this.f623KQgRr5e_0 != 0) {
            this.f623KQgRr5e_0 = 0L;
        } else {
            z2 = z;
        }
        if (z2) {
            invalidateSelf();
        }
    }

    @Override // android.graphics.drawable.Drawable
    public Drawable mutate() {
        if (!this.PGPF6hQ_2 && super.mutate() == this) {
            PGPF6hQ_2 m369KQgRr5e_0 = m369KQgRr5e_0();
            m369KQgRr5e_0.m376Mqv2r_3();
            KQgRr5e_0(m369KQgRr5e_0);
            this.PGPF6hQ_2 = true;
        }
        return this;
    }

    @Override // android.graphics.drawable.Drawable
    public void onBoundsChange(Rect rect) {
        Drawable drawable = this.f630QxJ9d_1;
        if (drawable != null) {
            drawable.setBounds(rect);
        }
        Drawable drawable2 = this.f627KQgRr5e_0;
        if (drawable2 != null) {
            drawable2.setBounds(rect);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public boolean onLayoutDirectionChanged(int i) {
        return this.f624KQgRr5e_0.KQgRr5e_0(i, KQgRr5e_0());
    }

    @Override // android.graphics.drawable.Drawable
    public boolean onLevelChange(int i) {
        Drawable drawable = this.f630QxJ9d_1;
        if (drawable != null) {
            return drawable.setLevel(i);
        }
        Drawable drawable2 = this.f627KQgRr5e_0;
        if (drawable2 != null) {
            return drawable2.setLevel(i);
        }
        return false;
    }

    @Override // android.graphics.drawable.Drawable
    public boolean onStateChange(int[] iArr) {
        Drawable drawable = this.f630QxJ9d_1;
        if (drawable != null) {
            return drawable.setState(iArr);
        }
        Drawable drawable2 = this.f627KQgRr5e_0;
        if (drawable2 != null) {
            return drawable2.setState(iArr);
        }
        return false;
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
        if (drawable != this.f627KQgRr5e_0 || getCallback() == null) {
            return;
        }
        getCallback().scheduleDrawable(this, runnable, j);
    }

    @Override // android.graphics.drawable.Drawable
    public void setAlpha(int i) {
        if (this.f631QxJ9d_1 && this.KQgRr5e_0 == i) {
            return;
        }
        this.f631QxJ9d_1 = true;
        this.KQgRr5e_0 = i;
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            if (this.f623KQgRr5e_0 == 0) {
                drawable.setAlpha(i);
            } else {
                KQgRr5e_0(false);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setAutoMirrored(boolean z) {
        PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
        if (pGPF6hQ_2.f635KNBe_11 != z) {
            pGPF6hQ_2.f635KNBe_11 = z;
            Drawable drawable = this.f627KQgRr5e_0;
            if (drawable != null) {
                X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(drawable, z);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setColorFilter(ColorFilter colorFilter) {
        PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
        pGPF6hQ_2.EuDEkJe_12 = true;
        if (pGPF6hQ_2.f639KQgRr5e_0 != colorFilter) {
            pGPF6hQ_2.f639KQgRr5e_0 = colorFilter;
            Drawable drawable = this.f627KQgRr5e_0;
            if (drawable != null) {
                drawable.setColorFilter(colorFilter);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setDither(boolean z) {
        PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
        if (pGPF6hQ_2.f651XnFJ5_9 != z) {
            pGPF6hQ_2.f651XnFJ5_9 = z;
            Drawable drawable = this.f627KQgRr5e_0;
            if (drawable != null) {
                drawable.setDither(z);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setHotspot(float f, float f2) {
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(drawable, f, f2);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setHotspotBounds(int i, int i2, int i3, int i4) {
        Rect rect = this.f626KQgRr5e_0;
        if (rect == null) {
            this.f626KQgRr5e_0 = new Rect(i, i2, i3, i4);
        } else {
            rect.set(i, i2, i3, i4);
        }
        Drawable drawable = this.f627KQgRr5e_0;
        if (drawable != null) {
            X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(drawable, i, i2, i3, i4);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setTintList(ColorStateList colorStateList) {
        PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
        pGPF6hQ_2.WwEq_13 = true;
        if (pGPF6hQ_2.f637KQgRr5e_0 != colorStateList) {
            pGPF6hQ_2.f637KQgRr5e_0 = colorStateList;
            X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(this.f627KQgRr5e_0, colorStateList);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setTintMode(PorterDuff.Mode mode) {
        PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
        pGPF6hQ_2.YghfZG_14 = true;
        if (pGPF6hQ_2.f640KQgRr5e_0 != mode) {
            pGPF6hQ_2.f640KQgRr5e_0 = mode;
            X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(this.f627KQgRr5e_0, mode);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public boolean setVisible(boolean z, boolean z2) {
        boolean visible = super.setVisible(z, z2);
        Drawable drawable = this.f630QxJ9d_1;
        if (drawable != null) {
            drawable.setVisible(z, z2);
        }
        Drawable drawable2 = this.f627KQgRr5e_0;
        if (drawable2 != null) {
            drawable2.setVisible(z, z2);
        }
        return visible;
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
        if (drawable != this.f627KQgRr5e_0 || getCallback() == null) {
            return;
        }
        getCallback().unscheduleDrawable(this, runnable);
    }

    /* compiled from: DrawableContainer.java */
    /* loaded from: classes.dex */
    public static abstract class PGPF6hQ_2 extends Drawable.ConstantState {
        public boolean EuDEkJe_12;

        /* renamed from: FSaI4_7  reason: collision with root package name */
        public int f3142FSaI4_7;

        /* renamed from: FSaI4_7  reason: collision with other field name */
        public boolean f632FSaI4_7;

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

        /* renamed from: IFxWkV_5  reason: collision with other field name */
        public boolean f633IFxWkV_5;

        /* renamed from: IMuAHx_6  reason: collision with root package name */
        public int f3144IMuAHx_6;

        /* renamed from: IMuAHx_6  reason: collision with other field name */
        public boolean f634IMuAHx_6;

        /* renamed from: KNBe_11  reason: collision with root package name */
        public int f3145KNBe_11;

        /* renamed from: KNBe_11  reason: collision with other field name */
        public boolean f635KNBe_11;
        public int KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final QxJ9d_1 f636KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public ColorStateList f637KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public Resources f638KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public ColorFilter f639KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public PorterDuff.Mode f640KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public Rect f641KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public SparseArray<Drawable.ConstantState> f642KQgRr5e_0;

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

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public Drawable[] f644KQgRr5e_0;

        /* renamed from: Mqv2r_3  reason: collision with root package name */
        public int f3146Mqv2r_3;

        /* renamed from: Mqv2r_3  reason: collision with other field name */
        public boolean f645Mqv2r_3;

        /* renamed from: Nm6q_10  reason: collision with root package name */
        public int f3147Nm6q_10;

        /* renamed from: Nm6q_10  reason: collision with other field name */
        public boolean f646Nm6q_10;
        public int PGPF6hQ_2;

        /* renamed from: PGPF6hQ_2  reason: collision with other field name */
        public boolean f647PGPF6hQ_2;
        public int QxJ9d_1;

        /* renamed from: QxJ9d_1  reason: collision with other field name */
        public boolean f648QxJ9d_1;
        public boolean WwEq_13;

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

        /* renamed from: X6FRs_4  reason: collision with other field name */
        public boolean f649X6FRs_4;

        /* renamed from: Xgtqvk_8  reason: collision with root package name */
        public int f3149Xgtqvk_8;

        /* renamed from: Xgtqvk_8  reason: collision with other field name */
        public boolean f650Xgtqvk_8;

        /* renamed from: XnFJ5_9  reason: collision with root package name */
        public int f3150XnFJ5_9;

        /* renamed from: XnFJ5_9  reason: collision with other field name */
        public boolean f651XnFJ5_9;
        public boolean YghfZG_14;

        public PGPF6hQ_2(PGPF6hQ_2 pGPF6hQ_2, QxJ9d_1 qxJ9d_1, Resources resources) {
            Resources resources2;
            this.KQgRr5e_0 = 160;
            this.f643KQgRr5e_0 = false;
            this.f647PGPF6hQ_2 = false;
            this.f651XnFJ5_9 = true;
            this.f3147Nm6q_10 = 0;
            this.f3145KNBe_11 = 0;
            this.f636KQgRr5e_0 = qxJ9d_1;
            if (resources != null) {
                resources2 = resources;
            } else {
                resources2 = pGPF6hQ_2 != null ? pGPF6hQ_2.f638KQgRr5e_0 : null;
            }
            this.f638KQgRr5e_0 = resources2;
            int KQgRr5e_0 = QxJ9d_1.KQgRr5e_0(resources, pGPF6hQ_2 != null ? pGPF6hQ_2.KQgRr5e_0 : 0);
            this.KQgRr5e_0 = KQgRr5e_0;
            if (pGPF6hQ_2 != null) {
                this.QxJ9d_1 = pGPF6hQ_2.QxJ9d_1;
                this.PGPF6hQ_2 = pGPF6hQ_2.PGPF6hQ_2;
                this.f632FSaI4_7 = true;
                this.f650Xgtqvk_8 = true;
                this.f643KQgRr5e_0 = pGPF6hQ_2.f643KQgRr5e_0;
                this.f647PGPF6hQ_2 = pGPF6hQ_2.f647PGPF6hQ_2;
                this.f651XnFJ5_9 = pGPF6hQ_2.f651XnFJ5_9;
                this.f646Nm6q_10 = pGPF6hQ_2.f646Nm6q_10;
                this.f3150XnFJ5_9 = pGPF6hQ_2.f3150XnFJ5_9;
                this.f3147Nm6q_10 = pGPF6hQ_2.f3147Nm6q_10;
                this.f3145KNBe_11 = pGPF6hQ_2.f3145KNBe_11;
                this.f635KNBe_11 = pGPF6hQ_2.f635KNBe_11;
                this.f639KQgRr5e_0 = pGPF6hQ_2.f639KQgRr5e_0;
                this.EuDEkJe_12 = pGPF6hQ_2.EuDEkJe_12;
                this.f637KQgRr5e_0 = pGPF6hQ_2.f637KQgRr5e_0;
                this.f640KQgRr5e_0 = pGPF6hQ_2.f640KQgRr5e_0;
                this.WwEq_13 = pGPF6hQ_2.WwEq_13;
                this.YghfZG_14 = pGPF6hQ_2.YghfZG_14;
                if (pGPF6hQ_2.KQgRr5e_0 == KQgRr5e_0) {
                    if (pGPF6hQ_2.f648QxJ9d_1) {
                        this.f641KQgRr5e_0 = new Rect(pGPF6hQ_2.f641KQgRr5e_0);
                        this.f648QxJ9d_1 = true;
                    }
                    if (pGPF6hQ_2.f645Mqv2r_3) {
                        this.f3148X6FRs_4 = pGPF6hQ_2.f3148X6FRs_4;
                        this.f3143IFxWkV_5 = pGPF6hQ_2.f3143IFxWkV_5;
                        this.f3144IMuAHx_6 = pGPF6hQ_2.f3144IMuAHx_6;
                        this.f3142FSaI4_7 = pGPF6hQ_2.f3142FSaI4_7;
                        this.f645Mqv2r_3 = true;
                    }
                }
                if (pGPF6hQ_2.f649X6FRs_4) {
                    this.f3149Xgtqvk_8 = pGPF6hQ_2.f3149Xgtqvk_8;
                    this.f649X6FRs_4 = true;
                }
                if (pGPF6hQ_2.f633IFxWkV_5) {
                    this.f634IMuAHx_6 = pGPF6hQ_2.f634IMuAHx_6;
                    this.f633IFxWkV_5 = true;
                }
                Drawable[] drawableArr = pGPF6hQ_2.f644KQgRr5e_0;
                this.f644KQgRr5e_0 = new Drawable[drawableArr.length];
                this.f3146Mqv2r_3 = pGPF6hQ_2.f3146Mqv2r_3;
                SparseArray<Drawable.ConstantState> sparseArray = pGPF6hQ_2.f642KQgRr5e_0;
                if (sparseArray != null) {
                    this.f642KQgRr5e_0 = sparseArray.clone();
                } else {
                    this.f642KQgRr5e_0 = new SparseArray<>(this.f3146Mqv2r_3);
                }
                int i = this.f3146Mqv2r_3;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2] != null) {
                        Drawable.ConstantState constantState = drawableArr[i2].getConstantState();
                        if (constantState != null) {
                            this.f642KQgRr5e_0.put(i2, constantState);
                        } else {
                            this.f644KQgRr5e_0[i2] = drawableArr[i2];
                        }
                    }
                }
                return;
            }
            this.f644KQgRr5e_0 = new Drawable[10];
            this.f3146Mqv2r_3 = 0;
        }

        public final int IFxWkV_5() {
            if (!this.f645Mqv2r_3) {
                m373KQgRr5e_0();
            }
            return this.f3148X6FRs_4;
        }

        public final int IMuAHx_6() {
            if (this.f649X6FRs_4) {
                return this.f3149Xgtqvk_8;
            }
            m378QxJ9d_1();
            int i = this.f3146Mqv2r_3;
            Drawable[] drawableArr = this.f644KQgRr5e_0;
            int opacity = i > 0 ? drawableArr[0].getOpacity() : -2;
            for (int i2 = 1; i2 < i; i2++) {
                opacity = Drawable.resolveOpacity(opacity, drawableArr[i2].getOpacity());
            }
            this.f3149Xgtqvk_8 = opacity;
            this.f649X6FRs_4 = true;
            return opacity;
        }

        public final int KQgRr5e_0(Drawable drawable) {
            int i = this.f3146Mqv2r_3;
            if (i >= this.f644KQgRr5e_0.length) {
                mo368KQgRr5e_0(i, i + 10);
            }
            drawable.mutate();
            drawable.setVisible(false, true);
            drawable.setCallback(this.f636KQgRr5e_0);
            this.f644KQgRr5e_0[i] = drawable;
            this.f3146Mqv2r_3++;
            this.PGPF6hQ_2 = drawable.getChangingConfigurations() | this.PGPF6hQ_2;
            m377PGPF6hQ_2();
            this.f641KQgRr5e_0 = null;
            this.f648QxJ9d_1 = false;
            this.f645Mqv2r_3 = false;
            this.f632FSaI4_7 = false;
            return i;
        }

        public final int Mqv2r_3() {
            if (!this.f645Mqv2r_3) {
                m373KQgRr5e_0();
            }
            return this.f3142FSaI4_7;
        }

        /* renamed from: Mqv2r_3  reason: collision with other method in class */
        public abstract void m376Mqv2r_3();

        /* renamed from: PGPF6hQ_2  reason: collision with other method in class */
        public void m377PGPF6hQ_2() {
            this.f649X6FRs_4 = false;
            this.f633IFxWkV_5 = false;
        }

        /* renamed from: QxJ9d_1  reason: collision with other method in class */
        public final void m378QxJ9d_1() {
            SparseArray<Drawable.ConstantState> sparseArray = this.f642KQgRr5e_0;
            if (sparseArray != null) {
                int size = sparseArray.size();
                for (int i = 0; i < size; i++) {
                    this.f644KQgRr5e_0[this.f642KQgRr5e_0.keyAt(i)] = m372KQgRr5e_0(this.f642KQgRr5e_0.valueAt(i).newDrawable(this.f638KQgRr5e_0));
                }
                this.f642KQgRr5e_0 = null;
            }
        }

        public final int X6FRs_4() {
            if (!this.f645Mqv2r_3) {
                m373KQgRr5e_0();
            }
            return this.f3144IMuAHx_6;
        }

        @Override // android.graphics.drawable.Drawable.ConstantState
        public boolean canApplyTheme() {
            int i = this.f3146Mqv2r_3;
            Drawable[] drawableArr = this.f644KQgRr5e_0;
            for (int i2 = 0; i2 < i; i2++) {
                Drawable drawable = drawableArr[i2];
                if (drawable != null) {
                    if (drawable.canApplyTheme()) {
                        return true;
                    }
                } else {
                    Drawable.ConstantState constantState = this.f642KQgRr5e_0.get(i2);
                    if (constantState != null && constantState.canApplyTheme()) {
                        return true;
                    }
                }
            }
            return false;
        }

        @Override // android.graphics.drawable.Drawable.ConstantState
        public int getChangingConfigurations() {
            return this.QxJ9d_1 | this.PGPF6hQ_2;
        }

        public final int PGPF6hQ_2() {
            if (!this.f645Mqv2r_3) {
                m373KQgRr5e_0();
            }
            return this.f3143IFxWkV_5;
        }

        public final int QxJ9d_1() {
            return this.f3146Mqv2r_3;
        }

        public final void QxJ9d_1(boolean z) {
            this.f643KQgRr5e_0 = z;
        }

        /* renamed from: QxJ9d_1  reason: collision with other method in class */
        public final boolean m379QxJ9d_1() {
            return this.f647PGPF6hQ_2;
        }

        public final void QxJ9d_1(int i) {
            this.f3145KNBe_11 = i;
        }

        public final int KQgRr5e_0() {
            return this.f644KQgRr5e_0.length;
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public final Drawable m372KQgRr5e_0(Drawable drawable) {
            if (Build.VERSION.SDK_INT >= 23) {
                drawable.setLayoutDirection(this.f3150XnFJ5_9);
            }
            Drawable mutate = drawable.mutate();
            mutate.setCallback(this.f636KQgRr5e_0);
            return mutate;
        }

        public final Drawable KQgRr5e_0(int i) {
            int indexOfKey;
            Drawable drawable = this.f644KQgRr5e_0[i];
            if (drawable != null) {
                return drawable;
            }
            SparseArray<Drawable.ConstantState> sparseArray = this.f642KQgRr5e_0;
            if (sparseArray == null || (indexOfKey = sparseArray.indexOfKey(i)) < 0) {
                return null;
            }
            Drawable m372KQgRr5e_0 = m372KQgRr5e_0(this.f642KQgRr5e_0.valueAt(indexOfKey).newDrawable(this.f638KQgRr5e_0));
            this.f644KQgRr5e_0[i] = m372KQgRr5e_0;
            this.f642KQgRr5e_0.removeAt(indexOfKey);
            if (this.f642KQgRr5e_0.size() == 0) {
                this.f642KQgRr5e_0 = null;
            }
            return m372KQgRr5e_0;
        }

        public final boolean KQgRr5e_0(int i, int i2) {
            int i3 = this.f3146Mqv2r_3;
            Drawable[] drawableArr = this.f644KQgRr5e_0;
            boolean z = false;
            for (int i4 = 0; i4 < i3; i4++) {
                if (drawableArr[i4] != null) {
                    boolean layoutDirection = Build.VERSION.SDK_INT >= 23 ? drawableArr[i4].setLayoutDirection(i) : false;
                    if (i4 == i2) {
                        z = layoutDirection;
                    }
                }
            }
            this.f3150XnFJ5_9 = i;
            return z;
        }

        public final void KQgRr5e_0(Resources resources) {
            if (resources != null) {
                this.f638KQgRr5e_0 = resources;
                int KQgRr5e_0 = QxJ9d_1.KQgRr5e_0(resources, this.KQgRr5e_0);
                int i = this.KQgRr5e_0;
                this.KQgRr5e_0 = KQgRr5e_0;
                if (i != KQgRr5e_0) {
                    this.f645Mqv2r_3 = false;
                    this.f648QxJ9d_1 = false;
                }
            }
        }

        public final void KQgRr5e_0(Resources.Theme theme) {
            if (theme != null) {
                m378QxJ9d_1();
                int i = this.f3146Mqv2r_3;
                Drawable[] drawableArr = this.f644KQgRr5e_0;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2] != null && drawableArr[i2].canApplyTheme()) {
                        drawableArr[i2].applyTheme(theme);
                        this.PGPF6hQ_2 |= drawableArr[i2].getChangingConfigurations();
                    }
                }
                KQgRr5e_0(theme.getResources());
            }
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public final Rect m371KQgRr5e_0() {
            Rect rect = null;
            if (this.f643KQgRr5e_0) {
                return null;
            }
            if (this.f641KQgRr5e_0 == null && !this.f648QxJ9d_1) {
                m378QxJ9d_1();
                Rect rect2 = new Rect();
                int i = this.f3146Mqv2r_3;
                Drawable[] drawableArr = this.f644KQgRr5e_0;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2].getPadding(rect2)) {
                        if (rect == null) {
                            rect = new Rect(0, 0, 0, 0);
                        }
                        int i3 = rect2.left;
                        if (i3 > rect.left) {
                            rect.left = i3;
                        }
                        int i4 = rect2.top;
                        if (i4 > rect.top) {
                            rect.top = i4;
                        }
                        int i5 = rect2.right;
                        if (i5 > rect.right) {
                            rect.right = i5;
                        }
                        int i6 = rect2.bottom;
                        if (i6 > rect.bottom) {
                            rect.bottom = i6;
                        }
                    }
                }
                this.f648QxJ9d_1 = true;
                this.f641KQgRr5e_0 = rect;
                return rect;
            }
            return this.f641KQgRr5e_0;
        }

        public final void KQgRr5e_0(boolean z) {
            this.f647PGPF6hQ_2 = z;
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public void m373KQgRr5e_0() {
            this.f645Mqv2r_3 = true;
            m378QxJ9d_1();
            int i = this.f3146Mqv2r_3;
            Drawable[] drawableArr = this.f644KQgRr5e_0;
            this.f3143IFxWkV_5 = -1;
            this.f3148X6FRs_4 = -1;
            this.f3142FSaI4_7 = 0;
            this.f3144IMuAHx_6 = 0;
            for (int i2 = 0; i2 < i; i2++) {
                Drawable drawable = drawableArr[i2];
                int intrinsicWidth = drawable.getIntrinsicWidth();
                if (intrinsicWidth > this.f3148X6FRs_4) {
                    this.f3148X6FRs_4 = intrinsicWidth;
                }
                int intrinsicHeight = drawable.getIntrinsicHeight();
                if (intrinsicHeight > this.f3143IFxWkV_5) {
                    this.f3143IFxWkV_5 = intrinsicHeight;
                }
                int minimumWidth = drawable.getMinimumWidth();
                if (minimumWidth > this.f3144IMuAHx_6) {
                    this.f3144IMuAHx_6 = minimumWidth;
                }
                int minimumHeight = drawable.getMinimumHeight();
                if (minimumHeight > this.f3142FSaI4_7) {
                    this.f3142FSaI4_7 = minimumHeight;
                }
            }
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public final void m374KQgRr5e_0(int i) {
            this.f3147Nm6q_10 = i;
        }

        /* renamed from: KQgRr5e_0 */
        public void mo368KQgRr5e_0(int i, int i2) {
            Drawable[] drawableArr = new Drawable[i2];
            System.arraycopy(this.f644KQgRr5e_0, 0, drawableArr, 0, i);
            this.f644KQgRr5e_0 = drawableArr;
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public synchronized boolean m375KQgRr5e_0() {
            if (this.f632FSaI4_7) {
                return this.f650Xgtqvk_8;
            }
            m378QxJ9d_1();
            this.f632FSaI4_7 = true;
            int i = this.f3146Mqv2r_3;
            Drawable[] drawableArr = this.f644KQgRr5e_0;
            for (int i2 = 0; i2 < i; i2++) {
                if (drawableArr[i2].getConstantState() == null) {
                    this.f650Xgtqvk_8 = false;
                    return false;
                }
            }
            this.f650Xgtqvk_8 = true;
            return true;
        }
    }

    public int KQgRr5e_0() {
        return this.QxJ9d_1;
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x006b  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0073  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean KQgRr5e_0(int i) {
        Runnable runnable;
        if (i == this.QxJ9d_1) {
            return false;
        }
        long uptimeMillis = SystemClock.uptimeMillis();
        if (this.f624KQgRr5e_0.f3145KNBe_11 > 0) {
            Drawable drawable = this.f630QxJ9d_1;
            if (drawable != null) {
                drawable.setVisible(false, false);
            }
            Drawable drawable2 = this.f627KQgRr5e_0;
            if (drawable2 != null) {
                this.f630QxJ9d_1 = drawable2;
                this.f629QxJ9d_1 = this.f624KQgRr5e_0.f3145KNBe_11 + uptimeMillis;
            } else {
                this.f630QxJ9d_1 = null;
                this.f629QxJ9d_1 = 0L;
            }
        } else {
            Drawable drawable3 = this.f627KQgRr5e_0;
            if (drawable3 != null) {
                drawable3.setVisible(false, false);
            }
        }
        if (i >= 0) {
            PGPF6hQ_2 pGPF6hQ_2 = this.f624KQgRr5e_0;
            if (i < pGPF6hQ_2.f3146Mqv2r_3) {
                Drawable KQgRr5e_02 = pGPF6hQ_2.KQgRr5e_0(i);
                this.f627KQgRr5e_0 = KQgRr5e_02;
                this.QxJ9d_1 = i;
                if (KQgRr5e_02 != null) {
                    int i2 = this.f624KQgRr5e_0.f3147Nm6q_10;
                    if (i2 > 0) {
                        this.f623KQgRr5e_0 = uptimeMillis + i2;
                    }
                    KQgRr5e_0(KQgRr5e_02);
                }
                if (this.f623KQgRr5e_0 == 0 || this.f629QxJ9d_1 != 0) {
                    runnable = this.f628KQgRr5e_0;
                    if (runnable != null) {
                        this.f628KQgRr5e_0 = new KQgRr5e_0();
                    } else {
                        unscheduleSelf(runnable);
                    }
                    KQgRr5e_0(true);
                }
                invalidateSelf();
                return true;
            }
        }
        this.f627KQgRr5e_0 = null;
        this.QxJ9d_1 = -1;
        if (this.f623KQgRr5e_0 == 0) {
        }
        runnable = this.f628KQgRr5e_0;
        if (runnable != null) {
        }
        KQgRr5e_0(true);
        invalidateSelf();
        return true;
    }

    public final void KQgRr5e_0(Drawable drawable) {
        if (this.f625KQgRr5e_0 == null) {
            this.f625KQgRr5e_0 = new C0054QxJ9d_1();
        }
        C0054QxJ9d_1 c0054QxJ9d_1 = this.f625KQgRr5e_0;
        c0054QxJ9d_1.KQgRr5e_0(drawable.getCallback());
        drawable.setCallback(c0054QxJ9d_1);
        try {
            if (this.f624KQgRr5e_0.f3147Nm6q_10 <= 0 && this.f631QxJ9d_1) {
                drawable.setAlpha(this.KQgRr5e_0);
            }
            if (this.f624KQgRr5e_0.EuDEkJe_12) {
                drawable.setColorFilter(this.f624KQgRr5e_0.f639KQgRr5e_0);
            } else {
                if (this.f624KQgRr5e_0.WwEq_13) {
                    X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(drawable, this.f624KQgRr5e_0.f637KQgRr5e_0);
                }
                if (this.f624KQgRr5e_0.YghfZG_14) {
                    X6FRs_4.IMuAHx_6.IFxWkV_5.XnFJ5_9.KQgRr5e_0.KQgRr5e_0(drawable, this.f624KQgRr5e_0.f640KQgRr5e_0);
                }
            }
            drawable.setVisible(isVisible(), true);
            drawable.setDither(this.f624KQgRr5e_0.f651XnFJ5_9);
            drawable.setState(getState());
            drawable.setLevel(getLevel());
            drawable.setBounds(getBounds());
            if (Build.VERSION.SDK_INT >= 23) {
                drawable.setLayoutDirection(getLayoutDirection());
            }
            if (Build.VERSION.SDK_INT >= 19) {
                drawable.setAutoMirrored(this.f624KQgRr5e_0.f635KNBe_11);
            }
            Rect rect = this.f626KQgRr5e_0;
            if (Build.VERSION.SDK_INT >= 21 && rect != null) {
                drawable.setHotspotBounds(rect.left, rect.top, rect.right, rect.bottom);
            }
        } finally {
            drawable.setCallback(this.f625KQgRr5e_0.KQgRr5e_0());
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x003f  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0065  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x006a A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:26:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void KQgRr5e_0(boolean z) {
        boolean z2;
        Drawable drawable;
        boolean z3 = true;
        this.f631QxJ9d_1 = true;
        long uptimeMillis = SystemClock.uptimeMillis();
        Drawable drawable2 = this.f627KQgRr5e_0;
        if (drawable2 != null) {
            long j = this.f623KQgRr5e_0;
            if (j != 0) {
                if (j <= uptimeMillis) {
                    drawable2.setAlpha(this.KQgRr5e_0);
                    this.f623KQgRr5e_0 = 0L;
                } else {
                    drawable2.setAlpha(((255 - (((int) ((j - uptimeMillis) * 255)) / this.f624KQgRr5e_0.f3147Nm6q_10)) * this.KQgRr5e_0) / 255);
                    z2 = true;
                    drawable = this.f630QxJ9d_1;
                    if (drawable == null) {
                        long j2 = this.f629QxJ9d_1;
                        if (j2 != 0) {
                            if (j2 <= uptimeMillis) {
                                drawable.setVisible(false, false);
                                this.f630QxJ9d_1 = null;
                                this.f629QxJ9d_1 = 0L;
                            } else {
                                drawable.setAlpha(((((int) ((j2 - uptimeMillis) * 255)) / this.f624KQgRr5e_0.f3145KNBe_11) * this.KQgRr5e_0) / 255);
                                if (z && z3) {
                                    scheduleSelf(this.f628KQgRr5e_0, uptimeMillis + 16);
                                    return;
                                }
                                return;
                            }
                        }
                    } else {
                        this.f629QxJ9d_1 = 0L;
                    }
                    z3 = z2;
                    if (z) {
                        return;
                    }
                    return;
                }
            }
        } else {
            this.f623KQgRr5e_0 = 0L;
        }
        z2 = false;
        drawable = this.f630QxJ9d_1;
        if (drawable == null) {
        }
        z3 = z2;
        if (z) {
        }
    }

    public final void KQgRr5e_0(Resources resources) {
        this.f624KQgRr5e_0.KQgRr5e_0(resources);
    }

    public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2) {
        this.f624KQgRr5e_0 = pGPF6hQ_2;
        int i = this.QxJ9d_1;
        if (i >= 0) {
            Drawable KQgRr5e_02 = pGPF6hQ_2.KQgRr5e_0(i);
            this.f627KQgRr5e_0 = KQgRr5e_02;
            if (KQgRr5e_02 != null) {
                KQgRr5e_0(KQgRr5e_02);
            }
        }
        this.f630QxJ9d_1 = null;
    }

    public static int KQgRr5e_0(Resources resources, int i) {
        if (resources != null) {
            i = resources.getDisplayMetrics().densityDpi;
        }
        if (i == 0) {
            return 160;
        }
        return i;
    }
}
