package defpackage;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.TextView;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Locale;

/* JADX INFO: renamed from: ᵝᵝˉ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2938 {

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public C2531 f11311;

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

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final C3890 f11314;

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

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public int f11309 = 0;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public int f11312 = -1;

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public String f11306 = null;

    public C2938(TextView textView) {
        this.f11310 = textView;
        this.f11314 = new C3890(textView);
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static C2531 m7009(Context context, C0359 c0359, int i) {
        ColorStateList colorStateListM10918;
        synchronized (c0359) {
            colorStateListM10918 = c0359.f2163.m10918(context, i);
        }
        if (colorStateListM10918 == null) {
            return null;
        }
        C2531 c2531 = new C2531();
        c2531.f9795 = true;
        c2531.f9796 = colorStateListM10918;
        return c2531;
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public static void m7010(EditorInfo editorInfo, InputConnection inputConnection, TextView textView) {
        int i = Build.VERSION.SDK_INT;
        if (i >= 30 || inputConnection == null) {
            return;
        }
        CharSequence text = textView.getText();
        if (i >= 30) {
            AbstractC3311.m7581(editorInfo, text);
            return;
        }
        text.getClass();
        if (i >= 30) {
            AbstractC3311.m7581(editorInfo, text);
            return;
        }
        int i2 = editorInfo.initialSelStart;
        int i3 = editorInfo.initialSelEnd;
        int i4 = i2 > i3 ? i3 : i2;
        if (i2 <= i3) {
            i2 = i3;
        }
        int length = text.length();
        if (i4 < 0 || i2 > length) {
            AbstractC4879.m10148(editorInfo, null, 0, 0);
            return;
        }
        int i5 = editorInfo.inputType & 4095;
        if (i5 == 129 || i5 == 225 || i5 == 18) {
            AbstractC4879.m10148(editorInfo, null, 0, 0);
            return;
        }
        if (length <= 2048) {
            AbstractC4879.m10148(editorInfo, text, i4, i2);
            return;
        }
        int i6 = i2 - i4;
        int i7 = i6 > 1024 ? 0 : i6;
        int i8 = 2048 - i7;
        int iMin = Math.min(text.length() - i2, i8 - Math.min(i4, (int) (((double) i8) * 0.8d)));
        int iMin2 = Math.min(i4, i8 - iMin);
        int i9 = i4 - iMin2;
        if (Character.isLowSurrogate(text.charAt(i9))) {
            i9++;
            iMin2--;
        }
        if (Character.isHighSurrogate(text.charAt((i2 + iMin) - 1))) {
            iMin--;
        }
        int i10 = iMin2 + i7;
        AbstractC4879.m10148(editorInfo, i7 != i6 ? TextUtils.concat(text.subSequence(i9, i9 + iMin2), text.subSequence(i2, iMin + i2)) : text.subSequence(i9, i10 + iMin + i9), iMin2, i10);
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public static void m7011(TextView textView, Typeface typeface, int i) {
        int i2 = Build.VERSION.SDK_INT;
        String str = null;
        if (i2 >= 26) {
            String strM2431 = AbstractC0664.m2431(textView);
            if (!TextUtils.isEmpty(strM2431)) {
                AbstractC0664.m2433(textView, null);
            }
            str = strM2431;
        }
        textView.setTypeface(typeface, i);
        if (i2 < 26 || TextUtils.isEmpty(str)) {
            return;
        }
        AbstractC0664.m2433(textView, str);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m7012() {
        C2531 c2531 = this.f11302;
        TextView textView = this.f11310;
        if (c2531 != null || this.f11305 != null || this.f11313 != null || this.f11307 != null) {
            Drawable[] compoundDrawables = textView.getCompoundDrawables();
            m7020(compoundDrawables[0], this.f11302);
            m7020(compoundDrawables[1], this.f11305);
            m7020(compoundDrawables[2], this.f11313);
            m7020(compoundDrawables[3], this.f11307);
        }
        if (this.f11315 == null && this.f11311 == null) {
            return;
        }
        Drawable[] compoundDrawablesRelative = textView.getCompoundDrawablesRelative();
        m7020(compoundDrawablesRelative[0], this.f11315);
        m7020(compoundDrawablesRelative[2], this.f11311);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:219:0x0385  */
    /* JADX WARN: Removed duplicated region for block: B:221:0x038a  */
    /* JADX WARN: Removed duplicated region for block: B:224:0x0391  */
    /* JADX WARN: Removed duplicated region for block: B:234:? A[RETURN, SYNTHETIC] */
    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m7013(AttributeSet attributeSet, int i) {
        boolean z;
        boolean z2;
        String string;
        float dimensionPixelSize;
        int i2;
        ColorStateList colorStateList;
        int resourceId;
        int i3;
        int resourceId2;
        TextView textView = this.f11310;
        Context context = textView.getContext();
        C0359 c0359M1680 = C0359.m1680();
        int[] iArr = AbstractC0430.f2381;
        C5398 c5398M11010 = C5398.m11010(context, attributeSet, iArr, i);
        AbstractC2746.m6646(textView, textView.getContext(), iArr, attributeSet, (TypedArray) c5398M11010.f20483, i);
        TypedArray typedArray = (TypedArray) c5398M11010.f20483;
        int resourceId3 = typedArray.getResourceId(0, -1);
        if (typedArray.hasValue(3)) {
            this.f11302 = m7009(context, c0359M1680, typedArray.getResourceId(3, 0));
        }
        if (typedArray.hasValue(1)) {
            this.f11305 = m7009(context, c0359M1680, typedArray.getResourceId(1, 0));
        }
        if (typedArray.hasValue(4)) {
            this.f11313 = m7009(context, c0359M1680, typedArray.getResourceId(4, 0));
        }
        if (typedArray.hasValue(2)) {
            this.f11307 = m7009(context, c0359M1680, typedArray.getResourceId(2, 0));
        }
        if (typedArray.hasValue(5)) {
            this.f11315 = m7009(context, c0359M1680, typedArray.getResourceId(5, 0));
        }
        if (typedArray.hasValue(6)) {
            this.f11311 = m7009(context, c0359M1680, typedArray.getResourceId(6, 0));
        }
        c5398M11010.m11012();
        boolean z3 = textView.getTransformationMethod() instanceof PasswordTransformationMethod;
        int[] iArr2 = AbstractC0430.f2387;
        if (resourceId3 != -1) {
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(resourceId3, iArr2);
            C5398 c5398 = new C5398(context, typedArrayObtainStyledAttributes);
            if (z3 || !typedArrayObtainStyledAttributes.hasValue(14)) {
                z = false;
                z2 = false;
            } else {
                z2 = typedArrayObtainStyledAttributes.getBoolean(14, false);
                z = true;
            }
            m7017(context, c5398);
            string = typedArrayObtainStyledAttributes.hasValue(15) ? typedArrayObtainStyledAttributes.getString(15) : null;
            c5398.m11012();
        } else {
            z = false;
            z2 = false;
            string = null;
        }
        TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, iArr2, i, 0);
        C5398 c53982 = new C5398(context, typedArrayObtainStyledAttributes2);
        if (!z3 && typedArrayObtainStyledAttributes2.hasValue(14)) {
            z2 = typedArrayObtainStyledAttributes2.getBoolean(14, false);
            z = true;
        }
        boolean z4 = z2;
        if (typedArrayObtainStyledAttributes2.hasValue(15)) {
            string = typedArrayObtainStyledAttributes2.getString(15);
        }
        int i4 = Build.VERSION.SDK_INT;
        if (i4 >= 28 && typedArrayObtainStyledAttributes2.hasValue(0) && typedArrayObtainStyledAttributes2.getDimensionPixelSize(0, -1) == 0) {
            textView.setTextSize(0, 0.0f);
        }
        m7017(context, c53982);
        c53982.m11012();
        if (!z3 && z) {
            textView.setAllCaps(z4);
        }
        m7015(false);
        if (string != null) {
            if (i4 >= 24) {
                AbstractC3619.m8180(textView, AbstractC3619.m8179(string));
            } else {
                textView.setTextLocale(Locale.forLanguageTag(string.split(",")[0]));
            }
        }
        C3890 c3890 = this.f11314;
        Context context2 = c3890.f14843;
        int[] iArr3 = AbstractC0430.f2402;
        TypedArray typedArrayObtainStyledAttributes3 = context2.obtainStyledAttributes(attributeSet, iArr3, i, 0);
        TextView textView2 = c3890.f14848;
        AbstractC2746.m6646(textView2, textView2.getContext(), iArr3, attributeSet, typedArrayObtainStyledAttributes3, i);
        if (typedArrayObtainStyledAttributes3.hasValue(5)) {
            c3890.f14844 = typedArrayObtainStyledAttributes3.getInt(5, 0);
        }
        float dimension = typedArrayObtainStyledAttributes3.hasValue(4) ? typedArrayObtainStyledAttributes3.getDimension(4, -1.0f) : -1.0f;
        float dimension2 = typedArrayObtainStyledAttributes3.hasValue(2) ? typedArrayObtainStyledAttributes3.getDimension(2, -1.0f) : -1.0f;
        float dimension3 = typedArrayObtainStyledAttributes3.hasValue(1) ? typedArrayObtainStyledAttributes3.getDimension(1, -1.0f) : -1.0f;
        if (typedArrayObtainStyledAttributes3.hasValue(3) && (resourceId2 = typedArrayObtainStyledAttributes3.getResourceId(3, 0)) > 0) {
            TypedArray typedArrayObtainTypedArray = typedArrayObtainStyledAttributes3.getResources().obtainTypedArray(resourceId2);
            int length = typedArrayObtainTypedArray.length();
            int[] iArr4 = new int[length];
            if (length > 0) {
                for (int i5 = 0; i5 < length; i5++) {
                    iArr4[i5] = typedArrayObtainTypedArray.getDimensionPixelSize(i5, -1);
                }
                c3890.f14849 = C3890.m8592(iArr4);
                c3890.m8594();
            }
            typedArrayObtainTypedArray.recycle();
        }
        typedArrayObtainStyledAttributes3.recycle();
        if (!c3890.m8600()) {
            c3890.f14844 = 0;
        } else if (c3890.f14844 == 1) {
            if (!c3890.f14845) {
                DisplayMetrics displayMetrics = context2.getResources().getDisplayMetrics();
                if (dimension2 == -1.0f) {
                    i3 = 2;
                    dimension2 = TypedValue.applyDimension(2, 12.0f, displayMetrics);
                } else {
                    i3 = 2;
                }
                if (dimension3 == -1.0f) {
                    dimension3 = TypedValue.applyDimension(i3, 112.0f, displayMetrics);
                }
                float f = dimension3;
                if (dimension == -1.0f) {
                    dimension = 1.0f;
                }
                c3890.m8597(dimension2, f, dimension);
            }
            c3890.m8599();
        }
        if (AbstractC2514.f9716 && c3890.f14844 != 0) {
            int[] iArr5 = c3890.f14849;
            if (iArr5.length > 0) {
                if (AbstractC0664.m2434(textView) != -1.0f) {
                    AbstractC0664.m2432(textView, Math.round(c3890.f14847), Math.round(c3890.f14842), Math.round(c3890.f14841));
                } else {
                    AbstractC0664.m2435(textView, iArr5);
                }
            }
        }
        TypedArray typedArrayObtainStyledAttributes4 = context.obtainStyledAttributes(attributeSet, iArr3);
        int resourceId4 = typedArrayObtainStyledAttributes4.getResourceId(8, -1);
        Drawable drawableM1682 = resourceId4 != -1 ? c0359M1680.m1682(context, resourceId4) : null;
        int resourceId5 = typedArrayObtainStyledAttributes4.getResourceId(13, -1);
        Drawable drawableM16822 = resourceId5 != -1 ? c0359M1680.m1682(context, resourceId5) : null;
        int resourceId6 = typedArrayObtainStyledAttributes4.getResourceId(9, -1);
        Drawable drawableM16823 = resourceId6 != -1 ? c0359M1680.m1682(context, resourceId6) : null;
        int resourceId7 = typedArrayObtainStyledAttributes4.getResourceId(6, -1);
        Drawable drawableM16824 = resourceId7 != -1 ? c0359M1680.m1682(context, resourceId7) : null;
        int resourceId8 = typedArrayObtainStyledAttributes4.getResourceId(10, -1);
        Drawable drawableM16825 = resourceId8 != -1 ? c0359M1680.m1682(context, resourceId8) : null;
        int resourceId9 = typedArrayObtainStyledAttributes4.getResourceId(7, -1);
        Drawable drawableM16826 = resourceId9 != -1 ? c0359M1680.m1682(context, resourceId9) : null;
        if (drawableM16825 != null || drawableM16826 != null) {
            Drawable[] compoundDrawablesRelative = textView.getCompoundDrawablesRelative();
            if (drawableM16825 == null) {
                drawableM16825 = compoundDrawablesRelative[0];
            }
            if (drawableM16822 == null) {
                drawableM16822 = compoundDrawablesRelative[1];
            }
            if (drawableM16826 == null) {
                drawableM16826 = compoundDrawablesRelative[2];
            }
            if (drawableM16824 == null) {
                drawableM16824 = compoundDrawablesRelative[3];
            }
            textView.setCompoundDrawablesRelativeWithIntrinsicBounds(drawableM16825, drawableM16822, drawableM16826, drawableM16824);
        } else if (drawableM1682 != null || drawableM16822 != null || drawableM16823 != null || drawableM16824 != null) {
            Drawable[] compoundDrawablesRelative2 = textView.getCompoundDrawablesRelative();
            Drawable drawable = compoundDrawablesRelative2[0];
            if (drawable == null && compoundDrawablesRelative2[2] == null) {
                Drawable[] compoundDrawables = textView.getCompoundDrawables();
                if (drawableM1682 == null) {
                    drawableM1682 = compoundDrawables[0];
                }
                if (drawableM16822 == null) {
                    drawableM16822 = compoundDrawables[1];
                }
                if (drawableM16823 == null) {
                    drawableM16823 = compoundDrawables[2];
                }
                if (drawableM16824 == null) {
                    drawableM16824 = compoundDrawables[3];
                }
                textView.setCompoundDrawablesWithIntrinsicBounds(drawableM1682, drawableM16822, drawableM16823, drawableM16824);
            } else {
                if (drawableM16822 == null) {
                    drawableM16822 = compoundDrawablesRelative2[1];
                }
                if (drawableM16824 == null) {
                    drawableM16824 = compoundDrawablesRelative2[3];
                }
                textView.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawableM16822, compoundDrawablesRelative2[2], drawableM16824);
            }
        }
        if (typedArrayObtainStyledAttributes4.hasValue(11)) {
            if (!typedArrayObtainStyledAttributes4.hasValue(11) || (resourceId = typedArrayObtainStyledAttributes4.getResourceId(11, 0)) == 0 || (colorStateList = AbstractC1630.m4515(context, resourceId)) == null) {
                colorStateList = typedArrayObtainStyledAttributes4.getColorStateList(11);
            }
            ᵷᵸˁ.ᵯᵷʽ(textView, colorStateList);
        }
        if (typedArrayObtainStyledAttributes4.hasValue(12)) {
            PorterDuff.Mode modeM3159 = AbstractC0912.m3159(typedArrayObtainStyledAttributes4.getInt(12, -1), null);
            if (Build.VERSION.SDK_INT >= 24) {
                textView.setCompoundDrawableTintMode(modeM3159);
            } else if (textView instanceof InterfaceC0259) {
                ((InterfaceC0259) textView).setSupportCompoundDrawablesTintMode(modeM3159);
            }
        }
        int dimensionPixelSize2 = typedArrayObtainStyledAttributes4.getDimensionPixelSize(15, -1);
        int dimensionPixelSize3 = typedArrayObtainStyledAttributes4.getDimensionPixelSize(18, -1);
        if (typedArrayObtainStyledAttributes4.hasValue(19)) {
            TypedValue typedValuePeekValue = typedArrayObtainStyledAttributes4.peekValue(19);
            if (typedValuePeekValue != null && typedValuePeekValue.type == 5) {
                int i6 = typedValuePeekValue.data;
                i2 = i6 & 15;
                dimensionPixelSize = TypedValue.complexToFloat(i6);
                typedArrayObtainStyledAttributes4.recycle();
                if (dimensionPixelSize2 != -1) {
                    ᵷᵸˁ.ᵶˇᵱ(textView, dimensionPixelSize2);
                }
                if (dimensionPixelSize3 != -1) {
                    ᵷᵸˁ.ˈᵲᵢ(textView, dimensionPixelSize3);
                }
                if (dimensionPixelSize == -1.0f) {
                    if (i2 == -1) {
                        ᵷᵸˁ.ˌᵨʠᵫ(textView, (int) dimensionPixelSize);
                        return;
                    } else if (Build.VERSION.SDK_INT >= 34) {
                        AbstractC1025.m3399(textView, i2, dimensionPixelSize);
                        return;
                    } else {
                        ᵷᵸˁ.ˌᵨʠᵫ(textView, Math.round(TypedValue.applyDimension(i2, dimensionPixelSize, textView.getResources().getDisplayMetrics())));
                        return;
                    }
                }
                return;
            }
            dimensionPixelSize = typedArrayObtainStyledAttributes4.getDimensionPixelSize(19, -1);
        } else {
            dimensionPixelSize = -1.0f;
        }
        i2 = -1;
        typedArrayObtainStyledAttributes4.recycle();
        if (dimensionPixelSize2 != -1) {
        }
        if (dimensionPixelSize3 != -1) {
        }
        if (dimensionPixelSize == -1.0f) {
        }
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final void m7014(ColorStateList colorStateList) {
        if (this.f11303 == null) {
            this.f11303 = new C2531();
        }
        C2531 c2531 = this.f11303;
        c2531.f9796 = colorStateList;
        c2531.f9795 = colorStateList != null;
        this.f11302 = c2531;
        this.f11305 = c2531;
        this.f11313 = c2531;
        this.f11307 = c2531;
        this.f11315 = c2531;
        this.f11311 = c2531;
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m7015(boolean z) {
        Typeface typeface = this.f11308;
        TextView textView = this.f11310;
        if (typeface != null) {
            if (this.f11312 == -1) {
                textView.setTypeface(typeface, this.f11309);
            } else {
                textView.setTypeface(typeface);
            }
        } else if (z) {
            textView.setTypeface(null);
        }
        String str = this.f11306;
        if (str == null || Build.VERSION.SDK_INT < 26) {
            return;
        }
        AbstractC0664.m2433(textView, str);
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public final void m7016(int i) {
        C3890 c3890 = this.f11314;
        if (c3890.m8600()) {
            if (i == 0) {
                c3890.f14844 = 0;
                c3890.f14847 = -1.0f;
                c3890.f14842 = -1.0f;
                c3890.f14841 = -1.0f;
                c3890.f14849 = new int[0];
                c3890.f14839 = false;
                return;
            }
            if (i != 1) {
                ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC2704.m6517(i, "Unknown auto-size text type: "));
                return;
            }
            DisplayMetrics displayMetrics = c3890.f14843.getResources().getDisplayMetrics();
            c3890.m8597(TypedValue.applyDimension(2, 12.0f, displayMetrics), TypedValue.applyDimension(2, 112.0f, displayMetrics), 1.0f);
            if (c3890.m8599()) {
                c3890.m8598();
            }
        }
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public final boolean m7017(Context context, C5398 c5398) {
        String string;
        int i;
        Typeface typeface;
        int i2 = this.f11309;
        TypedArray typedArray = (TypedArray) c5398.f20483;
        this.f11309 = typedArray.getInt(2, i2);
        int i3 = Build.VERSION.SDK_INT;
        if (i3 >= 28) {
            int i4 = typedArray.getInt(11, -1);
            this.f11312 = i4;
            if (i4 != -1) {
                this.f11309 &= 2;
            }
        }
        if (i3 >= 26 && typedArray.hasValue(13)) {
            this.f11306 = typedArray.getString(13);
        }
        if (typedArray.hasValue(10) || typedArray.hasValue(12)) {
            this.f11308 = null;
            int i5 = typedArray.hasValue(12) ? 12 : 10;
            int i6 = this.f11312;
            int i7 = this.f11309;
            if (!context.isRestricted()) {
                WeakReference weakReference = new WeakReference(this.f11310);
                C0760 c0760 = new C0760();
                c0760.f3420 = this;
                c0760.f3417 = i6;
                c0760.f3419 = i7;
                c0760.f3418 = weakReference;
                try {
                    Typeface typefaceM11011 = c5398.m11011(i5, this.f11309, c0760);
                    if (typefaceM11011 != null) {
                        if (i3 < 28 || this.f11312 == -1) {
                            this.f11308 = typefaceM11011;
                        } else {
                            this.f11308 = AbstractC0562.m2170(Typeface.create(typefaceM11011, 0), this.f11312, (this.f11309 & 2) != 0);
                        }
                    }
                    this.f11304 = this.f11308 == null;
                } catch (Resources.NotFoundException | UnsupportedOperationException unused) {
                }
            }
            if (this.f11308 == null && (string = typedArray.getString(i5)) != null) {
                if (Build.VERSION.SDK_INT < 28 || this.f11312 == -1) {
                    this.f11308 = Typeface.create(string, this.f11309);
                } else {
                    this.f11308 = AbstractC0562.m2170(Typeface.create(string, 0), this.f11312, (this.f11309 & 2) != 0);
                }
            }
        } else {
            if (!typedArray.hasValue(1)) {
                if (i3 < 28 || (i = this.f11312) == -1 || (typeface = this.f11308) == null) {
                    return false;
                }
                this.f11308 = AbstractC0562.m2170(typeface, i, (this.f11309 & 2) != 0);
                return true;
            }
            this.f11304 = false;
            int i8 = typedArray.getInt(1, 1);
            if (i8 == 1) {
                this.f11308 = Typeface.SANS_SERIF;
                return true;
            }
            if (i8 == 2) {
                this.f11308 = Typeface.SERIF;
                return true;
            }
            if (i8 == 3) {
                this.f11308 = Typeface.MONOSPACE;
                return true;
            }
        }
        return true;
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public final void m7018(PorterDuff.Mode mode) {
        if (this.f11303 == null) {
            this.f11303 = new C2531();
        }
        C2531 c2531 = this.f11303;
        c2531.f9798 = mode;
        c2531.f9797 = mode != null;
        this.f11302 = c2531;
        this.f11305 = c2531;
        this.f11313 = c2531;
        this.f11307 = c2531;
        this.f11315 = c2531;
        this.f11311 = c2531;
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public final void m7019(int[] iArr, int i) {
        C3890 c3890 = this.f11314;
        if (c3890.m8600()) {
            int length = iArr.length;
            if (length > 0) {
                int[] iArrCopyOf = new int[length];
                if (i == 0) {
                    iArrCopyOf = Arrays.copyOf(iArr, length);
                } else {
                    DisplayMetrics displayMetrics = c3890.f14843.getResources().getDisplayMetrics();
                    for (int i2 = 0; i2 < length; i2++) {
                        iArrCopyOf[i2] = Math.round(TypedValue.applyDimension(i, iArr[i2], displayMetrics));
                    }
                }
                c3890.f14849 = C3890.m8592(iArrCopyOf);
                if (!c3890.m8594()) {
                    ᵕᵩʽᵲ.ᵶᵥᵝ(Arrays.toString(iArr), "None of the preset sizes is valid: ");
                    return;
                }
            } else {
                c3890.f14845 = false;
            }
            if (c3890.m8599()) {
                c3890.m8598();
            }
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m7020(Drawable drawable, C2531 c2531) {
        if (drawable == null || c2531 == null) {
            return;
        }
        C0359.m1681(drawable, c2531, this.f11310.getDrawableState());
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final PorterDuff.Mode m7021() {
        C2531 c2531 = this.f11303;
        if (c2531 != null) {
            return (PorterDuff.Mode) c2531.f9798;
        }
        return null;
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final void m7022(int i, int i2, int i3, int i4) {
        C3890 c3890 = this.f11314;
        if (c3890.m8600()) {
            DisplayMetrics displayMetrics = c3890.f14843.getResources().getDisplayMetrics();
            c3890.m8597(TypedValue.applyDimension(i4, i, displayMetrics), TypedValue.applyDimension(i4, i2, displayMetrics), TypedValue.applyDimension(i4, i3, displayMetrics));
            if (c3890.m8599()) {
                c3890.m8598();
            }
        }
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final void m7023(Context context, int i) {
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(i, AbstractC0430.f2387);
        C5398 c5398 = new C5398(context, typedArrayObtainStyledAttributes);
        boolean zHasValue = typedArrayObtainStyledAttributes.hasValue(14);
        TextView textView = this.f11310;
        if (zHasValue) {
            textView.setAllCaps(typedArrayObtainStyledAttributes.getBoolean(14, false));
        }
        if (typedArrayObtainStyledAttributes.hasValue(0) && typedArrayObtainStyledAttributes.getDimensionPixelSize(0, -1) == 0) {
            textView.setTextSize(0, 0.0f);
        }
        boolean zM7017 = m7017(context, c5398);
        c5398.m11012();
        m7015(zM7017);
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final ColorStateList m7024() {
        C2531 c2531 = this.f11303;
        if (c2531 != null) {
            return (ColorStateList) c2531.f9796;
        }
        return null;
    }
}
