package defpackage;

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.SystemClock;
import android.util.SparseArray;
import defpackage.k49;

/* JADX INFO: loaded from: classes.dex */
public class if2 extends Drawable implements Drawable.Callback {
    public static final /* synthetic */ int o = 0;
    public c a;
    public Rect b;
    public Drawable c;
    public Drawable d;
    public boolean f;
    public boolean j;
    public Runnable k;
    public long l;
    public long m;
    public b n;
    public int e = 255;
    public int i = -1;

    @l18
    public static class a {
    }

    public static class b implements Drawable.Callback {
        public Drawable.Callback a;

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

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

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

    public static abstract class c extends Drawable.ConstantState {
        public final k49 a;
        public final int aa;
        public boolean ab;
        public ColorFilter ac;
        public boolean ad;
        public ColorStateList ae;
        public PorterDuff.Mode af;
        public boolean ag;
        public boolean ah;
        public Resources b;
        public int c;
        public int d;
        public int e;
        public SparseArray f;
        public final Drawable[] g;
        public final int h;
        public final boolean i;
        public boolean j;
        public Rect k;
        public final boolean l;
        public boolean m;
        public int n;
        public int o;
        public int p;
        public int q;
        public boolean r;
        public int s;
        public boolean t;
        public boolean u;
        public boolean v;
        public boolean w;
        public boolean x;
        public int y;
        public final int z;

        public c(k49.a aVar, k49 k49Var, Resources resources) {
            this.i = false;
            this.l = false;
            this.x = true;
            this.z = 0;
            this.aa = 0;
            this.a = k49Var;
            this.b = resources != null ? resources : aVar != null ? aVar.b : null;
            int i = aVar != null ? aVar.c : 0;
            int i2 = if2.o;
            i = resources != null ? resources.getDisplayMetrics().densityDpi : i;
            i = i == 0 ? 160 : i;
            this.c = i;
            if (aVar == null) {
                this.g = new Drawable[10];
                this.h = 0;
                return;
            }
            this.d = aVar.d;
            this.e = aVar.e;
            this.v = true;
            this.w = true;
            this.i = aVar.i;
            this.l = aVar.l;
            this.x = aVar.x;
            this.y = aVar.y;
            this.z = aVar.z;
            this.aa = aVar.aa;
            this.ab = aVar.ab;
            this.ac = aVar.ac;
            this.ad = aVar.ad;
            this.ae = aVar.ae;
            this.af = aVar.af;
            this.ag = aVar.ag;
            this.ah = aVar.ah;
            if (aVar.c == i) {
                if (aVar.j) {
                    this.k = aVar.k != null ? new Rect(aVar.k) : null;
                    this.j = true;
                }
                if (aVar.m) {
                    this.n = aVar.n;
                    this.o = aVar.o;
                    this.p = aVar.p;
                    this.q = aVar.q;
                    this.m = true;
                }
            }
            if (aVar.r) {
                this.s = aVar.s;
                this.r = true;
            }
            if (aVar.t) {
                this.u = aVar.u;
                this.t = true;
            }
            Drawable[] drawableArr = aVar.g;
            this.g = new Drawable[drawableArr.length];
            this.h = aVar.h;
            SparseArray sparseArray = aVar.f;
            if (sparseArray != null) {
                this.f = sparseArray.clone();
            } else {
                this.f = new SparseArray(this.h);
            }
            int i3 = this.h;
            for (int i4 = 0; i4 < i3; i4++) {
                Drawable drawable = drawableArr[i4];
                if (drawable != null) {
                    Drawable.ConstantState constantState = drawable.getConstantState();
                    if (constantState != null) {
                        this.f.put(i4, constantState);
                    } else {
                        this.g[i4] = drawableArr[i4];
                    }
                }
            }
        }

        public final void a() {
            this.m = true;
            b();
            this.o = -1;
            this.n = -1;
            this.q = 0;
            this.p = 0;
            for (int i = 0; i < this.h; i++) {
                Drawable drawable = this.g[i];
                int intrinsicWidth = drawable.getIntrinsicWidth();
                if (intrinsicWidth > this.n) {
                    this.n = intrinsicWidth;
                }
                int intrinsicHeight = drawable.getIntrinsicHeight();
                if (intrinsicHeight > this.o) {
                    this.o = intrinsicHeight;
                }
                int minimumWidth = drawable.getMinimumWidth();
                if (minimumWidth > this.p) {
                    this.p = minimumWidth;
                }
                int minimumHeight = drawable.getMinimumHeight();
                if (minimumHeight > this.q) {
                    this.q = minimumHeight;
                }
            }
        }

        public final void b() {
            SparseArray sparseArray = this.f;
            if (sparseArray != null) {
                int size = sparseArray.size();
                for (int i = 0; i < size; i++) {
                    int iKeyAt = this.f.keyAt(i);
                    Drawable drawableNewDrawable = ((Drawable.ConstantState) this.f.valueAt(i)).newDrawable(this.b);
                    drawableNewDrawable.setLayoutDirection(this.y);
                    Drawable drawableMutate = drawableNewDrawable.mutate();
                    drawableMutate.setCallback(this.a);
                    this.g[iKeyAt] = drawableMutate;
                }
                this.f = null;
            }
        }

        public final Drawable c(int i) {
            int iIndexOfKey;
            Drawable drawable = this.g[i];
            if (drawable != null) {
                return drawable;
            }
            SparseArray sparseArray = this.f;
            if (sparseArray == null || (iIndexOfKey = sparseArray.indexOfKey(i)) < 0) {
                return null;
            }
            Drawable drawableNewDrawable = ((Drawable.ConstantState) this.f.valueAt(iIndexOfKey)).newDrawable(this.b);
            drawableNewDrawable.setLayoutDirection(this.y);
            Drawable drawableMutate = drawableNewDrawable.mutate();
            drawableMutate.setCallback(this.a);
            this.g[i] = drawableMutate;
            this.f.removeAt(iIndexOfKey);
            if (this.f.size() == 0) {
                this.f = null;
            }
            return drawableMutate;
        }

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

        public void d() {
            for (int i = 0; i < this.h; i++) {
                Drawable drawable = this.g[i];
                if (drawable != null) {
                    drawable.mutate();
                }
            }
        }

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

    /* JADX WARN: Removed duplicated region for block: B:14:0x003d  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0061  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0066 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 final void a(boolean z) {
        boolean z2;
        Drawable drawable;
        boolean z3 = true;
        this.f = true;
        long jUptimeMillis = SystemClock.uptimeMillis();
        Drawable drawable2 = this.c;
        if (drawable2 != null) {
            long j = this.l;
            if (j != 0) {
                if (j <= jUptimeMillis) {
                    drawable2.setAlpha(this.e);
                    this.l = 0L;
                } else {
                    drawable2.setAlpha(((255 - (((int) ((j - jUptimeMillis) * 255)) / this.a.z)) * this.e) / 255);
                    z2 = true;
                }
            }
            drawable = this.d;
            if (drawable == null) {
                long j2 = this.m;
                if (j2 != 0) {
                    if (j2 <= jUptimeMillis) {
                        drawable.setVisible(false, false);
                        this.d = null;
                        this.m = 0L;
                    } else {
                        drawable.setAlpha(((((int) ((j2 - jUptimeMillis) * 255)) / this.a.aa) * this.e) / 255);
                    }
                }
                if (z && z3) {
                    scheduleSelf(this.k, jUptimeMillis + 16);
                    return;
                }
                return;
            }
            this.m = 0L;
            z3 = z2;
            if (z) {
                return;
            } else {
                return;
            }
        }
        this.l = 0L;
        z2 = false;
        drawable = this.d;
        if (drawable == null) {
        }
        z3 = z2;
        if (z) {
        }
    }

    @Override // android.graphics.drawable.Drawable
    public void applyTheme(Resources.Theme theme) {
        c cVar = this.a;
        if (theme == null) {
            cVar.getClass();
            return;
        }
        cVar.b();
        int i = cVar.h;
        Drawable[] drawableArr = cVar.g;
        for (int i2 = 0; i2 < i; i2++) {
            Drawable drawable = drawableArr[i2];
            if (drawable != null && drawable.canApplyTheme()) {
                drawableArr[i2].applyTheme(theme);
                cVar.e |= drawableArr[i2].getChangingConfigurations();
            }
        }
        Resources resources = theme.getResources();
        if (resources != null) {
            cVar.b = resources;
            int i3 = resources.getDisplayMetrics().densityDpi;
            if (i3 == 0) {
                i3 = 160;
            }
            int i4 = cVar.c;
            cVar.c = i3;
            if (i4 != i3) {
                cVar.m = false;
                cVar.j = false;
            }
        }
    }

    public c b() {
        return this.a;
    }

    public final void c(Drawable drawable) {
        if (this.n == null) {
            this.n = new b();
        }
        b bVar = this.n;
        bVar.a = drawable.getCallback();
        drawable.setCallback(bVar);
        try {
            if (this.a.z <= 0 && this.f) {
                drawable.setAlpha(this.e);
            }
            c cVar = this.a;
            if (cVar.ad) {
                drawable.setColorFilter(cVar.ac);
            } else {
                if (cVar.ag) {
                    drawable.setTintList(cVar.ae);
                }
                c cVar2 = this.a;
                if (cVar2.ah) {
                    drawable.setTintMode(cVar2.af);
                }
            }
            drawable.setVisible(isVisible(), true);
            drawable.setDither(this.a.x);
            drawable.setState(getState());
            drawable.setLevel(getLevel());
            drawable.setBounds(getBounds());
            drawable.setLayoutDirection(getLayoutDirection());
            drawable.setAutoMirrored(this.a.ab);
            Rect rect = this.b;
            if (rect != null) {
                drawable.setHotspotBounds(rect.left, rect.top, rect.right, rect.bottom);
            }
            b bVar2 = this.n;
            Drawable.Callback callback = bVar2.a;
            bVar2.a = null;
            drawable.setCallback(callback);
        } catch (Throwable th) {
            b bVar3 = this.n;
            Drawable.Callback callback2 = bVar3.a;
            bVar3.a = null;
            drawable.setCallback(callback2);
            throw th;
        }
    }

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

    /* JADX WARN: Removed duplicated region for block: B:26:0x0055  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean d(int i) {
        if (i == this.i) {
            return false;
        }
        long jUptimeMillis = SystemClock.uptimeMillis();
        if (this.a.aa > 0) {
            Drawable drawable = this.d;
            if (drawable != null) {
                drawable.setVisible(false, false);
            }
            Drawable drawable2 = this.c;
            if (drawable2 != null) {
                this.d = drawable2;
                this.m = ((long) this.a.aa) + jUptimeMillis;
            } else {
                this.d = null;
                this.m = 0L;
            }
        } else {
            Drawable drawable3 = this.c;
            if (drawable3 != null) {
                drawable3.setVisible(false, false);
            }
        }
        if (i >= 0) {
            c cVar = this.a;
            if (i < cVar.h) {
                Drawable drawableC = cVar.c(i);
                this.c = drawableC;
                this.i = i;
                if (drawableC != null) {
                    int i2 = this.a.z;
                    if (i2 > 0) {
                        this.l = jUptimeMillis + ((long) i2);
                    }
                    c(drawableC);
                }
            } else {
                this.c = null;
                this.i = -1;
            }
        }
        if (this.l != 0 || this.m != 0) {
            Runnable runnable = this.k;
            if (runnable == null) {
                this.k = new hf2((k49) this);
            } else {
                unscheduleSelf(runnable);
            }
            a(true);
        }
        invalidateSelf();
        return true;
    }

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

    public void e(c cVar) {
        this.a = cVar;
        int i = this.i;
        if (i >= 0) {
            Drawable drawableC = cVar.c(i);
            this.c = drawableC;
            if (drawableC != null) {
                c(drawableC);
            }
        }
        this.d = null;
    }

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

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

    @Override // android.graphics.drawable.Drawable
    public final Drawable.ConstantState getConstantState() {
        boolean z;
        c cVar = this.a;
        if (!cVar.v) {
            cVar.b();
            cVar.v = true;
            int i = cVar.h;
            Drawable[] drawableArr = cVar.g;
            int i2 = 0;
            while (true) {
                if (i2 >= i) {
                    cVar.w = true;
                    z = true;
                    break;
                }
                if (drawableArr[i2].getConstantState() == null) {
                    cVar.w = false;
                    z = false;
                    break;
                }
                i2++;
            }
        } else {
            z = cVar.w;
        }
        if (!z) {
            return null;
        }
        this.a.d = getChangingConfigurations();
        return this.a;
    }

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

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

    @Override // android.graphics.drawable.Drawable
    public final int getIntrinsicHeight() {
        c cVar = this.a;
        if (cVar.l) {
            if (!cVar.m) {
                cVar.a();
            }
            return cVar.o;
        }
        Drawable drawable = this.c;
        if (drawable != null) {
            return drawable.getIntrinsicHeight();
        }
        return -1;
    }

    @Override // android.graphics.drawable.Drawable
    public final int getIntrinsicWidth() {
        c cVar = this.a;
        if (cVar.l) {
            if (!cVar.m) {
                cVar.a();
            }
            return cVar.n;
        }
        Drawable drawable = this.c;
        if (drawable != null) {
            return drawable.getIntrinsicWidth();
        }
        return -1;
    }

    @Override // android.graphics.drawable.Drawable
    public final int getMinimumHeight() {
        c cVar = this.a;
        if (cVar.l) {
            if (!cVar.m) {
                cVar.a();
            }
            return cVar.q;
        }
        Drawable drawable = this.c;
        if (drawable != null) {
            return drawable.getMinimumHeight();
        }
        return 0;
    }

    @Override // android.graphics.drawable.Drawable
    public final int getMinimumWidth() {
        c cVar = this.a;
        if (cVar.l) {
            if (!cVar.m) {
                cVar.a();
            }
            return cVar.p;
        }
        Drawable drawable = this.c;
        if (drawable != null) {
            return drawable.getMinimumWidth();
        }
        return 0;
    }

    @Override // android.graphics.drawable.Drawable
    public final int getOpacity() {
        Drawable drawable = this.c;
        if (drawable != null && drawable.isVisible()) {
            c cVar = this.a;
            if (cVar.r) {
                return cVar.s;
            }
            cVar.b();
            int i = cVar.h;
            Drawable[] drawableArr = cVar.g;
            opacity = i > 0 ? drawableArr[0].getOpacity() : -2;
            for (int i2 = 1; i2 < i; i2++) {
                opacity = Drawable.resolveOpacity(opacity, drawableArr[i2].getOpacity());
            }
            cVar.s = opacity;
            cVar.r = true;
        }
        return opacity;
    }

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

    @Override // android.graphics.drawable.Drawable
    public final boolean getPadding(Rect rect) {
        c cVar = this.a;
        Rect rect2 = null;
        boolean padding = false;
        if (!cVar.i) {
            Rect rect3 = cVar.k;
            if (rect3 != null || cVar.j) {
                rect2 = rect3;
            } else {
                cVar.b();
                Rect rect4 = new Rect();
                int i = cVar.h;
                Drawable[] drawableArr = cVar.g;
                for (int i2 = 0; i2 < i; i2++) {
                    if (drawableArr[i2].getPadding(rect4)) {
                        if (rect2 == null) {
                            rect2 = new Rect(0, 0, 0, 0);
                        }
                        int i3 = rect4.left;
                        if (i3 > rect2.left) {
                            rect2.left = i3;
                        }
                        int i4 = rect4.top;
                        if (i4 > rect2.top) {
                            rect2.top = i4;
                        }
                        int i5 = rect4.right;
                        if (i5 > rect2.right) {
                            rect2.right = i5;
                        }
                        int i6 = rect4.bottom;
                        if (i6 > rect2.bottom) {
                            rect2.bottom = i6;
                        }
                    }
                }
                cVar.j = true;
                cVar.k = rect2;
            }
        }
        if (rect2 != null) {
            rect.set(rect2);
            if ((rect2.left | rect2.top | rect2.bottom | rect2.right) != 0) {
                padding = true;
            }
        } else {
            Drawable drawable = this.c;
            padding = drawable != null ? drawable.getPadding(rect) : super.getPadding(rect);
        }
        if (this.a.ab && getLayoutDirection() == 1) {
            int i7 = rect.left;
            rect.left = rect.right;
            rect.right = i7;
        }
        return padding;
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public final void invalidateDrawable(Drawable drawable) {
        c cVar = this.a;
        if (cVar != null) {
            cVar.r = false;
            cVar.t = false;
        }
        if (drawable != this.c || getCallback() == null) {
            return;
        }
        getCallback().invalidateDrawable(this);
    }

    @Override // android.graphics.drawable.Drawable
    public final boolean isAutoMirrored() {
        return this.a.ab;
    }

    @Override // android.graphics.drawable.Drawable
    public boolean isStateful() {
        c cVar = this.a;
        if (cVar.t) {
            return cVar.u;
        }
        cVar.b();
        int i = cVar.h;
        Drawable[] drawableArr = cVar.g;
        boolean z = false;
        int i2 = 0;
        while (true) {
            if (i2 >= i) {
                break;
            }
            if (drawableArr[i2].isStateful()) {
                z = true;
                break;
            }
            i2++;
        }
        cVar.u = z;
        cVar.t = true;
        return z;
    }

    @Override // android.graphics.drawable.Drawable
    public void jumpToCurrentState() {
        boolean z;
        Drawable drawable = this.d;
        boolean z2 = true;
        if (drawable != null) {
            drawable.jumpToCurrentState();
            this.d = null;
            z = true;
        } else {
            z = false;
        }
        Drawable drawable2 = this.c;
        if (drawable2 != null) {
            drawable2.jumpToCurrentState();
            if (this.f) {
                this.c.setAlpha(this.e);
            }
        }
        if (this.m != 0) {
            this.m = 0L;
            z = true;
        }
        if (this.l != 0) {
            this.l = 0L;
        } else {
            z2 = z;
        }
        if (z2) {
            invalidateSelf();
        }
    }

    @Override // android.graphics.drawable.Drawable
    public Drawable mutate() {
        if (!this.j && super.mutate() == this) {
            c cVarB = b();
            cVarB.d();
            e(cVarB);
            this.j = true;
        }
        return this;
    }

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

    @Override // android.graphics.drawable.Drawable
    public final boolean onLayoutDirectionChanged(int i) {
        c cVar = this.a;
        int i2 = this.i;
        int i3 = cVar.h;
        Drawable[] drawableArr = cVar.g;
        boolean z = false;
        for (int i4 = 0; i4 < i3; i4++) {
            Drawable drawable = drawableArr[i4];
            if (drawable != null) {
                boolean layoutDirection = drawable.setLayoutDirection(i);
                if (i4 == i2) {
                    z = layoutDirection;
                }
            }
        }
        cVar.y = i;
        return z;
    }

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

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

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

    @Override // android.graphics.drawable.Drawable
    public final void setAlpha(int i) {
        if (this.f && this.e == i) {
            return;
        }
        this.f = true;
        this.e = i;
        Drawable drawable = this.c;
        if (drawable != null) {
            if (this.l == 0) {
                drawable.setAlpha(i);
            } else {
                a(false);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final void setAutoMirrored(boolean z) {
        c cVar = this.a;
        if (cVar.ab != z) {
            cVar.ab = z;
            Drawable drawable = this.c;
            if (drawable != null) {
                drawable.setAutoMirrored(z);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final void setColorFilter(ColorFilter colorFilter) {
        c cVar = this.a;
        cVar.ad = true;
        if (cVar.ac != colorFilter) {
            cVar.ac = colorFilter;
            Drawable drawable = this.c;
            if (drawable != null) {
                drawable.setColorFilter(colorFilter);
            }
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final void setDither(boolean z) {
        c cVar = this.a;
        if (cVar.x != z) {
            cVar.x = z;
            Drawable drawable = this.c;
            if (drawable != null) {
                drawable.setDither(z);
            }
        }
    }

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

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

    @Override // android.graphics.drawable.Drawable
    public final void setTint(int i) {
        setTintList(ColorStateList.valueOf(i));
    }

    @Override // android.graphics.drawable.Drawable
    public final void setTintList(ColorStateList colorStateList) {
        c cVar = this.a;
        cVar.ag = true;
        if (cVar.ae != colorStateList) {
            cVar.ae = colorStateList;
            gf2.b(this.c, colorStateList);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final void setTintMode(PorterDuff.Mode mode) {
        c cVar = this.a;
        cVar.ah = true;
        if (cVar.af != mode) {
            cVar.af = mode;
            gf2.c(this.c, mode);
        }
    }

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

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