package p037.p041.p045.p046;

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 p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p041.p045.p046.C1542;

/* JADX INFO: renamed from: މ.ؠ.ފ.֏.ؠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1537 extends Drawable implements Drawable.Callback {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public AbstractC1540 f4868;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public Rect f4869;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public Drawable f4870;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public Drawable f4871;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public boolean f4873;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public boolean f4875;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public Runnable f4876;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public long f4877;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public long f4878;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public C1539 f4879;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public int f4872 = 255;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public int f4874 = -1;

    /* JADX INFO: renamed from: މ.ؠ.ފ.֏.ؠ$֏, reason: contains not printable characters */
    public class RunnableC1538 implements Runnable {
        public RunnableC1538() {
        }

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

    /* JADX INFO: renamed from: މ.ؠ.ފ.֏.ؠ$ؠ, reason: contains not printable characters */
    public static class C1539 implements Drawable.Callback {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public Drawable.Callback f4881;

        @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.f4881;
            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.f4881;
            if (callback != null) {
                callback.unscheduleDrawable(drawable, runnable);
            }
        }
    }

    /* JADX INFO: renamed from: މ.ؠ.ފ.֏.ؠ$ހ, reason: contains not printable characters */
    public static abstract class AbstractC1540 extends Drawable.ConstantState {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C1537 f4882;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public Resources f4883;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public int f4884;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public int f4885;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public int f4886;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public SparseArray<Drawable.ConstantState> f4887;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public Drawable[] f4888;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public int f4889;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public boolean f4890;

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public boolean f4891;

        /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
        public Rect f4892;

        /* JADX INFO: renamed from: މ, reason: contains not printable characters */
        public boolean f4893;

        /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
        public boolean f4894;

        /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
        public int f4895;

        /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
        public int f4896;

        /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
        public int f4897;

        /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
        public int f4898;

        /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
        public boolean f4899;

        /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
        public int f4900;

        /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
        public boolean f4901;

        /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
        public boolean f4902;

        /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
        public boolean f4903;

        /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
        public boolean f4904;

        /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
        public boolean f4905;

        /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
        public boolean f4906;

        /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
        public int f4907;

        /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
        public int f4908;

        /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
        public int f4909;

        /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
        public boolean f4910;

        /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
        public ColorFilter f4911;

        /* JADX INFO: renamed from: ޜ, reason: contains not printable characters */
        public boolean f4912;

        /* JADX INFO: renamed from: ޝ, reason: contains not printable characters */
        public ColorStateList f4913;

        /* JADX INFO: renamed from: ޞ, reason: contains not printable characters */
        public PorterDuff.Mode f4914;

        /* JADX INFO: renamed from: ޟ, reason: contains not printable characters */
        public boolean f4915;

        /* JADX INFO: renamed from: ޠ, reason: contains not printable characters */
        public boolean f4916;

        public AbstractC1540(AbstractC1540 abstractC1540, C1537 c1537, Resources resources) {
            this.f4884 = 160;
            this.f4890 = false;
            this.f4893 = false;
            this.f4905 = true;
            this.f4908 = 0;
            this.f4909 = 0;
            this.f4882 = c1537;
            this.f4883 = resources != null ? resources : abstractC1540 != null ? abstractC1540.f4883 : null;
            int iM3038 = C1537.m3038(resources, abstractC1540 != null ? abstractC1540.f4884 : 0);
            this.f4884 = iM3038;
            if (abstractC1540 == null) {
                this.f4888 = new Drawable[10];
                this.f4889 = 0;
                return;
            }
            this.f4885 = abstractC1540.f4885;
            this.f4886 = abstractC1540.f4886;
            this.f4903 = true;
            this.f4904 = true;
            this.f4890 = abstractC1540.f4890;
            this.f4893 = abstractC1540.f4893;
            this.f4905 = abstractC1540.f4905;
            this.f4906 = abstractC1540.f4906;
            this.f4907 = abstractC1540.f4907;
            this.f4908 = abstractC1540.f4908;
            this.f4909 = abstractC1540.f4909;
            this.f4910 = abstractC1540.f4910;
            this.f4911 = abstractC1540.f4911;
            this.f4912 = abstractC1540.f4912;
            this.f4913 = abstractC1540.f4913;
            this.f4914 = abstractC1540.f4914;
            this.f4915 = abstractC1540.f4915;
            this.f4916 = abstractC1540.f4916;
            if (abstractC1540.f4884 == iM3038) {
                if (abstractC1540.f4891) {
                    this.f4892 = new Rect(abstractC1540.f4892);
                    this.f4891 = true;
                }
                if (abstractC1540.f4894) {
                    this.f4895 = abstractC1540.f4895;
                    this.f4896 = abstractC1540.f4896;
                    this.f4897 = abstractC1540.f4897;
                    this.f4898 = abstractC1540.f4898;
                    this.f4894 = true;
                }
            }
            if (abstractC1540.f4899) {
                this.f4900 = abstractC1540.f4900;
                this.f4899 = true;
            }
            if (abstractC1540.f4901) {
                this.f4902 = abstractC1540.f4902;
                this.f4901 = true;
            }
            Drawable[] drawableArr = abstractC1540.f4888;
            this.f4888 = new Drawable[drawableArr.length];
            this.f4889 = abstractC1540.f4889;
            SparseArray<Drawable.ConstantState> sparseArray = abstractC1540.f4887;
            if (sparseArray != null) {
                this.f4887 = sparseArray.clone();
            } else {
                this.f4887 = new SparseArray<>(this.f4889);
            }
            int i = this.f4889;
            for (int i2 = 0; i2 < i; i2++) {
                if (drawableArr[i2] != null) {
                    Drawable.ConstantState constantState = drawableArr[i2].getConstantState();
                    if (constantState != null) {
                        this.f4887.put(i2, constantState);
                    } else {
                        this.f4888[i2] = drawableArr[i2];
                    }
                }
            }
        }

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

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

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final int m3042(Drawable drawable) {
            int i = this.f4889;
            if (i >= this.f4888.length) {
                int i2 = i + 10;
                C1542.C1543 c1543 = (C1542.C1543) this;
                Drawable[] drawableArr = new Drawable[i2];
                System.arraycopy(c1543.f4888, 0, drawableArr, 0, i);
                c1543.f4888 = drawableArr;
                int[][] iArr = new int[i2][];
                System.arraycopy(c1543.f4920, 0, iArr, 0, i);
                c1543.f4920 = iArr;
            }
            drawable.mutate();
            drawable.setVisible(false, true);
            drawable.setCallback(this.f4882);
            this.f4888[i] = drawable;
            this.f4889++;
            this.f4886 = drawable.getChangingConfigurations() | this.f4886;
            this.f4899 = false;
            this.f4901 = false;
            this.f4892 = null;
            this.f4891 = false;
            this.f4894 = false;
            this.f4903 = false;
            return i;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final Drawable m3043(int i) {
            int iIndexOfKey;
            Drawable drawable = this.f4888[i];
            if (drawable != null) {
                return drawable;
            }
            SparseArray<Drawable.ConstantState> sparseArray = this.f4887;
            if (sparseArray == null || (iIndexOfKey = sparseArray.indexOfKey(i)) < 0) {
                return null;
            }
            Drawable drawableNewDrawable = this.f4887.valueAt(iIndexOfKey).newDrawable(this.f4883);
            if (Build.VERSION.SDK_INT >= 23) {
                drawableNewDrawable.setLayoutDirection(this.f4907);
            }
            Drawable drawableMutate = drawableNewDrawable.mutate();
            drawableMutate.setCallback(this.f4882);
            this.f4888[i] = drawableMutate;
            this.f4887.removeAt(iIndexOfKey);
            if (this.f4887.size() == 0) {
                this.f4887 = null;
            }
            return drawableMutate;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final void m3044(Resources resources) {
            if (resources != null) {
                this.f4883 = resources;
                int iM3038 = C1537.m3038(resources, this.f4884);
                int i = this.f4884;
                this.f4884 = iM3038;
                if (i != iM3038) {
                    this.f4894 = false;
                    this.f4891 = false;
                }
            }
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public synchronized boolean m3045() {
            if (this.f4903) {
                return this.f4904;
            }
            m3047();
            this.f4903 = true;
            int i = this.f4889;
            Drawable[] drawableArr = this.f4888;
            for (int i2 = 0; i2 < i; i2++) {
                if (drawableArr[i2].getConstantState() == null) {
                    this.f4904 = false;
                    return false;
                }
            }
            this.f4904 = true;
            return true;
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void m3046() {
            this.f4894 = true;
            m3047();
            int i = this.f4889;
            Drawable[] drawableArr = this.f4888;
            this.f4896 = -1;
            this.f4895 = -1;
            this.f4898 = 0;
            this.f4897 = 0;
            for (int i2 = 0; i2 < i; i2++) {
                Drawable drawable = drawableArr[i2];
                int intrinsicWidth = drawable.getIntrinsicWidth();
                if (intrinsicWidth > this.f4895) {
                    this.f4895 = intrinsicWidth;
                }
                int intrinsicHeight = drawable.getIntrinsicHeight();
                if (intrinsicHeight > this.f4896) {
                    this.f4896 = intrinsicHeight;
                }
                int minimumWidth = drawable.getMinimumWidth();
                if (minimumWidth > this.f4897) {
                    this.f4897 = minimumWidth;
                }
                int minimumHeight = drawable.getMinimumHeight();
                if (minimumHeight > this.f4898) {
                    this.f4898 = minimumHeight;
                }
            }
        }

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final void m3047() {
            SparseArray<Drawable.ConstantState> sparseArray = this.f4887;
            if (sparseArray != null) {
                int size = sparseArray.size();
                for (int i = 0; i < size; i++) {
                    int iKeyAt = this.f4887.keyAt(i);
                    Drawable.ConstantState constantStateValueAt = this.f4887.valueAt(i);
                    Drawable[] drawableArr = this.f4888;
                    Drawable drawableNewDrawable = constantStateValueAt.newDrawable(this.f4883);
                    if (Build.VERSION.SDK_INT >= 23) {
                        drawableNewDrawable.setLayoutDirection(this.f4907);
                    }
                    Drawable drawableMutate = drawableNewDrawable.mutate();
                    drawableMutate.setCallback(this.f4882);
                    drawableArr[iKeyAt] = drawableMutate;
                }
                this.f4887 = null;
            }
        }

        /* JADX INFO: renamed from: ށ */
        public abstract void mo3035();
    }

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

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

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

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

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

    @Override // android.graphics.drawable.Drawable
    public final Drawable.ConstantState getConstantState() {
        if (!this.f4868.m3045()) {
            return null;
        }
        this.f4868.f4885 = getChangingConfigurations();
        return this.f4868;
    }

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

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

    @Override // android.graphics.drawable.Drawable
    public int getIntrinsicHeight() {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4893) {
            if (!abstractC1540.f4894) {
                abstractC1540.m3046();
            }
            return abstractC1540.f4896;
        }
        Drawable drawable = this.f4870;
        if (drawable != null) {
            return drawable.getIntrinsicHeight();
        }
        return -1;
    }

    @Override // android.graphics.drawable.Drawable
    public int getIntrinsicWidth() {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4893) {
            if (!abstractC1540.f4894) {
                abstractC1540.m3046();
            }
            return abstractC1540.f4895;
        }
        Drawable drawable = this.f4870;
        if (drawable != null) {
            return drawable.getIntrinsicWidth();
        }
        return -1;
    }

    @Override // android.graphics.drawable.Drawable
    public int getMinimumHeight() {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4893) {
            if (!abstractC1540.f4894) {
                abstractC1540.m3046();
            }
            return abstractC1540.f4898;
        }
        Drawable drawable = this.f4870;
        if (drawable != null) {
            return drawable.getMinimumHeight();
        }
        return 0;
    }

    @Override // android.graphics.drawable.Drawable
    public int getMinimumWidth() {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4893) {
            if (!abstractC1540.f4894) {
                abstractC1540.m3046();
            }
            return abstractC1540.f4897;
        }
        Drawable drawable = this.f4870;
        if (drawable != null) {
            return drawable.getMinimumWidth();
        }
        return 0;
    }

    @Override // android.graphics.drawable.Drawable
    public int getOpacity() {
        Drawable drawable = this.f4870;
        if (drawable == null || !drawable.isVisible()) {
            return -2;
        }
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4899) {
            return abstractC1540.f4900;
        }
        abstractC1540.m3047();
        int i = abstractC1540.f4889;
        Drawable[] drawableArr = abstractC1540.f4888;
        int opacity = i > 0 ? drawableArr[0].getOpacity() : -2;
        for (int i2 = 1; i2 < i; i2++) {
            opacity = Drawable.resolveOpacity(opacity, drawableArr[i2].getOpacity());
        }
        abstractC1540.f4900 = opacity;
        abstractC1540.f4899 = true;
        return opacity;
    }

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

    @Override // android.graphics.drawable.Drawable
    public boolean getPadding(Rect rect) {
        boolean padding;
        AbstractC1540 abstractC1540 = this.f4868;
        Rect rect2 = null;
        if (!abstractC1540.f4890) {
            if (abstractC1540.f4892 != null || abstractC1540.f4891) {
                rect2 = abstractC1540.f4892;
            } else {
                abstractC1540.m3047();
                Rect rect3 = new Rect();
                int i = abstractC1540.f4889;
                Drawable[] drawableArr = abstractC1540.f4888;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2].getPadding(rect3)) {
                        if (rect2 == null) {
                            rect2 = new Rect(0, 0, 0, 0);
                        }
                        int i3 = rect3.left;
                        if (i3 > rect2.left) {
                            rect2.left = i3;
                        }
                        int i4 = rect3.top;
                        if (i4 > rect2.top) {
                            rect2.top = i4;
                        }
                        int i5 = rect3.right;
                        if (i5 > rect2.right) {
                            rect2.right = i5;
                        }
                        int i6 = rect3.bottom;
                        if (i6 > rect2.bottom) {
                            rect2.bottom = i6;
                        }
                    }
                }
                abstractC1540.f4891 = true;
                abstractC1540.f4892 = rect2;
            }
        }
        if (rect2 != null) {
            rect.set(rect2);
            padding = (((rect2.left | rect2.top) | rect2.bottom) | rect2.right) != 0;
        } else {
            Drawable drawable = this.f4870;
            padding = drawable != null ? drawable.getPadding(rect) : super.getPadding(rect);
        }
        if (this.f4868.f4910 && LayoutInflaterFactory2C1494.C1505.m2876((Drawable) this) == 1) {
            int i7 = rect.left;
            rect.left = rect.right;
            rect.right = i7;
        }
        return padding;
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public void invalidateDrawable(Drawable drawable) {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540 != null) {
            abstractC1540.f4899 = false;
            abstractC1540.f4901 = false;
        }
        if (drawable != this.f4870 || getCallback() == null) {
            return;
        }
        getCallback().invalidateDrawable(this);
    }

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

    @Override // android.graphics.drawable.Drawable
    public void jumpToCurrentState() {
        boolean z;
        Drawable drawable = this.f4871;
        boolean z2 = true;
        if (drawable != null) {
            drawable.jumpToCurrentState();
            this.f4871 = null;
            z = true;
        } else {
            z = false;
        }
        Drawable drawable2 = this.f4870;
        if (drawable2 != null) {
            drawable2.jumpToCurrentState();
            if (this.f4873) {
                this.f4870.setAlpha(this.f4872);
            }
        }
        if (this.f4878 != 0) {
            this.f4878 = 0L;
            z = true;
        }
        if (this.f4877 != 0) {
            this.f4877 = 0L;
        } else {
            z2 = z;
        }
        if (z2) {
            invalidateSelf();
        }
    }

    @Override // android.graphics.drawable.Drawable
    public Drawable mutate() {
        if (!this.f4875 && super.mutate() == this) {
            AbstractC1540 abstractC1540Mo3027 = mo3027();
            abstractC1540Mo3027.mo3035();
            mo3028(abstractC1540Mo3027);
            this.f4875 = true;
        }
        return this;
    }

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

    @Override // android.graphics.drawable.Drawable
    public boolean onLayoutDirectionChanged(int i) {
        AbstractC1540 abstractC1540 = this.f4868;
        int i2 = this.f4874;
        int i3 = abstractC1540.f4889;
        Drawable[] drawableArr = abstractC1540.f4888;
        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;
                }
            }
        }
        abstractC1540.f4907 = i;
        return z;
    }

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

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

    @Override // android.graphics.drawable.Drawable
    public void setAlpha(int i) {
        if (this.f4873 && this.f4872 == i) {
            return;
        }
        this.f4873 = true;
        this.f4872 = i;
        Drawable drawable = this.f4870;
        if (drawable != null) {
            if (this.f4877 == 0) {
                drawable.setAlpha(i);
            } else {
                m3040(false);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setAutoMirrored(boolean z) {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4910 != z) {
            abstractC1540.f4910 = z;
            Drawable drawable = this.f4870;
            if (drawable != null) {
                drawable.setAutoMirrored(z);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setColorFilter(ColorFilter colorFilter) {
        AbstractC1540 abstractC1540 = this.f4868;
        abstractC1540.f4912 = true;
        if (abstractC1540.f4911 != colorFilter) {
            abstractC1540.f4911 = colorFilter;
            Drawable drawable = this.f4870;
            if (drawable != null) {
                drawable.setColorFilter(colorFilter);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setDither(boolean z) {
        AbstractC1540 abstractC1540 = this.f4868;
        if (abstractC1540.f4905 != z) {
            abstractC1540.f4905 = z;
            Drawable drawable = this.f4870;
            if (drawable != null) {
                drawable.setDither(z);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setHotspot(float f, float f2) {
        Drawable drawable = this.f4870;
        if (drawable != null) {
            drawable.setHotspot(f, f2);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setHotspotBounds(int i, int i2, int i3, int i4) {
        Rect rect = this.f4869;
        if (rect == null) {
            this.f4869 = new Rect(i, i2, i3, i4);
        } else {
            rect.set(i, i2, i3, i4);
        }
        Drawable drawable = this.f4870;
        if (drawable != null) {
            drawable.setHotspotBounds(i, i2, i3, i4);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setTintList(ColorStateList colorStateList) {
        AbstractC1540 abstractC1540 = this.f4868;
        abstractC1540.f4915 = true;
        if (abstractC1540.f4913 != colorStateList) {
            abstractC1540.f4913 = colorStateList;
            LayoutInflaterFactory2C1494.C1505.m2940(this.f4870, colorStateList);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void setTintMode(PorterDuff.Mode mode) {
        AbstractC1540 abstractC1540 = this.f4868;
        abstractC1540.f4916 = true;
        if (abstractC1540.f4914 != mode) {
            abstractC1540.f4914 = mode;
            LayoutInflaterFactory2C1494.C1505.m2941(this.f4870, mode);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public boolean setVisible(boolean z, boolean z2) {
        boolean visible = super.setVisible(z, z2);
        Drawable drawable = this.f4871;
        if (drawable != null) {
            drawable.setVisible(z, z2);
        }
        Drawable drawable2 = this.f4870;
        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.f4870 || getCallback() == null) {
            return;
        }
        getCallback().unscheduleDrawable(this, runnable);
    }

    /* JADX INFO: renamed from: ֏ */
    public AbstractC1540 mo3027() {
        throw null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m3039(Drawable drawable) {
        if (this.f4879 == null) {
            this.f4879 = new C1539();
        }
        C1539 c1539 = this.f4879;
        c1539.f4881 = drawable.getCallback();
        drawable.setCallback(c1539);
        try {
            if (this.f4868.f4908 <= 0 && this.f4873) {
                drawable.setAlpha(this.f4872);
            }
            if (this.f4868.f4912) {
                drawable.setColorFilter(this.f4868.f4911);
            } else {
                if (this.f4868.f4915) {
                    drawable.setTintList(this.f4868.f4913);
                }
                if (this.f4868.f4916) {
                    drawable.setTintMode(this.f4868.f4914);
                }
            }
            drawable.setVisible(isVisible(), true);
            drawable.setDither(this.f4868.f4905);
            drawable.setState(getState());
            drawable.setLevel(getLevel());
            drawable.setBounds(getBounds());
            if (Build.VERSION.SDK_INT >= 23) {
                drawable.setLayoutDirection(getLayoutDirection());
            }
            drawable.setAutoMirrored(this.f4868.f4910);
            Rect rect = this.f4869;
            if (rect != null) {
                drawable.setHotspotBounds(rect.left, rect.top, rect.right, rect.bottom);
            }
        } finally {
            C1539 c15392 = this.f4879;
            Drawable.Callback callback = c15392.f4881;
            c15392.f4881 = null;
            drawable.setCallback(callback);
        }
    }

    /* JADX INFO: renamed from: ֏ */
    public void mo3028(AbstractC1540 abstractC1540) {
        this.f4868 = abstractC1540;
        int i = this.f4874;
        if (i >= 0) {
            Drawable drawableM3043 = abstractC1540.m3043(i);
            this.f4870 = drawableM3043;
            if (drawableM3043 != null) {
                m3039(drawableM3043);
            }
        }
        this.f4871 = null;
    }

    /* 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] */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void m3040(boolean z) {
        boolean z2;
        Drawable drawable;
        boolean z3 = true;
        this.f4873 = true;
        long jUptimeMillis = SystemClock.uptimeMillis();
        Drawable drawable2 = this.f4870;
        if (drawable2 != null) {
            long j = this.f4877;
            if (j != 0) {
                if (j <= jUptimeMillis) {
                    drawable2.setAlpha(this.f4872);
                    this.f4877 = 0L;
                } else {
                    drawable2.setAlpha(((255 - (((int) ((j - jUptimeMillis) * 255)) / this.f4868.f4908)) * this.f4872) / 255);
                    z2 = true;
                }
            }
            drawable = this.f4871;
            if (drawable == null) {
                long j2 = this.f4878;
                if (j2 != 0) {
                    if (j2 <= jUptimeMillis) {
                        drawable.setVisible(false, false);
                        this.f4871 = null;
                        this.f4878 = 0L;
                    } else {
                        drawable.setAlpha(((((int) ((j2 - jUptimeMillis) * 255)) / this.f4868.f4909) * this.f4872) / 255);
                    }
                }
                if (z && z3) {
                    scheduleSelf(this.f4876, jUptimeMillis + 16);
                    return;
                }
                return;
            }
            this.f4878 = 0L;
            z3 = z2;
            if (z) {
                return;
            } else {
                return;
            }
        }
        this.f4877 = 0L;
        z2 = false;
        drawable = this.f4871;
        if (drawable == null) {
        }
        z3 = z2;
        if (z) {
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:26:0x0055  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean m3041(int i) {
        if (i == this.f4874) {
            return false;
        }
        long jUptimeMillis = SystemClock.uptimeMillis();
        if (this.f4868.f4909 > 0) {
            Drawable drawable = this.f4871;
            if (drawable != null) {
                drawable.setVisible(false, false);
            }
            Drawable drawable2 = this.f4870;
            if (drawable2 != null) {
                this.f4871 = drawable2;
                this.f4878 = ((long) this.f4868.f4909) + jUptimeMillis;
            } else {
                this.f4871 = null;
                this.f4878 = 0L;
            }
        } else {
            Drawable drawable3 = this.f4870;
            if (drawable3 != null) {
                drawable3.setVisible(false, false);
            }
        }
        if (i >= 0) {
            AbstractC1540 abstractC1540 = this.f4868;
            if (i < abstractC1540.f4889) {
                Drawable drawableM3043 = abstractC1540.m3043(i);
                this.f4870 = drawableM3043;
                this.f4874 = i;
                if (drawableM3043 != null) {
                    int i2 = this.f4868.f4908;
                    if (i2 > 0) {
                        this.f4877 = jUptimeMillis + ((long) i2);
                    }
                    m3039(drawableM3043);
                }
            } else {
                this.f4870 = null;
                this.f4874 = -1;
            }
        }
        if (this.f4877 != 0 || this.f4878 != 0) {
            Runnable runnable = this.f4876;
            if (runnable == null) {
                this.f4876 = new RunnableC1538();
            } else {
                unscheduleSelf(runnable);
            }
            m3040(true);
        }
        invalidateSelf();
        return true;
    }
}
