package ῲ.ῲ.㴹;

import android.annotation.SuppressLint;
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.os.LocaleList;
import android.text.method.PasswordTransformationMethod;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.widget.TextView;
import androidx.appcompat.R$styleable;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Locale;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.ᨨ.C1729;
import ῲ.ᨨ.ῲ.ῲ.AbstractC1799;
import ῲ.ᨨ.㳳.AbstractC1835;
import ῲ.ᨨ.㳳.AbstractC1840;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ῲ.ῲ.㴹.䁗  reason: contains not printable characters */
/* compiled from: AppCompatTextHelper */
public class C2054 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public C2029 f6979;

    /* renamed from: ඓ  reason: contains not printable characters */
    public C2029 f6980;

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

    /* renamed from: ᨨ  reason: contains not printable characters */
    public final C1991 f6982;

    /* renamed from: ῲ  reason: contains not printable characters */
    public C2029 f6983;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public C2029 f6984;

    /* renamed from: K  reason: contains not printable characters */
    public final TextView f6985;

    /* renamed from: 㑃  reason: contains not printable characters */
    public Typeface f6986;

    /* renamed from: 㳳  reason: contains not printable characters */
    public int f6987 = 0;

    /* renamed from: 㴹  reason: contains not printable characters */
    public C2029 f6988;

    /* renamed from: 㸾  reason: contains not printable characters */
    public C2029 f6989;

    /* renamed from: 㿎  reason: contains not printable characters */
    public C2029 f6990;

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

    /* renamed from: ῲ.ῲ.㴹.䁗$K  reason: contains not printable characters */
    /* compiled from: AppCompatTextHelper */
    public class C2055 extends AbstractC1799 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final /* synthetic */ WeakReference f6992;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ int f6993;

        /* renamed from: K  reason: contains not printable characters */
        public final /* synthetic */ int f6994;

        public C2055(int i, int i2, WeakReference weakReference) {
            this.f6994 = i;
            this.f6993 = i2;
            this.f6992 = weakReference;
        }

        @Override // ῲ.ᨨ.ῲ.ῲ.AbstractC1799
        public void onFontRetrievalFailed(int i) {
        }

        @Override // ῲ.ᨨ.ῲ.ῲ.AbstractC1799
        public void onFontRetrieved(Typeface typeface) {
            int i;
            if (Build.VERSION.SDK_INT >= 28 && (i = this.f6994) != -1) {
                typeface = Typeface.create(typeface, i, (this.f6993 & 2) != 0);
            }
            C2054 r0 = C2054.this;
            WeakReference weakReference = this.f6992;
            if (r0.f6991) {
                r0.f6986 = typeface;
                TextView textView = (TextView) weakReference.get();
                if (textView != null) {
                    textView.setTypeface(typeface, r0.f6987);
                }
            }
        }
    }

    public C2054(TextView textView) {
        this.f6985 = textView;
        this.f6982 = new C1991(this.f6985);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public int m5343() {
        return Math.round(this.f6982.f6766);
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public int[] m5344() {
        return this.f6982.f6765;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public int m5345() {
        return Math.round(this.f6982.f6758);
    }

    /* renamed from: ⁱ  reason: contains not printable characters */
    public boolean m5346() {
        C1991 r0 = this.f6982;
        return r0.m5155() && r0.f6763 != 0;
    }

    /* JADX WARNING: Removed duplicated region for block: B:112:0x0268  */
    /* JADX WARNING: Removed duplicated region for block: B:115:0x027b  */
    /* JADX WARNING: Removed duplicated region for block: B:116:0x0282  */
    /* JADX WARNING: Removed duplicated region for block: B:119:0x028c  */
    /* JADX WARNING: Removed duplicated region for block: B:120:0x0293  */
    /* JADX WARNING: Removed duplicated region for block: B:123:0x029d  */
    /* JADX WARNING: Removed duplicated region for block: B:124:0x02a4  */
    /* JADX WARNING: Removed duplicated region for block: B:131:0x02c7  */
    /* JADX WARNING: Removed duplicated region for block: B:138:0x02ea  */
    /* JADX WARNING: Removed duplicated region for block: B:153:0x031e  */
    /* JADX WARNING: Removed duplicated region for block: B:156:0x0325  */
    /* JADX WARNING: Removed duplicated region for block: B:166:0x0374  */
    /* JADX WARNING: Removed duplicated region for block: B:167:0x037b  */
    /* JADX WARNING: Removed duplicated region for block: B:170:0x0386  */
    /* JADX WARNING: Removed duplicated region for block: B:171:0x038b  */
    /* JADX WARNING: Removed duplicated region for block: B:174:0x0394  */
    /* JADX WARNING: Removed duplicated region for block: B:175:0x0399  */
    /* JADX WARNING: Removed duplicated region for block: B:178:0x03a2  */
    /* JADX WARNING: Removed duplicated region for block: B:179:0x03a7  */
    /* JADX WARNING: Removed duplicated region for block: B:182:0x03b0  */
    /* JADX WARNING: Removed duplicated region for block: B:183:0x03b5  */
    /* JADX WARNING: Removed duplicated region for block: B:186:0x03be  */
    /* JADX WARNING: Removed duplicated region for block: B:187:0x03c3  */
    /* JADX WARNING: Removed duplicated region for block: B:218:0x0428  */
    /* JADX WARNING: Removed duplicated region for block: B:220:0x042e  */
    /* JADX WARNING: Removed duplicated region for block: B:222:0x0434  */
    /* JADX WARNING: Removed duplicated region for block: B:224:0x0439  */
    /* JADX WARNING: Removed duplicated region for block: B:228:0x0446  */
    /* JADX WARNING: Removed duplicated region for block: B:240:0x0470  */
    /* JADX WARNING: Removed duplicated region for block: B:252:0x04b2  */
    /* JADX WARNING: Removed duplicated region for block: B:254:0x04b9  */
    /* JADX WARNING: Removed duplicated region for block: B:256:0x04c0  */
    /* JADX WARNING: Removed duplicated region for block: B:259:? A[RETURN, SYNTHETIC] */
    @SuppressLint({"NewApi"})
    /* renamed from: K  reason: contains not printable characters */
    public void m5355(AttributeSet attributeSet, int i) {
        ColorStateList colorStateList;
        String str;
        ColorStateList colorStateList2;
        ColorStateList colorStateList3;
        boolean z;
        String str2;
        boolean z2;
        C2044 r16;
        int i2;
        C1991 r12;
        TypedArray obtainStyledAttributes;
        C2019 r2;
        int r1;
        Drawable drawable;
        C2044 r4;
        Drawable r13;
        Drawable r7;
        Drawable r8;
        Drawable r3;
        int r14;
        int r42;
        int r5;
        int resourceId;
        int length;
        Context context = this.f6985.getContext();
        C2044 r11 = C2044.m5313();
        C2019 r132 = C2019.m5223(context, attributeSet, R$styleable.AppCompatTextHelper, i, 0);
        TextView textView = this.f6985;
        C1729.m4475(textView, textView.getContext(), R$styleable.AppCompatTextHelper, attributeSet, r132.f6846, i, 0);
        int r15 = r132.m5230(R$styleable.AppCompatTextHelper_android_textAppearance, -1);
        if (r132.m5237(R$styleable.AppCompatTextHelper_android_drawableLeft)) {
            this.f6983 = m5342(context, r11, r132.m5230(R$styleable.AppCompatTextHelper_android_drawableLeft, 0));
        }
        if (r132.m5237(R$styleable.AppCompatTextHelper_android_drawableTop)) {
            this.f6979 = m5342(context, r11, r132.m5230(R$styleable.AppCompatTextHelper_android_drawableTop, 0));
        }
        if (r132.m5237(R$styleable.AppCompatTextHelper_android_drawableRight)) {
            this.f6989 = m5342(context, r11, r132.m5230(R$styleable.AppCompatTextHelper_android_drawableRight, 0));
        }
        if (r132.m5237(R$styleable.AppCompatTextHelper_android_drawableBottom)) {
            this.f6980 = m5342(context, r11, r132.m5230(R$styleable.AppCompatTextHelper_android_drawableBottom, 0));
        }
        int i3 = Build.VERSION.SDK_INT;
        if (r132.m5237(R$styleable.AppCompatTextHelper_android_drawableStart)) {
            this.f6988 = m5342(context, r11, r132.m5230(R$styleable.AppCompatTextHelper_android_drawableStart, 0));
        }
        if (r132.m5237(R$styleable.AppCompatTextHelper_android_drawableEnd)) {
            this.f6984 = m5342(context, r11, r132.m5230(R$styleable.AppCompatTextHelper_android_drawableEnd, 0));
        }
        r132.f6846.recycle();
        boolean z3 = this.f6985.getTransformationMethod() instanceof PasswordTransformationMethod;
        if (r15 != -1) {
            C2019 r6 = new C2019(context, context.obtainStyledAttributes(r15, R$styleable.TextAppearance));
            if (z3 || !r6.m5237(R$styleable.TextAppearance_textAllCaps)) {
                z2 = false;
                z = false;
            } else {
                z = r6.m5235(R$styleable.TextAppearance_textAllCaps, false);
                z2 = true;
            }
            m5351(context, r6);
            if (Build.VERSION.SDK_INT < 23) {
                colorStateList3 = r6.m5237(R$styleable.TextAppearance_android_textColor) ? r6.m5233(R$styleable.TextAppearance_android_textColor) : null;
                colorStateList = r6.m5237(R$styleable.TextAppearance_android_textColorHint) ? r6.m5233(R$styleable.TextAppearance_android_textColorHint) : null;
                colorStateList2 = r6.m5237(R$styleable.TextAppearance_android_textColorLink) ? r6.m5233(R$styleable.TextAppearance_android_textColorLink) : null;
            } else {
                colorStateList3 = null;
                colorStateList2 = null;
                colorStateList = null;
            }
            str = r6.m5237(R$styleable.TextAppearance_textLocale) ? r6.m5239(R$styleable.TextAppearance_textLocale) : null;
            str2 = (Build.VERSION.SDK_INT < 26 || !r6.m5237(R$styleable.TextAppearance_fontVariationSettings)) ? null : r6.m5239(R$styleable.TextAppearance_fontVariationSettings);
            r6.f6846.recycle();
        } else {
            z2 = false;
            str2 = null;
            z = false;
            colorStateList3 = null;
            colorStateList2 = null;
            str = null;
            colorStateList = null;
        }
        C2019 r43 = new C2019(context, context.obtainStyledAttributes(attributeSet, R$styleable.TextAppearance, i, 0));
        if (!z3 && r43.m5237(R$styleable.TextAppearance_textAllCaps)) {
            z = r43.m5235(R$styleable.TextAppearance_textAllCaps, false);
            z2 = true;
        }
        if (Build.VERSION.SDK_INT < 23) {
            if (r43.m5237(R$styleable.TextAppearance_android_textColor)) {
                colorStateList3 = r43.m5233(R$styleable.TextAppearance_android_textColor);
            }
            if (r43.m5237(R$styleable.TextAppearance_android_textColorHint)) {
                colorStateList = r43.m5233(R$styleable.TextAppearance_android_textColorHint);
            }
            if (r43.m5237(R$styleable.TextAppearance_android_textColorLink)) {
                colorStateList2 = r43.m5233(R$styleable.TextAppearance_android_textColorLink);
            }
        }
        if (r43.m5237(R$styleable.TextAppearance_textLocale)) {
            str = r43.m5239(R$styleable.TextAppearance_textLocale);
        }
        if (Build.VERSION.SDK_INT >= 26 && r43.m5237(R$styleable.TextAppearance_fontVariationSettings)) {
            str2 = r43.m5239(R$styleable.TextAppearance_fontVariationSettings);
        }
        if (Build.VERSION.SDK_INT < 28 || !r43.m5237(R$styleable.TextAppearance_android_textSize) || r43.m5224(R$styleable.TextAppearance_android_textSize, -1) != 0) {
            r16 = r11;
        } else {
            r16 = r11;
            this.f6985.setTextSize(0, 0.0f);
        }
        m5351(context, r43);
        r43.f6846.recycle();
        if (colorStateList3 != null) {
            this.f6985.setTextColor(colorStateList3);
        }
        if (colorStateList != null) {
            this.f6985.setHintTextColor(colorStateList);
        }
        if (colorStateList2 != null) {
            this.f6985.setLinkTextColor(colorStateList2);
        }
        if (!z3 && z2) {
            this.f6985.setAllCaps(z);
        }
        Typeface typeface = this.f6986;
        if (typeface != null) {
            if (this.f6981 == -1) {
                this.f6985.setTypeface(typeface, this.f6987);
            } else {
                this.f6985.setTypeface(typeface);
            }
        }
        if (str2 != null) {
            this.f6985.setFontVariationSettings(str2);
        }
        if (str != null) {
            if (Build.VERSION.SDK_INT >= 24) {
                this.f6985.setTextLocales(LocaleList.forLanguageTags(str));
            } else {
                i2 = 0;
                this.f6985.setTextLocale(Locale.forLanguageTag(str.substring(0, str.indexOf(44))));
                r12 = this.f6982;
                obtainStyledAttributes = r12.f6764.obtainStyledAttributes(attributeSet, R$styleable.AppCompatTextView, i, i2);
                TextView textView2 = r12.f6760;
                C1729.m4475(textView2, textView2.getContext(), R$styleable.AppCompatTextView, attributeSet, obtainStyledAttributes, i, 0);
                if (obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeTextType)) {
                    r12.f6763 = obtainStyledAttributes.getInt(R$styleable.AppCompatTextView_autoSizeTextType, 0);
                }
                float dimension = !obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeStepGranularity) ? obtainStyledAttributes.getDimension(R$styleable.AppCompatTextView_autoSizeStepGranularity, -1.0f) : -1.0f;
                float dimension2 = !obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeMinTextSize) ? obtainStyledAttributes.getDimension(R$styleable.AppCompatTextView_autoSizeMinTextSize, -1.0f) : -1.0f;
                float dimension3 = !obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeMaxTextSize) ? obtainStyledAttributes.getDimension(R$styleable.AppCompatTextView_autoSizeMaxTextSize, -1.0f) : -1.0f;
                if (obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizePresetSizes) && (resourceId = obtainStyledAttributes.getResourceId(R$styleable.AppCompatTextView_autoSizePresetSizes, 0)) > 0) {
                    TypedArray obtainTypedArray = obtainStyledAttributes.getResources().obtainTypedArray(resourceId);
                    length = obtainTypedArray.length();
                    int[] iArr = new int[length];
                    if (length > 0) {
                        for (int i4 = 0; i4 < length; i4++) {
                            iArr[i4] = obtainTypedArray.getDimensionPixelSize(i4, -1);
                        }
                        r12.f6765 = r12.m5154(iArr);
                        r12.m5148();
                    }
                    obtainTypedArray.recycle();
                }
                obtainStyledAttributes.recycle();
                if (r12.m5155()) {
                    r12.f6763 = 0;
                } else if (r12.f6763 == 1) {
                    if (!r12.f6762) {
                        DisplayMetrics displayMetrics = r12.f6764.getResources().getDisplayMetrics();
                        if (dimension2 == -1.0f) {
                            dimension2 = TypedValue.applyDimension(2, 12.0f, displayMetrics);
                        }
                        if (dimension3 == -1.0f) {
                            dimension3 = TypedValue.applyDimension(2, 112.0f, displayMetrics);
                        }
                        if (dimension == -1.0f) {
                            dimension = 1.0f;
                        }
                        r12.m5152(dimension2, dimension3, dimension);
                    }
                    r12.m5149();
                }
                if (AbstractC1835.f6227) {
                    C1991 r17 = this.f6982;
                    if (r17.f6763 != 0) {
                        int[] iArr2 = r17.f6765;
                        if (iArr2.length > 0) {
                            if (((float) this.f6985.getAutoSizeStepGranularity()) != -1.0f) {
                                this.f6985.setAutoSizeTextTypeUniformWithConfiguration(Math.round(this.f6982.f6766), Math.round(this.f6982.f6758), Math.round(this.f6982.f6757), 0);
                            } else {
                                this.f6985.setAutoSizeTextTypeUniformWithPresetSizes(iArr2, 0);
                            }
                        }
                    }
                }
                r2 = new C2019(context, context.obtainStyledAttributes(attributeSet, R$styleable.AppCompatTextView));
                r1 = r2.m5230(R$styleable.AppCompatTextView_drawableLeftCompat, -1);
                if (r1 == -1) {
                    r4 = r16;
                    drawable = r4.m5316(context, r1);
                } else {
                    r4 = r16;
                    drawable = null;
                }
                int r18 = r2.m5230(R$styleable.AppCompatTextView_drawableTopCompat, -1);
                r13 = r18 == -1 ? r4.m5316(context, r18) : null;
                int r52 = r2.m5230(R$styleable.AppCompatTextView_drawableRightCompat, -1);
                Drawable r53 = r52 == -1 ? r4.m5316(context, r52) : null;
                int r72 = r2.m5230(R$styleable.AppCompatTextView_drawableBottomCompat, -1);
                r7 = r72 == -1 ? r4.m5316(context, r72) : null;
                int r82 = r2.m5230(R$styleable.AppCompatTextView_drawableStartCompat, -1);
                r8 = r82 == -1 ? r4.m5316(context, r82) : null;
                int r9 = r2.m5230(R$styleable.AppCompatTextView_drawableEndCompat, -1);
                r3 = r9 == -1 ? r4.m5316(context, r9) : null;
                int i5 = Build.VERSION.SDK_INT;
                if (r8 == null || r3 != null) {
                    Drawable[] compoundDrawablesRelative = this.f6985.getCompoundDrawablesRelative();
                    TextView textView3 = this.f6985;
                    if (r8 == null) {
                        r8 = compoundDrawablesRelative[0];
                    }
                    if (r13 == null) {
                        r13 = compoundDrawablesRelative[1];
                    }
                    if (r3 == null) {
                        r3 = compoundDrawablesRelative[2];
                    }
                    if (r7 == null) {
                        r7 = compoundDrawablesRelative[3];
                    }
                    textView3.setCompoundDrawablesRelativeWithIntrinsicBounds(r8, r13, r3, r7);
                } else if (!(drawable == null && r13 == null && r53 == null && r7 == null)) {
                    int i6 = Build.VERSION.SDK_INT;
                    Drawable[] compoundDrawablesRelative2 = this.f6985.getCompoundDrawablesRelative();
                    if (compoundDrawablesRelative2[0] == null && compoundDrawablesRelative2[2] == null) {
                        Drawable[] compoundDrawables = this.f6985.getCompoundDrawables();
                        TextView textView4 = this.f6985;
                        if (drawable == null) {
                            drawable = compoundDrawables[0];
                        }
                        if (r13 == null) {
                            r13 = compoundDrawables[1];
                        }
                        if (r53 == null) {
                            r53 = compoundDrawables[2];
                        }
                        if (r7 == null) {
                            r7 = compoundDrawables[3];
                        }
                        textView4.setCompoundDrawablesWithIntrinsicBounds(drawable, r13, r53, r7);
                    } else {
                        TextView textView5 = this.f6985;
                        Drawable drawable2 = compoundDrawablesRelative2[0];
                        if (r13 == null) {
                            r13 = compoundDrawablesRelative2[1];
                        }
                        Drawable drawable3 = compoundDrawablesRelative2[2];
                        if (r7 == null) {
                            r7 = compoundDrawablesRelative2[3];
                        }
                        textView5.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable2, r13, drawable3, r7);
                    }
                }
                if (r2.m5237(R$styleable.AppCompatTextView_drawableTint)) {
                    ColorStateList r19 = r2.m5233(R$styleable.AppCompatTextView_drawableTint);
                    TextView textView6 = this.f6985;
                    if (textView6 == null) {
                        throw new NullPointerException();
                    } else if (Build.VERSION.SDK_INT >= 24) {
                        textView6.setCompoundDrawableTintList(r19);
                    } else if (textView6 instanceof AbstractC1840) {
                        ((AbstractC1840) textView6).setSupportCompoundDrawablesTintList(r19);
                    }
                }
                if (r2.m5237(R$styleable.AppCompatTextView_drawableTintMode)) {
                    PorterDuff.Mode r110 = C2021.m5242(r2.m5238(R$styleable.AppCompatTextView_drawableTintMode, -1), null);
                    TextView textView7 = this.f6985;
                    if (textView7 == null) {
                        throw new NullPointerException();
                    } else if (Build.VERSION.SDK_INT >= 24) {
                        textView7.setCompoundDrawableTintMode(r110);
                    } else if (textView7 instanceof AbstractC1840) {
                        ((AbstractC1840) textView7).setSupportCompoundDrawablesTintMode(r110);
                    }
                }
                r14 = r2.m5224(R$styleable.AppCompatTextView_firstBaselineToTopHeight, -1);
                r42 = r2.m5224(R$styleable.AppCompatTextView_lastBaselineToBottomHeight, -1);
                r5 = r2.m5224(R$styleable.AppCompatTextView_lineHeight, -1);
                r2.f6846.recycle();
                if (r14 != -1) {
                    C1841.m4793(this.f6985, r14);
                }
                if (r42 != -1) {
                    C1841.m4759(this.f6985, r42);
                }
                if (r5 == -1) {
                    C1841.m4742(this.f6985, r5);
                    return;
                }
                return;
            }
        }
        i2 = 0;
        r12 = this.f6982;
        obtainStyledAttributes = r12.f6764.obtainStyledAttributes(attributeSet, R$styleable.AppCompatTextView, i, i2);
        TextView textView22 = r12.f6760;
        C1729.m4475(textView22, textView22.getContext(), R$styleable.AppCompatTextView, attributeSet, obtainStyledAttributes, i, 0);
        if (obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeTextType)) {
        }
        if (!obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeStepGranularity)) {
        }
        if (!obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeMinTextSize)) {
        }
        if (!obtainStyledAttributes.hasValue(R$styleable.AppCompatTextView_autoSizeMaxTextSize)) {
        }
        TypedArray obtainTypedArray2 = obtainStyledAttributes.getResources().obtainTypedArray(resourceId);
        length = obtainTypedArray2.length();
        int[] iArr3 = new int[length];
        if (length > 0) {
        }
        obtainTypedArray2.recycle();
        obtainStyledAttributes.recycle();
        if (r12.m5155()) {
        }
        if (AbstractC1835.f6227) {
        }
        r2 = new C2019(context, context.obtainStyledAttributes(attributeSet, R$styleable.AppCompatTextView));
        r1 = r2.m5230(R$styleable.AppCompatTextView_drawableLeftCompat, -1);
        if (r1 == -1) {
        }
        int r182 = r2.m5230(R$styleable.AppCompatTextView_drawableTopCompat, -1);
        if (r182 == -1) {
        }
        int r522 = r2.m5230(R$styleable.AppCompatTextView_drawableRightCompat, -1);
        if (r522 == -1) {
        }
        int r722 = r2.m5230(R$styleable.AppCompatTextView_drawableBottomCompat, -1);
        if (r722 == -1) {
        }
        int r822 = r2.m5230(R$styleable.AppCompatTextView_drawableStartCompat, -1);
        if (r822 == -1) {
        }
        int r92 = r2.m5230(R$styleable.AppCompatTextView_drawableEndCompat, -1);
        if (r92 == -1) {
        }
        int i52 = Build.VERSION.SDK_INT;
        if (r8 == null) {
        }
        Drawable[] compoundDrawablesRelative3 = this.f6985.getCompoundDrawablesRelative();
        TextView textView32 = this.f6985;
        if (r8 == null) {
        }
        if (r13 == null) {
        }
        if (r3 == null) {
        }
        if (r7 == null) {
        }
        textView32.setCompoundDrawablesRelativeWithIntrinsicBounds(r8, r13, r3, r7);
        if (r2.m5237(R$styleable.AppCompatTextView_drawableTint)) {
        }
        if (r2.m5237(R$styleable.AppCompatTextView_drawableTintMode)) {
        }
        r14 = r2.m5224(R$styleable.AppCompatTextView_firstBaselineToTopHeight, -1);
        r42 = r2.m5224(R$styleable.AppCompatTextView_lastBaselineToBottomHeight, -1);
        r5 = r2.m5224(R$styleable.AppCompatTextView_lineHeight, -1);
        r2.f6846.recycle();
        if (r14 != -1) {
        }
        if (r42 != -1) {
        }
        if (r5 == -1) {
        }
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public int m5357() {
        return this.f6982.f6763;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public int m5358() {
        return Math.round(this.f6982.f6757);
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m5351(Context context, C2019 r11) {
        int i;
        String r10;
        this.f6987 = r11.m5238(R$styleable.TextAppearance_android_textStyle, this.f6987);
        boolean z = false;
        if (Build.VERSION.SDK_INT >= 28) {
            this.f6981 = r11.m5238(R$styleable.TextAppearance_android_textFontWeight, -1);
            if (this.f6981 != -1) {
                this.f6987 = (this.f6987 & 2) | 0;
            }
        }
        if (r11.m5237(R$styleable.TextAppearance_android_fontFamily) || r11.m5237(R$styleable.TextAppearance_fontFamily)) {
            this.f6986 = null;
            if (r11.m5237(R$styleable.TextAppearance_fontFamily)) {
                i = R$styleable.TextAppearance_fontFamily;
            } else {
                i = R$styleable.TextAppearance_android_fontFamily;
            }
            int i2 = this.f6981;
            int i3 = this.f6987;
            if (!context.isRestricted()) {
                try {
                    Typeface r102 = r11.m5234(i, this.f6987, new C2055(i2, i3, new WeakReference(this.f6985)));
                    if (r102 != null) {
                        if (Build.VERSION.SDK_INT < 28 || this.f6981 == -1) {
                            this.f6986 = r102;
                        } else {
                            this.f6986 = Typeface.create(Typeface.create(r102, 0), this.f6981, (this.f6987 & 2) != 0);
                        }
                    }
                    this.f6991 = this.f6986 == null;
                } catch (Resources.NotFoundException | UnsupportedOperationException unused) {
                }
            }
            if (this.f6986 == null && (r10 = r11.m5239(i)) != null) {
                if (Build.VERSION.SDK_INT < 28 || this.f6981 == -1) {
                    this.f6986 = Typeface.create(r10, this.f6987);
                    return;
                }
                Typeface create = Typeface.create(r10, 0);
                int i4 = this.f6981;
                if ((this.f6987 & 2) != 0) {
                    z = true;
                }
                this.f6986 = Typeface.create(create, i4, z);
            }
        } else if (r11.m5237(R$styleable.TextAppearance_android_typeface)) {
            this.f6991 = false;
            int r103 = r11.m5238(R$styleable.TextAppearance_android_typeface, 1);
            if (r103 == 1) {
                this.f6986 = Typeface.SANS_SERIF;
            } else if (r103 == 2) {
                this.f6986 = Typeface.SERIF;
            } else if (r103 == 3) {
                this.f6986 = Typeface.MONOSPACE;
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5350(Context context, int i) {
        String r4;
        ColorStateList r5;
        C2019 r1 = new C2019(context, context.obtainStyledAttributes(i, R$styleable.TextAppearance));
        if (r1.m5237(R$styleable.TextAppearance_textAllCaps)) {
            this.f6985.setAllCaps(r1.m5235(R$styleable.TextAppearance_textAllCaps, false));
        }
        if (Build.VERSION.SDK_INT < 23 && r1.m5237(R$styleable.TextAppearance_android_textColor) && (r5 = r1.m5233(R$styleable.TextAppearance_android_textColor)) != null) {
            this.f6985.setTextColor(r5);
        }
        if (r1.m5237(R$styleable.TextAppearance_android_textSize) && r1.m5224(R$styleable.TextAppearance_android_textSize, -1) == 0) {
            this.f6985.setTextSize(0, 0.0f);
        }
        m5351(context, r1);
        if (Build.VERSION.SDK_INT >= 26 && r1.m5237(R$styleable.TextAppearance_fontVariationSettings) && (r4 = r1.m5239(R$styleable.TextAppearance_fontVariationSettings)) != null) {
            this.f6985.setFontVariationSettings(r4);
        }
        r1.f6846.recycle();
        Typeface typeface = this.f6986;
        if (typeface != null) {
            this.f6985.setTypeface(typeface, this.f6987);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5347() {
        if (!(this.f6983 == null && this.f6979 == null && this.f6989 == null && this.f6980 == null)) {
            Drawable[] compoundDrawables = this.f6985.getCompoundDrawables();
            m5354(compoundDrawables[0], this.f6983);
            m5354(compoundDrawables[1], this.f6979);
            m5354(compoundDrawables[2], this.f6989);
            m5354(compoundDrawables[3], this.f6980);
        }
        int i = Build.VERSION.SDK_INT;
        if (this.f6988 != null || this.f6984 != null) {
            Drawable[] compoundDrawablesRelative = this.f6985.getCompoundDrawablesRelative();
            m5354(compoundDrawablesRelative[0], this.f6988);
            m5354(compoundDrawablesRelative[2], this.f6984);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m5354(Drawable drawable, C2029 r3) {
        if (drawable != null && r3 != null) {
            C2044.m5314(drawable, r3, this.f6985.getDrawableState());
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C2029 m5342(Context context, C2044 r1, int i) {
        ColorStateList r0 = r1.m5315(context, i);
        if (r0 == null) {
            return null;
        }
        C2029 r12 = new C2029();
        r12.f6877 = true;
        r12.f6876 = r0;
        return r12;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5348(int i) {
        C1991 r0 = this.f6982;
        if (!r0.m5155()) {
            return;
        }
        if (i == 0) {
            r0.f6763 = 0;
            r0.f6766 = -1.0f;
            r0.f6758 = -1.0f;
            r0.f6757 = -1.0f;
            r0.f6765 = new int[0];
            r0.f6761 = false;
        } else if (i == 1) {
            DisplayMetrics displayMetrics = r0.f6764.getResources().getDisplayMetrics();
            r0.m5152(TypedValue.applyDimension(2, 12.0f, displayMetrics), TypedValue.applyDimension(2, 112.0f, displayMetrics), 1.0f);
            if (r0.m5149()) {
                r0.m5151();
            }
        } else {
            throw new IllegalArgumentException(C1293.m3408("Unknown auto-size text type: ", i));
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5349(int i, int i2, int i3, int i4) throws IllegalArgumentException {
        C1991 r0 = this.f6982;
        if (r0.m5155()) {
            DisplayMetrics displayMetrics = r0.f6764.getResources().getDisplayMetrics();
            r0.m5152(TypedValue.applyDimension(i4, (float) i, displayMetrics), TypedValue.applyDimension(i4, (float) i2, displayMetrics), TypedValue.applyDimension(i4, (float) i3, displayMetrics));
            if (r0.m5149()) {
                r0.m5151();
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5356(int[] iArr, int i) throws IllegalArgumentException {
        C1991 r0 = this.f6982;
        if (r0.m5155()) {
            int length = iArr.length;
            if (length > 0) {
                int[] iArr2 = new int[length];
                if (i == 0) {
                    iArr2 = Arrays.copyOf(iArr, length);
                } else {
                    DisplayMetrics displayMetrics = r0.f6764.getResources().getDisplayMetrics();
                    for (int i2 = 0; i2 < length; i2++) {
                        iArr2[i2] = Math.round(TypedValue.applyDimension(i, (float) iArr[i2], displayMetrics));
                    }
                }
                r0.f6765 = r0.m5154(iArr2);
                if (!r0.m5148()) {
                    StringBuilder r02 = C1293.m3416("None of the preset sizes is valid: ");
                    r02.append(Arrays.toString(iArr));
                    throw new IllegalArgumentException(r02.toString());
                }
            } else {
                r0.f6762 = false;
            }
            if (r0.m5149()) {
                r0.m5151();
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5352(ColorStateList colorStateList) {
        if (this.f6990 == null) {
            this.f6990 = new C2029();
        }
        C2029 r0 = this.f6990;
        r0.f6876 = colorStateList;
        r0.f6877 = colorStateList != null;
        C2029 r2 = this.f6990;
        this.f6983 = r2;
        this.f6979 = r2;
        this.f6989 = r2;
        this.f6980 = r2;
        this.f6988 = r2;
        this.f6984 = r2;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5353(PorterDuff.Mode mode) {
        if (this.f6990 == null) {
            this.f6990 = new C2029();
        }
        C2029 r0 = this.f6990;
        r0.f6875 = mode;
        r0.f6874 = mode != null;
        C2029 r2 = this.f6990;
        this.f6983 = r2;
        this.f6979 = r2;
        this.f6989 = r2;
        this.f6980 = r2;
        this.f6988 = r2;
        this.f6984 = r2;
    }
}
