package ῲ.ῲ.ʬ.K;

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;
import com.google.android.material.progressindicator.BaseProgressIndicator;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ῲ.ʬ.K.ῲ  reason: contains not printable characters */
/* compiled from: DrawableContainer */
public class C1873 extends Drawable implements Drawable.Callback {

    /* renamed from: ʬ  reason: contains not printable characters */
    public Rect f6319;

    /* renamed from: ඓ  reason: contains not printable characters */
    public Drawable f6320;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public long f6321;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public boolean f6322;

    /* renamed from: ῲ  reason: contains not printable characters */
    public AbstractC1874 f6323;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public boolean f6324;

    /* renamed from: 㑃  reason: contains not printable characters */
    public long f6325;

    /* renamed from: 㳳  reason: contains not printable characters */
    public Runnable f6326;

    /* renamed from: 㴹  reason: contains not printable characters */
    public int f6327 = BaseProgressIndicator.MAX_ALPHA;

    /* renamed from: 㸾  reason: contains not printable characters */
    public Drawable f6328;

    /* renamed from: 㿎  reason: contains not printable characters */
    public int f6329 = -1;

    /* renamed from: 䁗  reason: contains not printable characters */
    public C1875 f6330;

    /* renamed from: ῲ.ῲ.ʬ.K.ῲ$ῲ  reason: contains not printable characters */
    /* compiled from: DrawableContainer */
    public static class C1875 implements Drawable.Callback {

        /* renamed from: ῲ  reason: contains not printable characters */
        public Drawable.Callback f6366;

        public void invalidateDrawable(Drawable drawable) {
        }

        public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
            Drawable.Callback callback = this.f6366;
            if (callback != null) {
                callback.scheduleDrawable(drawable, runnable, j);
            }
        }

        public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
            Drawable.Callback callback = this.f6366;
            if (callback != null) {
                callback.unscheduleDrawable(drawable, runnable);
            }
        }
    }

    /* renamed from: ῲ.ῲ.ʬ.K.ῲ$K  reason: contains not printable characters */
    /* compiled from: DrawableContainer */
    public class RunnableC1876 implements Runnable {
        public RunnableC1876() {
        }

        public void run() {
            C1873.this.m4841(true);
            C1873.this.invalidateSelf();
        }
    }

    public boolean canApplyTheme() {
        return this.f6323.canApplyTheme();
    }

    public void draw(Canvas canvas) {
        Drawable drawable = this.f6328;
        if (drawable != null) {
            drawable.draw(canvas);
        }
        Drawable drawable2 = this.f6320;
        if (drawable2 != null) {
            drawable2.draw(canvas);
        }
    }

    public int getAlpha() {
        return this.f6327;
    }

    public int getChangingConfigurations() {
        return super.getChangingConfigurations() | this.f6323.getChangingConfigurations();
    }

    public final Drawable.ConstantState getConstantState() {
        if (!this.f6323.m4850()) {
            return null;
        }
        this.f6323.f6361 = getChangingConfigurations();
        return this.f6323;
    }

    public Drawable getCurrent() {
        return this.f6328;
    }

    public void getHotspotBounds(Rect rect) {
        Rect rect2 = this.f6319;
        if (rect2 != null) {
            rect.set(rect2);
        } else {
            super.getHotspotBounds(rect);
        }
    }

    public int getIntrinsicHeight() {
        AbstractC1874 r0 = this.f6323;
        if (r0.f6353) {
            if (!r0.f6364) {
                r0.m4844();
            }
            return r0.f6354;
        }
        Drawable drawable = this.f6328;
        if (drawable != null) {
            return drawable.getIntrinsicHeight();
        }
        return -1;
    }

    public int getIntrinsicWidth() {
        AbstractC1874 r0 = this.f6323;
        if (r0.f6353) {
            if (!r0.f6364) {
                r0.m4844();
            }
            return r0.f6333;
        }
        Drawable drawable = this.f6328;
        if (drawable != null) {
            return drawable.getIntrinsicWidth();
        }
        return -1;
    }

    public int getMinimumHeight() {
        AbstractC1874 r0 = this.f6323;
        if (r0.f6353) {
            if (!r0.f6364) {
                r0.m4844();
            }
            return r0.f6343;
        }
        Drawable drawable = this.f6328;
        if (drawable != null) {
            return drawable.getMinimumHeight();
        }
        return 0;
    }

    public int getMinimumWidth() {
        AbstractC1874 r0 = this.f6323;
        if (r0.f6353) {
            if (!r0.f6364) {
                r0.m4844();
            }
            return r0.f6335;
        }
        Drawable drawable = this.f6328;
        if (drawable != null) {
            return drawable.getMinimumWidth();
        }
        return 0;
    }

    public int getOpacity() {
        Drawable drawable = this.f6328;
        int i = -2;
        if (drawable == null || !drawable.isVisible()) {
            return -2;
        }
        AbstractC1874 r0 = this.f6323;
        if (r0.f6355) {
            return r0.f6336;
        }
        r0.m4843();
        int i2 = r0.f6362;
        Drawable[] drawableArr = r0.f6348;
        if (i2 > 0) {
            i = drawableArr[0].getOpacity();
        }
        int i3 = i;
        for (int i4 = 1; i4 < i2; i4++) {
            i3 = Drawable.resolveOpacity(i3, drawableArr[i4].getOpacity());
        }
        r0.f6336 = i3;
        r0.f6355 = true;
        return i3;
    }

    public void getOutline(Outline outline) {
        Drawable drawable = this.f6328;
        if (drawable != null) {
            drawable.getOutline(outline);
        }
    }

    public boolean getPadding(Rect rect) {
        boolean z;
        AbstractC1874 r0 = this.f6323;
        Rect rect2 = null;
        boolean z2 = true;
        if (!r0.f6346) {
            if (r0.f6344 != null || r0.f6357) {
                rect2 = r0.f6344;
            } else {
                r0.m4843();
                Rect rect3 = new Rect();
                int i = r0.f6362;
                Drawable[] drawableArr = r0.f6348;
                Rect rect4 = null;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2].getPadding(rect3)) {
                        if (rect4 == null) {
                            rect4 = new Rect(0, 0, 0, 0);
                        }
                        int i3 = rect3.left;
                        if (i3 > rect4.left) {
                            rect4.left = i3;
                        }
                        int i4 = rect3.top;
                        if (i4 > rect4.top) {
                            rect4.top = i4;
                        }
                        int i5 = rect3.right;
                        if (i5 > rect4.right) {
                            rect4.right = i5;
                        }
                        int i6 = rect3.bottom;
                        if (i6 > rect4.bottom) {
                            rect4.bottom = i6;
                        }
                    }
                }
                r0.f6357 = true;
                r0.f6344 = rect4;
                rect2 = rect4;
            }
        }
        if (rect2 != null) {
            rect.set(rect2);
            z = (((rect2.left | rect2.top) | rect2.bottom) | rect2.right) != 0;
        } else {
            Drawable drawable = this.f6328;
            if (drawable != null) {
                z = drawable.getPadding(rect);
            } else {
                z = super.getPadding(rect);
            }
        }
        if (!this.f6323.f6365 || C2369.m6278((Drawable) this) != 1) {
            z2 = false;
        }
        if (z2) {
            int i7 = rect.left;
            rect.left = rect.right;
            rect.right = i7;
        }
        return z;
    }

    public void invalidateDrawable(Drawable drawable) {
        AbstractC1874 r0 = this.f6323;
        if (r0 != null) {
            r0.f6355 = false;
            r0.f6363 = false;
        }
        if (drawable == this.f6328 && getCallback() != null) {
            getCallback().invalidateDrawable(this);
        }
    }

    public boolean isAutoMirrored() {
        return this.f6323.f6365;
    }

    public void jumpToCurrentState() {
        boolean z;
        Drawable drawable = this.f6320;
        if (drawable != null) {
            drawable.jumpToCurrentState();
            this.f6320 = null;
            z = true;
        } else {
            z = false;
        }
        Drawable drawable2 = this.f6328;
        if (drawable2 != null) {
            drawable2.jumpToCurrentState();
            if (this.f6324) {
                this.f6328.setAlpha(this.f6327);
            }
        }
        if (this.f6325 != 0) {
            this.f6325 = 0;
            z = true;
        }
        if (this.f6321 != 0) {
            this.f6321 = 0;
            z = true;
        }
        if (z) {
            invalidateSelf();
        }
    }

    public Drawable mutate() {
        if (!this.f6322 && super.mutate() == this) {
            AbstractC1874 r0 = m4838();
            r0.m4851();
            m4840(r0);
            this.f6322 = true;
        }
        return this;
    }

    public void onBoundsChange(Rect rect) {
        Drawable drawable = this.f6320;
        if (drawable != null) {
            drawable.setBounds(rect);
        }
        Drawable drawable2 = this.f6328;
        if (drawable2 != null) {
            drawable2.setBounds(rect);
        }
    }

    public boolean onLayoutDirectionChanged(int i) {
        AbstractC1874 r0 = this.f6323;
        int i2 = this.f6329;
        int i3 = r0.f6362;
        Drawable[] drawableArr = r0.f6348;
        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;
                }
            }
        }
        r0.f6351 = i;
        return z;
    }

    public boolean onLevelChange(int i) {
        Drawable drawable = this.f6320;
        if (drawable != null) {
            return drawable.setLevel(i);
        }
        Drawable drawable2 = this.f6328;
        if (drawable2 != null) {
            return drawable2.setLevel(i);
        }
        return false;
    }

    public boolean onStateChange(int[] iArr) {
        Drawable drawable = this.f6320;
        if (drawable != null) {
            return drawable.setState(iArr);
        }
        Drawable drawable2 = this.f6328;
        if (drawable2 != null) {
            return drawable2.setState(iArr);
        }
        return false;
    }

    public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
        if (drawable == this.f6328 && getCallback() != null) {
            getCallback().scheduleDrawable(this, runnable, j);
        }
    }

    public void setAlpha(int i) {
        if (!this.f6324 || this.f6327 != i) {
            this.f6324 = true;
            this.f6327 = i;
            Drawable drawable = this.f6328;
            if (drawable == null) {
                return;
            }
            if (this.f6321 == 0) {
                drawable.setAlpha(i);
            } else {
                m4841(false);
            }
        }
    }

    public void setAutoMirrored(boolean z) {
        AbstractC1874 r0 = this.f6323;
        if (r0.f6365 != z) {
            r0.f6365 = z;
            Drawable drawable = this.f6328;
            if (drawable != null) {
                boolean z2 = r0.f6365;
                int i = Build.VERSION.SDK_INT;
                drawable.setAutoMirrored(z2);
            }
        }
    }

    public void setColorFilter(ColorFilter colorFilter) {
        AbstractC1874 r0 = this.f6323;
        r0.f6338 = true;
        if (r0.f6345 != colorFilter) {
            r0.f6345 = colorFilter;
            Drawable drawable = this.f6328;
            if (drawable != null) {
                drawable.setColorFilter(colorFilter);
            }
        }
    }

    public void setDither(boolean z) {
        AbstractC1874 r0 = this.f6323;
        if (r0.f6358 != z) {
            r0.f6358 = z;
            Drawable drawable = this.f6328;
            if (drawable != null) {
                drawable.setDither(r0.f6358);
            }
        }
    }

    public void setHotspot(float f, float f2) {
        Drawable drawable = this.f6328;
        if (drawable != null) {
            int i = Build.VERSION.SDK_INT;
            drawable.setHotspot(f, f2);
        }
    }

    public void setHotspotBounds(int i, int i2, int i3, int i4) {
        Rect rect = this.f6319;
        if (rect == null) {
            this.f6319 = new Rect(i, i2, i3, i4);
        } else {
            rect.set(i, i2, i3, i4);
        }
        Drawable drawable = this.f6328;
        if (drawable != null) {
            int i5 = Build.VERSION.SDK_INT;
            drawable.setHotspotBounds(i, i2, i3, i4);
        }
    }

    public void setTintList(ColorStateList colorStateList) {
        AbstractC1874 r0 = this.f6323;
        r0.f6341 = true;
        if (r0.f6350 != colorStateList) {
            r0.f6350 = colorStateList;
            C2369.m6329(this.f6328, colorStateList);
        }
    }

    public void setTintMode(PorterDuff.Mode mode) {
        AbstractC1874 r0 = this.f6323;
        r0.f6332 = true;
        if (r0.f6339 != mode) {
            r0.f6339 = mode;
            C2369.m6330(this.f6328, mode);
        }
    }

    public boolean setVisible(boolean z, boolean z2) {
        boolean visible = super.setVisible(z, z2);
        Drawable drawable = this.f6320;
        if (drawable != null) {
            drawable.setVisible(z, z2);
        }
        Drawable drawable2 = this.f6328;
        if (drawable2 != null) {
            drawable2.setVisible(z, z2);
        }
        return visible;
    }

    public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
        if (drawable == this.f6328 && getCallback() != null) {
            getCallback().unscheduleDrawable(this, runnable);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC1874 m4838() {
        throw null;
    }

    /* JADX WARNING: Removed duplicated region for block: B:31:0x006b  */
    /* JADX WARNING: Removed duplicated region for block: B:32:0x0073  */
    /* renamed from: K  reason: contains not printable characters */
    public boolean m4842(int i) {
        Runnable runnable;
        if (i == this.f6329) {
            return false;
        }
        long uptimeMillis = SystemClock.uptimeMillis();
        if (this.f6323.f6356 > 0) {
            Drawable drawable = this.f6320;
            if (drawable != null) {
                drawable.setVisible(false, false);
            }
            Drawable drawable2 = this.f6328;
            if (drawable2 != null) {
                this.f6320 = drawable2;
                this.f6325 = ((long) this.f6323.f6356) + uptimeMillis;
            } else {
                this.f6320 = null;
                this.f6325 = 0;
            }
        } else {
            Drawable drawable3 = this.f6328;
            if (drawable3 != null) {
                drawable3.setVisible(false, false);
            }
        }
        if (i >= 0) {
            AbstractC1874 r0 = this.f6323;
            if (i < r0.f6362) {
                Drawable r02 = r0.m4846(i);
                this.f6328 = r02;
                this.f6329 = i;
                if (r02 != null) {
                    int i2 = this.f6323.f6352;
                    if (i2 > 0) {
                        this.f6321 = uptimeMillis + ((long) i2);
                    }
                    m4839(r02);
                }
                if (!(this.f6321 == 0 && this.f6325 == 0)) {
                    runnable = this.f6326;
                    if (runnable != null) {
                        this.f6326 = new RunnableC1876();
                    } else {
                        unscheduleSelf(runnable);
                    }
                    m4841(true);
                }
                invalidateSelf();
                return true;
            }
        }
        this.f6328 = null;
        this.f6329 = -1;
        runnable = this.f6326;
        if (runnable != null) {
        }
        m4841(true);
        invalidateSelf();
        return true;
    }

    /* renamed from: ῲ.ῲ.ʬ.K.ῲ$ʬ  reason: contains not printable characters */
    /* compiled from: DrawableContainer */
    public static abstract class AbstractC1874 extends Drawable.ConstantState {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f6331 = 160;

        /* renamed from: В  reason: contains not printable characters */
        public boolean f6332;

        /* renamed from: Ԕ  reason: contains not printable characters */
        public int f6333;

        /* renamed from: Ԛ  reason: contains not printable characters */
        public boolean f6334;

        /* renamed from: ؿ  reason: contains not printable characters */
        public int f6335;

        /* renamed from: ݜ  reason: contains not printable characters */
        public int f6336;

        /* renamed from: ඓ  reason: contains not printable characters */
        public int f6337;

        /* renamed from: ᆯ  reason: contains not printable characters */
        public boolean f6338;

        /* renamed from: ሽ  reason: contains not printable characters */
        public PorterDuff.Mode f6339;

        /* renamed from: ᑓ  reason: contains not printable characters */
        public boolean f6340;

        /* renamed from: ᑾ  reason: contains not printable characters */
        public boolean f6341;

        /* renamed from: ᓆ  reason: contains not printable characters */
        public boolean f6342;

        /* renamed from: ᓣ  reason: contains not printable characters */
        public int f6343;

        /* renamed from: ᕣ  reason: contains not printable characters */
        public Rect f6344;

        /* renamed from: ᝁ  reason: contains not printable characters */
        public ColorFilter f6345;

        /* renamed from: ᨨ  reason: contains not printable characters */
        public boolean f6346;

        /* renamed from: ῲ  reason: contains not printable characters */
        public Resources f6347;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public Drawable[] f6348;

        /* renamed from: K  reason: contains not printable characters */
        public final C1873 f6349;

        /* renamed from: ⶍ  reason: contains not printable characters */
        public ColorStateList f6350;

        /* renamed from: ゎ  reason: contains not printable characters */
        public int f6351;

        /* renamed from: ト  reason: contains not printable characters */
        public int f6352;

        /* renamed from: 㑃  reason: contains not printable characters */
        public boolean f6353;

        /* renamed from: 㗗  reason: contains not printable characters */
        public int f6354;

        /* renamed from: 㗽  reason: contains not printable characters */
        public boolean f6355;

        /* renamed from: 㮔  reason: contains not printable characters */
        public int f6356;

        /* renamed from: 㳳  reason: contains not printable characters */
        public boolean f6357;

        /* renamed from: 㴪  reason: contains not printable characters */
        public boolean f6358;

        /* renamed from: 㴹  reason: contains not printable characters */
        public SparseArray<Drawable.ConstantState> f6359;

        /* renamed from: 㶋  reason: contains not printable characters */
        public boolean f6360;

        /* renamed from: 㸾  reason: contains not printable characters */
        public int f6361;

        /* renamed from: 㿎  reason: contains not printable characters */
        public int f6362;

        /* renamed from: 䀟  reason: contains not printable characters */
        public boolean f6363;

        /* renamed from: 䁗  reason: contains not printable characters */
        public boolean f6364;

        /* renamed from: 䃖  reason: contains not printable characters */
        public boolean f6365;

        public AbstractC1874(AbstractC1874 r3, C1873 r4, Resources resources) {
            Resources resources2;
            this.f6346 = false;
            this.f6353 = false;
            this.f6358 = true;
            this.f6352 = 0;
            this.f6356 = 0;
            this.f6349 = r4;
            if (resources != null) {
                resources2 = resources;
            } else {
                resources2 = r3 != null ? r3.f6347 : null;
            }
            this.f6347 = resources2;
            this.f6331 = C1873.m4837(resources, r3 != null ? r3.f6331 : 0);
            if (r3 != null) {
                this.f6361 = r3.f6361;
                this.f6337 = r3.f6337;
                this.f6360 = true;
                this.f6342 = true;
                this.f6346 = r3.f6346;
                this.f6353 = r3.f6353;
                this.f6358 = r3.f6358;
                this.f6340 = r3.f6340;
                this.f6351 = r3.f6351;
                this.f6352 = r3.f6352;
                this.f6356 = r3.f6356;
                this.f6365 = r3.f6365;
                this.f6345 = r3.f6345;
                this.f6338 = r3.f6338;
                this.f6350 = r3.f6350;
                this.f6339 = r3.f6339;
                this.f6341 = r3.f6341;
                this.f6332 = r3.f6332;
                if (r3.f6331 == this.f6331) {
                    if (r3.f6357) {
                        this.f6344 = new Rect(r3.f6344);
                        this.f6357 = true;
                    }
                    if (r3.f6364) {
                        this.f6333 = r3.f6333;
                        this.f6354 = r3.f6354;
                        this.f6335 = r3.f6335;
                        this.f6343 = r3.f6343;
                        this.f6364 = true;
                    }
                }
                if (r3.f6355) {
                    this.f6336 = r3.f6336;
                    this.f6355 = true;
                }
                if (r3.f6363) {
                    this.f6334 = r3.f6334;
                    this.f6363 = true;
                }
                Drawable[] drawableArr = r3.f6348;
                this.f6348 = new Drawable[drawableArr.length];
                this.f6362 = r3.f6362;
                SparseArray<Drawable.ConstantState> sparseArray = r3.f6359;
                if (sparseArray != null) {
                    this.f6359 = sparseArray.clone();
                } else {
                    this.f6359 = new SparseArray<>(this.f6362);
                }
                int i = this.f6362;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2] != null) {
                        Drawable.ConstantState constantState = drawableArr[i2].getConstantState();
                        if (constantState != null) {
                            this.f6359.put(i2, constantState);
                        } else {
                            this.f6348[i2] = drawableArr[i2];
                        }
                    }
                }
                return;
            }
            this.f6348 = new Drawable[10];
            this.f6362 = 0;
        }

        public boolean canApplyTheme() {
            int i = this.f6362;
            Drawable[] drawableArr = this.f6348;
            for (int i2 = 0; i2 < i; i2++) {
                Drawable drawable = drawableArr[i2];
                if (drawable == null) {
                    Drawable.ConstantState constantState = this.f6359.get(i2);
                    if (constantState != null && constantState.canApplyTheme()) {
                        return true;
                    }
                } else if (drawable.canApplyTheme()) {
                    return true;
                }
            }
            return false;
        }

        public int getChangingConfigurations() {
            return this.f6361 | this.f6337;
        }

        /* renamed from: ʬ  reason: contains not printable characters */
        public final void m4843() {
            SparseArray<Drawable.ConstantState> sparseArray = this.f6359;
            if (sparseArray != null) {
                int size = sparseArray.size();
                for (int i = 0; i < size; i++) {
                    int keyAt = this.f6359.keyAt(i);
                    Drawable[] drawableArr = this.f6348;
                    Drawable newDrawable = this.f6359.valueAt(i).newDrawable(this.f6347);
                    if (Build.VERSION.SDK_INT >= 23) {
                        newDrawable.setLayoutDirection(this.f6351);
                    }
                    Drawable mutate = newDrawable.mutate();
                    mutate.setCallback(this.f6349);
                    drawableArr[keyAt] = mutate;
                }
                this.f6359 = null;
            }
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public void m4844() {
            this.f6364 = true;
            m4843();
            int i = this.f6362;
            Drawable[] drawableArr = this.f6348;
            this.f6354 = -1;
            this.f6333 = -1;
            this.f6343 = 0;
            this.f6335 = 0;
            for (int i2 = 0; i2 < i; i2++) {
                Drawable drawable = drawableArr[i2];
                int intrinsicWidth = drawable.getIntrinsicWidth();
                if (intrinsicWidth > this.f6333) {
                    this.f6333 = intrinsicWidth;
                }
                int intrinsicHeight = drawable.getIntrinsicHeight();
                if (intrinsicHeight > this.f6354) {
                    this.f6354 = intrinsicHeight;
                }
                int minimumWidth = drawable.getMinimumWidth();
                if (minimumWidth > this.f6335) {
                    this.f6335 = minimumWidth;
                }
                int minimumHeight = drawable.getMinimumHeight();
                if (minimumHeight > this.f6343) {
                    this.f6343 = minimumHeight;
                }
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public final int m4845(Drawable drawable) {
            int i = this.f6362;
            if (i >= this.f6348.length) {
                m4847(i, i + 10);
            }
            drawable.mutate();
            drawable.setVisible(false, true);
            drawable.setCallback(this.f6349);
            this.f6348[i] = drawable;
            this.f6362++;
            this.f6337 = drawable.getChangingConfigurations() | this.f6337;
            this.f6355 = false;
            this.f6363 = false;
            this.f6344 = null;
            this.f6357 = false;
            this.f6364 = false;
            this.f6360 = false;
            return i;
        }

        /* renamed from: 㸾  reason: contains not printable characters */
        public abstract void m4851();

        /* renamed from: K  reason: contains not printable characters */
        public final Drawable m4846(int i) {
            int indexOfKey;
            Drawable drawable = this.f6348[i];
            if (drawable != null) {
                return drawable;
            }
            SparseArray<Drawable.ConstantState> sparseArray = this.f6359;
            if (sparseArray == null || (indexOfKey = sparseArray.indexOfKey(i)) < 0) {
                return null;
            }
            Drawable newDrawable = this.f6359.valueAt(indexOfKey).newDrawable(this.f6347);
            if (Build.VERSION.SDK_INT >= 23) {
                newDrawable.setLayoutDirection(this.f6351);
            }
            Drawable mutate = newDrawable.mutate();
            mutate.setCallback(this.f6349);
            this.f6348[i] = mutate;
            this.f6359.removeAt(indexOfKey);
            if (this.f6359.size() == 0) {
                this.f6359 = null;
            }
            return mutate;
        }

        /* renamed from: K  reason: contains not printable characters */
        public final void m4849(Resources resources) {
            if (resources != null) {
                this.f6347 = resources;
                int r2 = C1873.m4837(resources, this.f6331);
                int i = this.f6331;
                this.f6331 = r2;
                if (i != r2) {
                    this.f6364 = false;
                    this.f6357 = false;
                }
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public final void m4848(Resources.Theme theme) {
            if (theme != null) {
                m4843();
                int i = this.f6362;
                Drawable[] drawableArr = this.f6348;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2] != null && drawableArr[i2].canApplyTheme()) {
                        drawableArr[i2].applyTheme(theme);
                        this.f6337 |= drawableArr[i2].getChangingConfigurations();
                    }
                }
                m4849(theme.getResources());
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m4847(int i, int i2) {
            Drawable[] drawableArr = new Drawable[i2];
            System.arraycopy(this.f6348, 0, drawableArr, 0, i);
            this.f6348 = drawableArr;
        }

        /* renamed from: K  reason: contains not printable characters */
        public synchronized boolean m4850() {
            if (this.f6360) {
                return this.f6342;
            }
            m4843();
            this.f6360 = true;
            int i = this.f6362;
            Drawable[] drawableArr = this.f6348;
            for (int i2 = 0; i2 < i; i2++) {
                if (drawableArr[i2].getConstantState() == null) {
                    this.f6342 = false;
                    return false;
                }
            }
            this.f6342 = true;
            return true;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m4839(Drawable drawable) {
        if (this.f6330 == null) {
            this.f6330 = new C1875();
        }
        C1875 r0 = this.f6330;
        r0.f6366 = drawable.getCallback();
        drawable.setCallback(r0);
        try {
            if (this.f6323.f6352 <= 0 && this.f6324) {
                drawable.setAlpha(this.f6327);
            }
            if (this.f6323.f6338) {
                drawable.setColorFilter(this.f6323.f6345);
            } else {
                if (this.f6323.f6341) {
                    ColorStateList colorStateList = this.f6323.f6350;
                    int i = Build.VERSION.SDK_INT;
                    drawable.setTintList(colorStateList);
                }
                if (this.f6323.f6332) {
                    PorterDuff.Mode mode = this.f6323.f6339;
                    int i2 = Build.VERSION.SDK_INT;
                    drawable.setTintMode(mode);
                }
            }
            drawable.setVisible(isVisible(), true);
            drawable.setDither(this.f6323.f6358);
            drawable.setState(getState());
            drawable.setLevel(getLevel());
            drawable.setBounds(getBounds());
            if (Build.VERSION.SDK_INT >= 23) {
                drawable.setLayoutDirection(getLayoutDirection());
            }
            int i3 = Build.VERSION.SDK_INT;
            drawable.setAutoMirrored(this.f6323.f6365);
            Rect rect = this.f6319;
            int i4 = Build.VERSION.SDK_INT;
            if (rect != null) {
                drawable.setHotspotBounds(rect.left, rect.top, rect.right, rect.bottom);
            }
        } finally {
            C1875 r2 = this.f6330;
            Drawable.Callback callback = r2.f6366;
            r2.f6366 = null;
            drawable.setCallback(callback);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:12:0x003f  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x0065  */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x006a A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:24:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */
    /* renamed from: K  reason: contains not printable characters */
    public void m4841(boolean z) {
        boolean z2;
        Drawable drawable;
        boolean z3 = true;
        this.f6324 = true;
        long uptimeMillis = SystemClock.uptimeMillis();
        Drawable drawable2 = this.f6328;
        if (drawable2 != null) {
            long j = this.f6321;
            if (j != 0) {
                if (j <= uptimeMillis) {
                    drawable2.setAlpha(this.f6327);
                    this.f6321 = 0;
                } else {
                    drawable2.setAlpha(((255 - (((int) ((j - uptimeMillis) * 255)) / this.f6323.f6352)) * this.f6327) / BaseProgressIndicator.MAX_ALPHA);
                    z2 = true;
                    drawable = this.f6320;
                    if (drawable == null) {
                        long j2 = this.f6325;
                        if (j2 != 0) {
                            if (j2 <= uptimeMillis) {
                                drawable.setVisible(false, false);
                                this.f6320 = null;
                                this.f6325 = 0;
                            } else {
                                drawable.setAlpha(((((int) ((j2 - uptimeMillis) * 255)) / this.f6323.f6356) * this.f6327) / BaseProgressIndicator.MAX_ALPHA);
                                if (!z && z3) {
                                    scheduleSelf(this.f6326, uptimeMillis + 16);
                                    return;
                                }
                                return;
                            }
                        }
                    } else {
                        this.f6325 = 0;
                    }
                    z3 = z2;
                    if (!z) {
                        return;
                    }
                    return;
                }
            }
        } else {
            this.f6321 = 0;
        }
        z2 = false;
        drawable = this.f6320;
        if (drawable == null) {
        }
        z3 = z2;
        if (!z) {
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4840(AbstractC1874 r2) {
        this.f6323 = r2;
        int i = this.f6329;
        if (i >= 0) {
            this.f6328 = r2.m4846(i);
            Drawable drawable = this.f6328;
            if (drawable != null) {
                m4839(drawable);
            }
        }
        this.f6320 = null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m4837(Resources resources, int i) {
        if (resources != null) {
            i = resources.getDisplayMetrics().densityDpi;
        }
        if (i == 0) {
            return 160;
        }
        return i;
    }
}
