package defpackage;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.SparseArray;

/* JADX INFO: renamed from: ᵮᵺ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4268 extends Drawable.ConstantState {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public Resources f16280;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public boolean f16281;

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public C5267 f16282;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public C3162 f16283;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public ColorFilter f16284;

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public int f16285;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public int[][] f16286;

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public boolean f16287;

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public boolean f16288;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public int f16289;

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public int f16290;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public boolean f16291;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public boolean f16292;

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public boolean f16293;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public int f16294;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public PorterDuff.Mode f16295;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public int f16296;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public boolean f16297;

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public boolean f16298;

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public int f16299;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public boolean f16300;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public int f16301;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public int f16302;

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public int f16303;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public boolean f16304;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public int f16305;

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public int f16306;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public boolean f16307;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C2904 f16308;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public Drawable[] f16309;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public boolean f16310;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public Rect f16311;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public int f16312;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public ColorStateList f16313;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public boolean f16314;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public SparseArray f16315;

    public C4268(C4268 c4268, C2904 c2904, Resources resources) {
        this.f16314 = false;
        this.f16304 = false;
        this.f16297 = true;
        this.f16302 = 0;
        this.f16305 = 0;
        this.f16308 = c2904;
        this.f16280 = resources != null ? resources : c4268 != null ? c4268.f16280 : null;
        int i = c4268 != null ? c4268.f16294 : 0;
        int i2 = C2904.f11155;
        i = resources != null ? resources.getDisplayMetrics().densityDpi : i;
        i = i == 0 ? 160 : i;
        this.f16294 = i;
        if (c4268 != null) {
            this.f16312 = c4268.f16312;
            this.f16301 = c4268.f16301;
            this.f16288 = true;
            this.f16291 = true;
            this.f16314 = c4268.f16314;
            this.f16304 = c4268.f16304;
            this.f16297 = c4268.f16297;
            this.f16296 = c4268.f16296;
            this.f16302 = c4268.f16302;
            this.f16305 = c4268.f16305;
            this.f16310 = c4268.f16310;
            this.f16284 = c4268.f16284;
            this.f16292 = c4268.f16292;
            this.f16313 = c4268.f16313;
            this.f16295 = c4268.f16295;
            this.f16281 = c4268.f16281;
            this.f16300 = c4268.f16300;
            if (c4268.f16294 == i) {
                if (c4268.f16307) {
                    this.f16311 = c4268.f16311 != null ? new Rect(c4268.f16311) : null;
                    this.f16307 = true;
                }
                if (c4268.f16298) {
                    this.f16290 = c4268.f16290;
                    this.f16303 = c4268.f16303;
                    this.f16299 = c4268.f16299;
                    this.f16306 = c4268.f16306;
                    this.f16298 = true;
                }
            }
            if (c4268.f16287) {
                this.f16285 = c4268.f16285;
                this.f16287 = true;
            }
            if (c4268.f16293) {
                this.f16293 = true;
            }
            Drawable[] drawableArr = c4268.f16309;
            this.f16309 = new Drawable[drawableArr.length];
            this.f16289 = c4268.f16289;
            SparseArray sparseArray = c4268.f16315;
            if (sparseArray != null) {
                this.f16315 = sparseArray.clone();
            } else {
                this.f16315 = new SparseArray(this.f16289);
            }
            int i3 = this.f16289;
            for (int i4 = 0; i4 < i3; i4++) {
                Drawable drawable = drawableArr[i4];
                if (drawable != null) {
                    Drawable.ConstantState constantState = drawable.getConstantState();
                    if (constantState != null) {
                        this.f16315.put(i4, constantState);
                    } else {
                        this.f16309[i4] = drawableArr[i4];
                    }
                }
            }
        } else {
            this.f16309 = new Drawable[10];
            this.f16289 = 0;
        }
        if (c4268 != null) {
            this.f16286 = c4268.f16286;
        } else {
            this.f16286 = new int[this.f16309.length][];
        }
        if (c4268 != null) {
            this.f16283 = c4268.f16283;
            this.f16282 = c4268.f16282;
        } else {
            this.f16283 = new C3162();
            this.f16282 = new C5267();
        }
    }

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

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

    @Override // android.graphics.drawable.Drawable.ConstantState
    public final Drawable newDrawable() {
        return new C2904(this, null);
    }

    @Override // android.graphics.drawable.Drawable.ConstantState
    public final Drawable newDrawable(Resources resources) {
        return new C2904(this, resources);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m9232() {
        this.f16298 = true;
        m9233();
        int i = this.f16289;
        Drawable[] drawableArr = this.f16309;
        this.f16303 = -1;
        this.f16290 = -1;
        this.f16306 = 0;
        this.f16299 = 0;
        for (int i2 = 0; i2 < i; i2++) {
            Drawable drawable = drawableArr[i2];
            int intrinsicWidth = drawable.getIntrinsicWidth();
            if (intrinsicWidth > this.f16290) {
                this.f16290 = intrinsicWidth;
            }
            int intrinsicHeight = drawable.getIntrinsicHeight();
            if (intrinsicHeight > this.f16303) {
                this.f16303 = intrinsicHeight;
            }
            int minimumWidth = drawable.getMinimumWidth();
            if (minimumWidth > this.f16299) {
                this.f16299 = minimumWidth;
            }
            int minimumHeight = drawable.getMinimumHeight();
            if (minimumHeight > this.f16306) {
                this.f16306 = minimumHeight;
            }
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m9233() {
        SparseArray sparseArray = this.f16315;
        if (sparseArray != null) {
            int size = sparseArray.size();
            for (int i = 0; i < size; i++) {
                int iKeyAt = this.f16315.keyAt(i);
                Drawable.ConstantState constantState = (Drawable.ConstantState) this.f16315.valueAt(i);
                Drawable[] drawableArr = this.f16309;
                Drawable drawableNewDrawable = constantState.newDrawable(this.f16280);
                drawableNewDrawable.setLayoutDirection(this.f16296);
                Drawable drawableMutate = drawableNewDrawable.mutate();
                drawableMutate.setCallback(this.f16308);
                drawableArr[iKeyAt] = drawableMutate;
            }
            this.f16315 = null;
        }
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final int m9234(int i) {
        Object obj;
        if (i < 0) {
            return 0;
        }
        C5267 c5267 = this.f16282;
        Object obj2 = 0;
        int i2 = ᵣˉ.ᵨᵣ(c5267.f19909, c5267.f19910, i);
        if (i2 >= 0 && (obj = c5267.f19911[i2]) != ˌᵨʽʙ.ᵜᵪʾ) {
            obj2 = obj;
        }
        return ((Integer) obj2).intValue();
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final int m9235(Drawable drawable) {
        int i = this.f16289;
        Drawable[] drawableArr = this.f16309;
        if (i >= drawableArr.length) {
            int i2 = i + 10;
            Drawable[] drawableArr2 = new Drawable[i2];
            System.arraycopy(drawableArr, 0, drawableArr2, 0, i);
            this.f16309 = drawableArr2;
            int[][] iArr = new int[i2][];
            System.arraycopy(this.f16286, 0, iArr, 0, i);
            this.f16286 = iArr;
        }
        drawable.mutate();
        drawable.setVisible(false, true);
        drawable.setCallback(this.f16308);
        this.f16309[i] = drawable;
        this.f16289++;
        this.f16301 = drawable.getChangingConfigurations() | this.f16301;
        this.f16287 = false;
        this.f16293 = false;
        this.f16311 = null;
        this.f16307 = false;
        this.f16298 = false;
        this.f16288 = false;
        return i;
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final Drawable m9236(int i) {
        int iIndexOfKey;
        Drawable drawable = this.f16309[i];
        if (drawable != null) {
            return drawable;
        }
        SparseArray sparseArray = this.f16315;
        if (sparseArray == null || (iIndexOfKey = sparseArray.indexOfKey(i)) < 0) {
            return null;
        }
        Drawable drawableNewDrawable = ((Drawable.ConstantState) this.f16315.valueAt(iIndexOfKey)).newDrawable(this.f16280);
        drawableNewDrawable.setLayoutDirection(this.f16296);
        Drawable drawableMutate = drawableNewDrawable.mutate();
        drawableMutate.setCallback(this.f16308);
        this.f16309[i] = drawableMutate;
        this.f16315.removeAt(iIndexOfKey);
        if (this.f16315.size() == 0) {
            this.f16315 = null;
        }
        return drawableMutate;
    }
}
