package defpackage;

import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Parcelable;
import android.text.Layout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import android.widget.Checkable;
import android.widget.CompoundButton;
import android.widget.TextView;
import java.util.Iterator;
import java.util.LinkedHashSet;

/* renamed from: ˎᵣ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C1762 extends C4512 implements Checkable, InterfaceC0546 {

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public int f7091;

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public PorterDuff.Mode f7092;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public boolean f7093;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public int f7094;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public int f7095;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public int f7096;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public EnumC2583 f7097;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public boolean f7098;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public int f7099;

    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    public float f7100;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public PorterDuff.Mode f7101;

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public boolean f7102;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public int f7103;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public Drawable f7104;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public String f7105;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public int f7106;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public int f7107;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public ColorStateList f7108;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public int f7109;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public int f7110;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final LinkedHashSet f7111;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final C4742 f7112;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public Drawable f7113;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public int f7114;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public ColorStateList f7115;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public float f7116;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public int f7117;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public float f7118;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public boolean f7119;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public int f7120;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public int f7121;

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public static final int[] f7090 = {R.attr.state_checkable};

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public static final int[] f7089 = {R.attr.state_checked};

    /* JADX WARN: Removed duplicated region for block: B:28:0x00fa  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public C1762(android.content.Context r17, android.util.AttributeSet r18) throws android.content.res.Resources.NotFoundException {
        /*
            Method dump skipped, instructions count: 627
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1762.<init>(android.content.Context, android.util.AttributeSet):void");
    }

    private Layout.Alignment getActualTextAlignment() {
        int textAlignment = getTextAlignment();
        return textAlignment != 1 ? (textAlignment == 6 || textAlignment == 3) ? Layout.Alignment.ALIGN_OPPOSITE : textAlignment != 4 ? Layout.Alignment.ALIGN_NORMAL : Layout.Alignment.ALIGN_CENTER : getGravityTextAlignment();
    }

    private float getDisplayedWidthIncrease() {
        return this.f7118;
    }

    private Layout.Alignment getGravityTextAlignment() {
        int gravity = getGravity() & 8388615;
        return gravity != 1 ? (gravity == 5 || gravity == 8388613) ? Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_NORMAL : Layout.Alignment.ALIGN_CENTER;
    }

    private int getOpticalCenterShift() {
        return 0;
    }

    private int getTextHeight() {
        if (getLineCount() > 1) {
            return getLayout().getHeight();
        }
        TextPaint paint = getPaint();
        String string = getText().toString();
        if (getTransformationMethod() != null) {
            string = getTransformationMethod().getTransformation(string, this).toString();
        }
        Rect rect = new Rect();
        paint.getTextBounds(string, 0, string.length(), rect);
        return Math.min(rect.height(), getLayout().getHeight());
    }

    private int getTextLayoutWidth() {
        int lineCount = getLineCount();
        float fMax = 0.0f;
        for (int i = 0; i < lineCount; i++) {
            fMax = Math.max(fMax, getLayout().getLineWidth(i));
        }
        return (int) Math.ceil(fMax);
    }

    private void setCheckedInternal(boolean z) {
        C4742 c4742 = this.f7112;
        if (c4742 == null || !c4742.f17567 || this.f7098 == z) {
            return;
        }
        this.f7098 = z;
        refreshDrawableState();
        getParent();
        if (this.f7093) {
            return;
        }
        this.f7093 = true;
        Iterator it = this.f7111.iterator();
        if (!it.hasNext()) {
            this.f7093 = false;
        } else {
            it.next().getClass();
            C0910.m3050();
        }
    }

    private void setDisplayedWidthIncrease(float f) {
        if (this.f7118 != f) {
            this.f7118 = f;
            m5031();
            invalidate();
            getParent();
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static /* synthetic */ void m5022(C1762 c1762) {
        c1762.f7114 = c1762.getOpticalCenterShift();
        c1762.m5031();
        c1762.invalidate();
    }

    public String getA11yClassName() {
        if (!TextUtils.isEmpty(this.f7105)) {
            return this.f7105;
        }
        C4742 c4742 = this.f7112;
        return ((c4742 == null || !c4742.f17567) ? Button.class : CompoundButton.class).getName();
    }

    public int getAllowedWidthDecrease() {
        return this.f7120;
    }

    @Override // android.view.View
    public ColorStateList getBackgroundTintList() {
        return getSupportBackgroundTintList();
    }

    @Override // android.view.View
    public PorterDuff.Mode getBackgroundTintMode() {
        return getSupportBackgroundTintMode();
    }

    public int getCornerRadius() {
        if (m5024()) {
            return this.f7112.f17566;
        }
        return 0;
    }

    public C1107 getCornerSpringForce() {
        return this.f7112.f17564;
    }

    public Drawable getIcon() {
        return this.f7104;
    }

    public int getIconGravity() {
        return this.f7095;
    }

    public int getIconPadding() {
        return this.f7106;
    }

    public int getIconSize() {
        return this.f7117;
    }

    public ColorStateList getIconTint() {
        return this.f7108;
    }

    public PorterDuff.Mode getIconTintMode() {
        return this.f7092;
    }

    public int getInsetBottom() {
        return this.f7112.f17579;
    }

    public int getInsetLeft() {
        return this.f7112.f17559;
    }

    public int getInsetRight() {
        return this.f7112.f17563;
    }

    public int getInsetTop() {
        return this.f7112.f17562;
    }

    public ColorStateList getRippleColor() {
        if (m5024()) {
            return this.f7112.f17572;
        }
        return null;
    }

    public Drawable getSecondaryIcon() {
        return this.f7113;
    }

    public int getSecondaryIconGravity() {
        return this.f7107;
    }

    public ColorStateList getSecondaryIconTint() {
        return this.f7115;
    }

    public PorterDuff.Mode getSecondaryIconTintMode() {
        return this.f7101;
    }

    public InterfaceC2895 getShapeAppearance() {
        if (m5024()) {
            return this.f7112.f17575;
        }
        ᵹˉᵞ.ᵳٴᵶ("Attempted to get ShapeAppearance from a MaterialButton which has an overwritten background.");
        return null;
    }

    public C4879 getShapeAppearanceModel() {
        if (m5024()) {
            return this.f7112.f17575.mo7064();
        }
        ᵹˉᵞ.ᵳٴᵶ("Attempted to get ShapeAppearanceModel from a MaterialButton which has an overwritten background.");
        return null;
    }

    public ColorStateList getStrokeColor() {
        if (m5024()) {
            return this.f7112.f17573;
        }
        return null;
    }

    public int getStrokeWidth() {
        if (m5024()) {
            return this.f7112.f17576;
        }
        return 0;
    }

    @Override // defpackage.C4512
    public ColorStateList getSupportBackgroundTintList() {
        return m5024() ? this.f7112.f17561 : super.getSupportBackgroundTintList();
    }

    @Override // defpackage.C4512
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        return m5024() ? this.f7112.f17578 : super.getSupportBackgroundTintMode();
    }

    @Override // android.widget.Checkable
    public final boolean isChecked() {
        return this.f7098;
    }

    @Override // android.widget.TextView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (m5024()) {
            C2445 c2445M10022 = this.f7112.m10022(false);
            C0871 c0871 = c2445M10022.f9549.f20066;
            if (c0871 == null || !c0871.f3964) {
                return;
            }
            float elevation = 0.0f;
            for (ViewParent parent = getParent(); parent instanceof View; parent = parent.getParent()) {
                elevation += ((View) parent).getElevation();
            }
            C5355 c5355 = c2445M10022.f9549;
            if (c5355.f20057 != elevation) {
                c5355.f20057 = elevation;
                c2445M10022.m6252();
            }
        }
    }

    @Override // android.widget.TextView, android.view.View
    public final int[] onCreateDrawableState(int i) {
        int[] iArrOnCreateDrawableState = super.onCreateDrawableState(i + 2);
        C4742 c4742 = this.f7112;
        if (c4742 != null && c4742.f17567) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f7090);
        }
        if (this.f7098) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f7089);
        }
        return iArrOnCreateDrawableState;
    }

    @Override // defpackage.C4512, android.view.View
    public final void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(accessibilityEvent);
        accessibilityEvent.setClassName(getA11yClassName());
        accessibilityEvent.setChecked(this.f7098);
    }

    @Override // defpackage.C4512, android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName(getA11yClassName());
        C4742 c4742 = this.f7112;
        accessibilityNodeInfo.setCheckable(c4742 != null && c4742.f17567);
        accessibilityNodeInfo.setChecked(this.f7098);
        accessibilityNodeInfo.setClickable(isClickable());
    }

    @Override // defpackage.C4512, android.widget.TextView, android.view.View
    public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
        int i5;
        super.onLayout(z, i, i2, i3, i4);
        m5038(getMeasuredWidth(), getMeasuredHeight());
        m5029(getMeasuredWidth(), getMeasuredHeight());
        int i6 = getResources().getConfiguration().orientation;
        if (this.f7099 != i6) {
            this.f7099 = i6;
            this.f7116 = -2.14748365E9f;
        }
        if (this.f7116 == -2.14748365E9f) {
            this.f7116 = getMeasuredWidth();
            getParent();
        }
        if (this.f7120 == Integer.MIN_VALUE) {
            if (this.f7104 == null) {
                i5 = 0;
            } else {
                int iconPadding = getIconPadding();
                int intrinsicWidth = this.f7117;
                if (intrinsicWidth == 0) {
                    intrinsicWidth = this.f7104.getIntrinsicWidth();
                }
                i5 = iconPadding + intrinsicWidth;
            }
            this.f7120 = (getMeasuredWidth() - getTextLayoutWidth()) - i5;
        }
        if (this.f7110 == Integer.MIN_VALUE) {
            this.f7110 = getPaddingStart();
        }
        if (this.f7096 == Integer.MIN_VALUE) {
            this.f7096 = getPaddingEnd();
        }
        getParent();
    }

    @Override // android.widget.TextView, android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof C3929)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        C3929 c3929 = (C3929) parcelable;
        super.onRestoreInstanceState(c3929.f7157);
        setChecked(c3929.f14847);
    }

    @Override // android.widget.TextView, android.view.View
    public final Parcelable onSaveInstanceState() {
        C3929 c3929 = new C3929(super.onSaveInstanceState());
        c3929.f14847 = this.f7098;
        return c3929;
    }

    @Override // defpackage.C4512, android.widget.TextView
    public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        super.onTextChanged(charSequence, i, i2, i3);
        m5038(getMeasuredWidth(), getMeasuredHeight());
        m5029(getMeasuredWidth(), getMeasuredHeight());
    }

    @Override // android.view.View
    public final boolean performClick() {
        boolean z;
        if (isEnabled() && this.f7112.f17571) {
            toggle();
            z = true;
        } else {
            z = false;
        }
        boolean zPerformClick = super.performClick();
        if (z && !zPerformClick) {
            playSoundEffect(0);
        }
        return zPerformClick;
    }

    @Override // android.view.View
    public final void refreshDrawableState() {
        super.refreshDrawableState();
        if (this.f7104 != null) {
            if (this.f7104.setState(getDrawableState())) {
                invalidate();
            }
        }
    }

    public void setA11yClassName(String str) {
        this.f7105 = str;
    }

    @Override // android.view.View
    public void setBackground(Drawable drawable) {
        setBackgroundDrawable(drawable);
    }

    @Override // android.view.View
    public void setBackgroundColor(int i) {
        if (!m5024()) {
            super.setBackgroundColor(i);
            return;
        }
        C4742 c4742 = this.f7112;
        if (c4742.m10022(false) != null) {
            c4742.m10022(false).setTint(i);
        }
    }

    @Override // defpackage.C4512, android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        if (!m5024()) {
            super.setBackgroundDrawable(drawable);
            return;
        }
        if (drawable == getBackground()) {
            getBackground().setState(drawable.getState());
            return;
        }
        C4742 c4742 = this.f7112;
        c4742.f17568 = true;
        C1762 c1762 = c4742.f17569;
        c1762.setSupportBackgroundTintList(c4742.f17561);
        c1762.setSupportBackgroundTintMode(c4742.f17578);
        super.setBackgroundDrawable(drawable);
    }

    @Override // defpackage.C4512, android.view.View
    public void setBackgroundResource(int i) {
        setBackgroundDrawable(i != 0 ? ᵕˏᵛ.ˑᵥˁ(getContext(), i) : null);
    }

    @Override // android.view.View
    public void setBackgroundTintList(ColorStateList colorStateList) {
        setSupportBackgroundTintList(colorStateList);
    }

    @Override // android.view.View
    public void setBackgroundTintMode(PorterDuff.Mode mode) {
        setSupportBackgroundTintMode(mode);
    }

    public void setCheckable(boolean z) {
        if (m5024()) {
            this.f7112.f17567 = z;
        }
    }

    @Override // android.widget.Checkable
    public void setChecked(boolean z) {
        setCheckedInternal(z);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablePadding(int i) {
        if (getCompoundDrawablePadding() != i) {
            this.f7116 = -2.14748365E9f;
        }
        super.setCompoundDrawablePadding(i);
    }

    public void setCornerRadius(int i) {
        if (m5024()) {
            C4742 c4742 = this.f7112;
            if (c4742.f17577 && c4742.f17566 == i) {
                return;
            }
            c4742.f17566 = i;
            c4742.f17577 = true;
            c4742.f17575 = c4742.f17575.mo7065(i);
            c4742.m10024();
        }
    }

    public void setCornerRadiusResource(int i) {
        if (m5024()) {
            setCornerRadius(getResources().getDimensionPixelSize(i));
        }
    }

    public void setCornerSpringForce(C1107 c1107) {
        C4742 c4742 = this.f7112;
        c4742.f17564 = c1107;
        if (c4742.f17575 instanceof C3410) {
            c4742.m10024();
        }
    }

    public void setDisplayedWidthDecrease(int i) {
        this.f7100 = Math.min(i, this.f7120);
        m5031();
        invalidate();
    }

    @Override // android.view.View
    public void setElevation(float f) {
        super.setElevation(f);
        if (m5024()) {
            C2445 c2445M10022 = this.f7112.m10022(false);
            C5355 c5355 = c2445M10022.f9549;
            if (c5355.f20064 != f) {
                c5355.f20064 = f;
                c2445M10022.m6252();
            }
        }
    }

    public void setIcon(Drawable drawable) {
        if (this.f7104 != drawable) {
            this.f7116 = -2.14748365E9f;
            this.f7104 = drawable;
            m5032(true);
            m5038(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public void setIconGravity(int i) {
        if (this.f7095 != i) {
            if (this.f7104 != null && this.f7113 != null && m5028()) {
                ᵹˉᵞ.ˌᵜᵹᵩ("iconGravity cannot have the same alignment as secondaryIconGravity");
            } else {
                this.f7095 = i;
                m5038(getMeasuredWidth(), getMeasuredHeight());
            }
        }
    }

    public void setIconPadding(int i) {
        if (this.f7106 != i) {
            this.f7106 = i;
            setCompoundDrawablePadding(i);
        }
    }

    public void setIconResource(int i) {
        setIcon(i != 0 ? ᵕˏᵛ.ˑᵥˁ(getContext(), i) : null);
    }

    public void setIconSize(int i) {
        if (i < 0) {
            ᵹˉᵞ.ˌᵜᵹᵩ("iconSize cannot be less than 0");
        } else if (this.f7117 != i) {
            this.f7116 = -2.14748365E9f;
            this.f7117 = i;
            m5032(true);
            m5033(true);
        }
    }

    public void setIconTint(ColorStateList colorStateList) {
        if (this.f7108 != colorStateList) {
            this.f7108 = colorStateList;
            m5032(false);
        }
    }

    public void setIconTintMode(PorterDuff.Mode mode) {
        if (this.f7092 != mode) {
            this.f7092 = mode;
            m5032(false);
        }
    }

    public void setIconTintResource(int i) {
        setIconTint(AbstractC5363.m10989(getContext(), i));
    }

    public void setInsetBottom(int i) {
        C4742 c4742 = this.f7112;
        c4742.m10023(c4742.f17559, c4742.f17562, c4742.f17563, i);
    }

    public void setInsetLeft(int i) {
        C4742 c4742 = this.f7112;
        c4742.m10023(i, c4742.f17562, c4742.f17563, c4742.f17579);
    }

    public void setInsetRight(int i) {
        C4742 c4742 = this.f7112;
        c4742.m10023(c4742.f17559, c4742.f17562, i, c4742.f17579);
    }

    public void setInsetTop(int i) {
        C4742 c4742 = this.f7112;
        c4742.m10023(c4742.f17559, i, c4742.f17563, c4742.f17579);
    }

    public void setInternalBackground(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
    }

    public void setOnPressedChangeListenerInternal(InterfaceC5402 interfaceC5402) {
    }

    public void setOpticalCenterEnabled(boolean z) {
        if (this.f7102 != z) {
            this.f7102 = z;
            int i = 1;
            C4742 c4742 = this.f7112;
            if (z) {
                ᵶﾞᴵ r4 = new ᵶﾞᴵ(1, this);
                c4742.f17580 = r4;
                C2445 c2445M10022 = c4742.m10022(false);
                if (c2445M10022 != null) {
                    c2445M10022.f9553 = r4;
                }
            } else {
                c4742.f17580 = null;
                C2445 c2445M100222 = c4742.m10022(false);
                if (c2445M100222 != null) {
                    c2445M100222.f9553 = null;
                }
            }
            post(new RunnableC1600(i, this));
        }
    }

    @Override // android.view.View
    public void setPressed(boolean z) {
        super.setPressed(z);
    }

    public void setRippleColor(ColorStateList colorStateList) {
        if (m5024()) {
            C4742 c4742 = this.f7112;
            C1762 c1762 = c4742.f17569;
            if (c4742.f17572 != colorStateList) {
                c4742.f17572 = colorStateList;
                if (c1762.getBackground() instanceof RippleDrawable) {
                    ((RippleDrawable) c1762.getBackground()).setColor(ᵛᵾˏ.ˌᵪ(colorStateList));
                }
            }
        }
    }

    public void setRippleColorResource(int i) {
        if (m5024()) {
            setRippleColor(AbstractC5363.m10989(getContext(), i));
        }
    }

    public void setSecondaryIcon(Drawable drawable) {
        if (this.f7113 != drawable) {
            this.f7116 = -2.14748365E9f;
            this.f7113 = drawable;
            this.f7119 = false;
            m5033(true);
            m5029(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public void setSecondaryIconGravity(int i) {
        if (this.f7107 != i) {
            if (this.f7113 != null && this.f7104 != null && m5028()) {
                ᵹˉᵞ.ˌᵜᵹᵩ("secondaryIconGravity cannot have the same alignment as iconGravity");
            } else {
                this.f7107 = i;
                m5029(getMeasuredWidth(), getMeasuredHeight());
            }
        }
    }

    public void setSecondaryIconResource(int i) {
        setSecondaryIcon(i != 0 ? ᵕˏᵛ.ˑᵥˁ(getContext(), i) : null);
    }

    public void setSecondaryIconTint(ColorStateList colorStateList) {
        if (this.f7115 != colorStateList) {
            this.f7115 = colorStateList;
            m5033(false);
        }
    }

    public void setSecondaryIconTintMode(PorterDuff.Mode mode) {
        if (this.f7101 != mode) {
            this.f7101 = mode;
            m5033(false);
        }
    }

    public void setSecondaryIconTintResource(int i) {
        setSecondaryIconTint(AbstractC5363.m10989(getContext(), i));
    }

    public void setShapeAppearance(InterfaceC2895 interfaceC2895) {
        if (!m5024()) {
            ᵹˉᵞ.ᵳٴᵶ("Attempted to set ShapeAppearance on a MaterialButton which has an overwritten background.");
            return;
        }
        C4742 c4742 = this.f7112;
        if (c4742.f17564 == null && interfaceC2895.mo7067()) {
            c4742.f17564 = m5023();
            if (c4742.f17575 instanceof C3410) {
                c4742.m10024();
            }
        }
        c4742.f17575 = interfaceC2895;
        c4742.m10024();
    }

    @Override // defpackage.InterfaceC0546
    public void setShapeAppearanceModel(C4879 c4879) {
        if (!m5024()) {
            ᵹˉᵞ.ᵳٴᵶ("Attempted to set ShapeAppearanceModel on a MaterialButton which has an overwritten background.");
            return;
        }
        C4742 c4742 = this.f7112;
        c4742.f17575 = c4879;
        c4742.m10024();
    }

    public void setShouldDrawSurfaceColorStroke(boolean z) {
        if (m5024()) {
            C4742 c4742 = this.f7112;
            c4742.f17560 = z;
            c4742.m10020();
        }
    }

    public void setSizeChange(AbstractC2198 abstractC2198) {
    }

    public void setStrokeColor(ColorStateList colorStateList) {
        if (m5024()) {
            C4742 c4742 = this.f7112;
            if (c4742.f17573 != colorStateList) {
                c4742.f17573 = colorStateList;
                c4742.m10020();
            }
        }
    }

    public void setStrokeColorResource(int i) {
        if (m5024()) {
            setStrokeColor(AbstractC5363.m10989(getContext(), i));
        }
    }

    public void setStrokeWidth(int i) {
        if (m5024()) {
            C4742 c4742 = this.f7112;
            if (c4742.f17576 != i) {
                c4742.f17576 = i;
                c4742.m10020();
            }
        }
    }

    public void setStrokeWidthResource(int i) {
        if (m5024()) {
            setStrokeWidth(getResources().getDimensionPixelSize(i));
        }
    }

    @Override // defpackage.C4512
    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        if (!m5024()) {
            super.setSupportBackgroundTintList(colorStateList);
            return;
        }
        C4742 c4742 = this.f7112;
        if (c4742.f17561 != colorStateList) {
            c4742.f17561 = colorStateList;
            if (c4742.m10022(false) != null) {
                c4742.m10022(false).setTintList(c4742.f17561);
            }
        }
    }

    @Override // defpackage.C4512
    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        if (!m5024()) {
            super.setSupportBackgroundTintMode(mode);
            return;
        }
        C4742 c4742 = this.f7112;
        if (c4742.f17578 != mode) {
            c4742.f17578 = mode;
            if (c4742.m10022(false) == null || c4742.f17578 == null) {
                return;
            }
            c4742.m10022(false).setTintMode(c4742.f17578);
        }
    }

    @Override // android.widget.TextView
    public final void setText(CharSequence charSequence, TextView.BufferType bufferType) {
        this.f7116 = -2.14748365E9f;
        super.setText(charSequence, bufferType);
    }

    @Override // android.view.View
    public void setTextAlignment(int i) {
        super.setTextAlignment(i);
        m5038(getMeasuredWidth(), getMeasuredHeight());
        m5029(getMeasuredWidth(), getMeasuredHeight());
    }

    @Override // defpackage.C4512, android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        this.f7116 = -2.14748365E9f;
        super.setTextAppearance(context, i);
    }

    @Override // defpackage.C4512, android.widget.TextView
    public final void setTextSize(int i, float f) {
        this.f7116 = -2.14748365E9f;
        super.setTextSize(i, f);
    }

    public void setToggleCheckedStateOnClick(boolean z) {
        this.f7112.f17571 = z;
    }

    @Override // android.widget.TextView
    public void setWidth(int i) {
        this.f7116 = -2.14748365E9f;
        super.setWidth(i);
    }

    public void setWidthChangeDirection(EnumC2583 enumC2583) {
        if (this.f7097 != enumC2583) {
            this.f7097 = enumC2583;
        }
    }

    public void setWidthChangeMax(int i) {
        if (this.f7091 != i) {
            this.f7091 = i;
        }
    }

    @Override // android.widget.Checkable
    public final void toggle() {
        setChecked(!this.f7098);
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C1107 m5023() {
        Context context = getContext();
        TypedValue typedValue = ᵮʛˀ.ᵾᵬ(context.getTheme(), ar.tvplayer.tv.R.attr._11_res_0x7f04048c);
        int[] iArr = AbstractC0914.f4193;
        TypedArray typedArrayObtainStyledAttributes = typedValue == null ? context.obtainStyledAttributes(null, iArr, 0, ar.tvplayer.tv.R.style._11_res_0x7f140181) : context.obtainStyledAttributes(typedValue.resourceId, iArr);
        C1107 c1107 = new C1107();
        try {
            float f = typedArrayObtainStyledAttributes.getFloat(1, Float.MIN_VALUE);
            if (f == Float.MIN_VALUE) {
                throw new IllegalArgumentException("A MaterialSpring style must have stiffness value.");
            }
            float f2 = typedArrayObtainStyledAttributes.getFloat(0, Float.MIN_VALUE);
            if (f2 == Float.MIN_VALUE) {
                throw new IllegalArgumentException("A MaterialSpring style must have a damping value.");
            }
            c1107.m3526(f);
            c1107.m3525(f2);
            return c1107;
        } finally {
            typedArrayObtainStyledAttributes.recycle();
        }
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final boolean m5024() {
        C4742 c4742 = this.f7112;
        return (c4742 == null || c4742.f17568) ? false : true;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final boolean m5025() {
        int i = this.f7095;
        return i == 16 || i == 32;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final int m5026(int i, int i2) {
        return Math.max(0, (((((i - getTextHeight()) - getPaddingTop()) - i2) - this.f7106) - getPaddingBottom()) / 2);
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final int m5027(int i, int i2) {
        int intrinsicWidth;
        int intrinsicWidth2;
        Drawable drawable = this.f7104;
        if (drawable != null) {
            intrinsicWidth = this.f7117;
            if (intrinsicWidth == 0) {
                intrinsicWidth = drawable.getIntrinsicWidth();
            }
        } else {
            intrinsicWidth = 0;
        }
        Drawable drawable2 = this.f7113;
        if (drawable2 != null) {
            intrinsicWidth2 = this.f7117;
            if (intrinsicWidth2 == 0) {
                intrinsicWidth2 = drawable2.getIntrinsicWidth();
            }
        } else {
            intrinsicWidth2 = 0;
        }
        int textLayoutWidth = (((((i - getTextLayoutWidth()) - getPaddingEnd()) - intrinsicWidth) - intrinsicWidth2) - this.f7106) - getPaddingStart();
        if (getActualTextAlignment() == Layout.Alignment.ALIGN_CENTER) {
            textLayoutWidth /= 2;
        }
        return (getLayoutDirection() == 1) != (i2 == 4) ? -textLayoutWidth : textLayoutWidth;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final boolean m5028() {
        if (m5039() && m5034()) {
            return true;
        }
        if (m5037() && m5035()) {
            return true;
        }
        return m5025() && m5036();
    }

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public final void m5029(int i, int i2) {
        if (this.f7113 == null || getLayout() == null) {
            return;
        }
        if (m5034() || m5035()) {
            this.f7103 = 0;
            if (m5041(this.f7107)) {
                this.f7109 = 0;
                m5033(false);
                return;
            }
            int iM5027 = m5027(i, this.f7107);
            if (this.f7109 != iM5027) {
                this.f7109 = iM5027;
                m5033(false);
                return;
            }
            return;
        }
        if (m5036()) {
            this.f7109 = 0;
            if (this.f7107 == 16) {
                this.f7103 = 0;
                m5033(false);
                return;
            }
            int intrinsicHeight = this.f7117;
            if (intrinsicHeight == 0) {
                intrinsicHeight = this.f7113.getIntrinsicHeight();
            }
            int iM5026 = m5026(i2, intrinsicHeight);
            if (this.f7103 != iM5026) {
                this.f7103 = iM5026;
                m5033(false);
            }
        }
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final Drawable m5030(int i) {
        if (i == 0) {
            if (this.f7104 == null || !m5039()) {
                return null;
            }
            return this.f7104;
        }
        if (i == 1) {
            if (this.f7104 == null || !m5037()) {
                return null;
            }
            return this.f7104;
        }
        if (i == 2 && this.f7104 != null && m5037()) {
            return this.f7104;
        }
        return null;
    }

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final void m5031() {
        int i = (int) (this.f7118 - this.f7100);
        boolean z = getLayoutDirection() == 1;
        int i2 = this.f7114;
        if (z) {
            i2 = -i2;
        }
        int i3 = (i / 2) + i2;
        if (getLayoutParams() != null) {
            getLayoutParams().width = (int) (this.f7116 + i);
        }
        setPaddingRelative(this.f7110 + i3, getPaddingTop(), (this.f7096 + i) - i3, getPaddingBottom());
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public final void m5032(boolean z) {
        Drawable drawable = this.f7104;
        if (drawable != null) {
            Drawable drawableMutate = drawable.mutate();
            this.f7104 = drawableMutate;
            drawableMutate.setTintList(this.f7108);
            PorterDuff.Mode mode = this.f7092;
            if (mode != null) {
                this.f7104.setTintMode(mode);
            }
            int intrinsicWidth = this.f7117;
            if (intrinsicWidth == 0) {
                intrinsicWidth = this.f7104.getIntrinsicWidth();
            }
            int intrinsicHeight = this.f7117;
            if (intrinsicHeight == 0) {
                intrinsicHeight = this.f7104.getIntrinsicHeight();
            }
            Drawable drawable2 = this.f7104;
            int i = this.f7094;
            int i2 = this.f7121;
            drawable2.setBounds(i, i2, intrinsicWidth + i, intrinsicHeight + i2);
            this.f7104.setVisible(true, z);
        }
        if (this.f7104 != null && this.f7113 != null && m5028()) {
            ᵹˉᵞ.ˌᵜᵹᵩ("iconGravity cannot have the same alignment as secondaryIconGravity");
            return;
        }
        if (this.f7104 == null && this.f7113 != null && m5028()) {
            return;
        }
        Drawable[] compoundDrawablesRelative = getCompoundDrawablesRelative();
        boolean z2 = (m5039() && compoundDrawablesRelative[0] != this.f7104) || (m5037() && compoundDrawablesRelative[2] != this.f7104) || (m5025() && compoundDrawablesRelative[1] != this.f7104);
        if (z || z2) {
            if (m5039()) {
                setCompoundDrawablesRelative(this.f7104, m5040(1), m5040(2), null);
            } else if (m5037()) {
                setCompoundDrawablesRelative(m5040(0), m5040(1), this.f7104, null);
            } else if (m5025()) {
                setCompoundDrawablesRelative(m5040(0), this.f7104, m5040(2), null);
            }
        }
    }

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public final void m5033(boolean z) {
        Drawable drawable = this.f7113;
        if (drawable != null) {
            Drawable drawableMutate = drawable.mutate();
            this.f7113 = drawableMutate;
            drawableMutate.setTintList(this.f7115);
            PorterDuff.Mode mode = this.f7101;
            if (mode != null) {
                this.f7113.setTintMode(mode);
            }
            int intrinsicWidth = this.f7117;
            if (intrinsicWidth == 0) {
                intrinsicWidth = this.f7113.getIntrinsicWidth();
            }
            int intrinsicHeight = this.f7117;
            if (intrinsicHeight == 0) {
                intrinsicHeight = this.f7113.getIntrinsicHeight();
            }
            Drawable drawable2 = this.f7113;
            int i = this.f7109;
            int i2 = this.f7103;
            drawable2.setBounds(i, i2, intrinsicWidth + i, intrinsicHeight + i2);
            this.f7113.setVisible(true, z);
        }
        if (this.f7113 != null && this.f7104 != null && m5028()) {
            ᵹˉᵞ.ˌᵜᵹᵩ("secondaryIconGravity cannot have the same alignment as iconGravity");
            return;
        }
        if (this.f7113 == null) {
            if (this.f7119) {
                return;
            }
            if (this.f7104 != null && m5028()) {
                return;
            }
        }
        Drawable[] compoundDrawablesRelative = getCompoundDrawablesRelative();
        boolean z2 = (m5034() && compoundDrawablesRelative[0] != this.f7113) || (m5035() && compoundDrawablesRelative[2] != this.f7113) || (m5036() && compoundDrawablesRelative[1] != this.f7113);
        if (z || z2) {
            if (m5034()) {
                setCompoundDrawablesRelative(this.f7113, m5030(1), m5030(2), null);
            } else if (m5035()) {
                setCompoundDrawablesRelative(m5030(0), m5030(1), this.f7113, null);
            } else if (m5036()) {
                setCompoundDrawablesRelative(m5030(0), this.f7113, m5030(2), null);
            }
        }
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final boolean m5034() {
        int i = this.f7107;
        return i == 1 || i == 2;
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final boolean m5035() {
        int i = this.f7107;
        return i == 3 || i == 4;
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final boolean m5036() {
        int i = this.f7107;
        return i == 16 || i == 32;
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final boolean m5037() {
        int i = this.f7095;
        return i == 3 || i == 4;
    }

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public final void m5038(int i, int i2) {
        if (this.f7104 == null || getLayout() == null) {
            return;
        }
        if (m5039() || m5037()) {
            this.f7121 = 0;
            if (m5041(this.f7095)) {
                this.f7094 = 0;
                m5032(false);
                return;
            }
            int iM5027 = m5027(i, this.f7095);
            if (this.f7094 != iM5027) {
                this.f7094 = iM5027;
                m5032(false);
                return;
            }
            return;
        }
        if (m5025()) {
            this.f7094 = 0;
            if (this.f7095 == 16) {
                this.f7121 = 0;
                m5032(false);
                return;
            }
            int intrinsicHeight = this.f7117;
            if (intrinsicHeight == 0) {
                intrinsicHeight = this.f7104.getIntrinsicHeight();
            }
            int iM5026 = m5026(i2, intrinsicHeight);
            if (this.f7121 != iM5026) {
                this.f7121 = iM5026;
                m5032(false);
            }
        }
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final boolean m5039() {
        int i = this.f7095;
        return i == 1 || i == 2;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final Drawable m5040(int i) {
        if (i == 0) {
            if (this.f7113 == null || !m5034()) {
                return null;
            }
            return this.f7113;
        }
        if (i == 1) {
            if (this.f7113 == null || !m5036()) {
                return null;
            }
            return this.f7113;
        }
        if (i == 2 && this.f7113 != null && m5035()) {
            return this.f7113;
        }
        return null;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final boolean m5041(int i) {
        Layout.Alignment actualTextAlignment = getActualTextAlignment();
        return i == 1 || i == 3 || (i == 2 && actualTextAlignment == Layout.Alignment.ALIGN_NORMAL) || (i == 4 && actualTextAlignment == Layout.Alignment.ALIGN_OPPOSITE);
    }
}
