package defpackage;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.AnimatedStateListDrawable;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableWrapper;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Xml;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.autofill.AutofillManager;
import android.widget.CompoundButton;
import ar.tvplayer.tv.R;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashSet;
import org.xmlpull.v1.XmlPullParserException;

/* JADX INFO: renamed from: ˆˁʘˆ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0814 extends C5126 {

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public CharSequence f3656;

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

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

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

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

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public CompoundButton.OnCheckedChangeListener f3661;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public Drawable f3662;

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public PorterDuff.Mode f3663;

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public ColorStateList f3664;

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

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public boolean f3666;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public boolean f3667;

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public int f3668;

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public final C4194 f3669;

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

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public final C3195 f3671;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final LinkedHashSet f3672;

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public int[] f3673;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final LinkedHashSet f3674;

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

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public static final int[] f3654 = {R.attr.h};

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public static final int[] f3653 = {R.attr.h};

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public static final int[][] f3652 = {new int[]{android.R.attr.state_enabled, R.attr.h}, new int[]{android.R.attr.state_enabled, android.R.attr.state_checked}, new int[]{android.R.attr.state_enabled, -16842912}, new int[]{-16842910, android.R.attr.state_checked}, new int[]{-16842910, -16842912}};

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public static final int f3655 = Resources.getSystem().getIdentifier("btn_check_material_anim", "drawable", "android");

    public C0814(Context context, AttributeSet attributeSet) {
        C3195 c3195;
        int next;
        ColorStateList colorStateList;
        int resourceId;
        ColorStateList colorStateList2;
        int resourceId2;
        int resourceId3;
        int resourceId4;
        int resourceId5;
        super(ᵲᵧˇ.ˉᵵᵜ(context, attributeSet, R.attr.h, R.style.h, new int[0]), attributeSet);
        this.f3672 = new LinkedHashSet();
        this.f3674 = new LinkedHashSet();
        Context context2 = getContext();
        if (Build.VERSION.SDK_INT >= 24) {
            c3195 = new C3195(context2, 0);
            Resources resources = context2.getResources();
            Resources.Theme theme = context2.getTheme();
            ThreadLocal threadLocal = AbstractC0354.f2145;
            Drawable drawable = resources.getDrawable(R.drawable.h, theme);
            c3195.f18606 = drawable;
            drawable.setCallback(c3195.f12134);
            new C0068(0, c3195.f18606.getConstantState());
        } else {
            int i = C3195.f12129;
            try {
                XmlResourceParser xml = context2.getResources().getXml(R.drawable.h);
                AttributeSet attributeSetAsAttributeSet = Xml.asAttributeSet(xml);
                do {
                    next = xml.next();
                    if (next == 2) {
                        break;
                    }
                } while (next != 1);
                if (next != 2) {
                    throw new XmlPullParserException("No start tag found");
                }
                Resources resources2 = context2.getResources();
                Resources.Theme theme2 = context2.getTheme();
                C3195 c31952 = new C3195(context2, 0);
                c31952.inflate(resources2, xml, attributeSetAsAttributeSet, theme2);
                c3195 = c31952;
            } catch (IOException | XmlPullParserException unused) {
                c3195 = null;
            }
        }
        this.f3671 = c3195;
        this.f3669 = new C4194(this);
        Context context3 = getContext();
        this.f3670 = getButtonDrawable();
        this.f3658 = getSuperButtonTintList();
        setSupportButtonTintList(null);
        ᵸᵺᵜ.ʽˈˋ(context3, attributeSet, R.attr.h, R.style.h);
        int[] iArr = AbstractC2172.f8627;
        ᵸᵺᵜ.ːˏᵟᵯ(context3, attributeSet, iArr, R.attr.h, R.style.h, new int[0]);
        TypedArray typedArrayObtainStyledAttributes = context3.obtainStyledAttributes(attributeSet, iArr, R.attr.h, R.style.h);
        this.f3662 = (!typedArrayObtainStyledAttributes.hasValue(2) || (resourceId5 = typedArrayObtainStyledAttributes.getResourceId(2, 0)) == 0) ? typedArrayObtainStyledAttributes.getDrawable(2) : ᵥˇᵛˎ.ᵶˇᵱ(context3, resourceId5);
        if (this.f3670 != null && ᵶᵦ.ᵨᵼⁱ(context3.getTheme(), R.attr.h, false)) {
            int resourceId6 = typedArrayObtainStyledAttributes.getResourceId(0, 0);
            int resourceId7 = typedArrayObtainStyledAttributes.getResourceId(1, 0);
            if (resourceId6 == f3655 && resourceId7 == 0) {
                super.setButtonDrawable((Drawable) null);
                this.f3670 = ᵥˇᵛˎ.ᵶˇᵱ(context3, R.drawable.h);
                this.f3659 = true;
                if (this.f3662 == null) {
                    this.f3662 = ᵥˇᵛˎ.ᵶˇᵱ(context3, R.drawable.h);
                }
            }
        }
        if ((!typedArrayObtainStyledAttributes.hasValue(3) || (resourceId4 = typedArrayObtainStyledAttributes.getResourceId(3, 0)) == 0 || (colorStateList = AbstractC1630.m4515(context3, resourceId4)) == null) && (!typedArrayObtainStyledAttributes.hasValue(3) || (resourceId = typedArrayObtainStyledAttributes.getResourceId(3, 0)) == 0 || (colorStateList = AbstractC1630.m4515(context3, resourceId)) == null)) {
            colorStateList = typedArrayObtainStyledAttributes.getColorStateList(3);
        }
        this.f3664 = colorStateList;
        int i2 = typedArrayObtainStyledAttributes.getInt(4, -1);
        PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
        this.f3663 = ᵻᵪ.ᵠˏˏ(i2);
        this.f3665 = typedArrayObtainStyledAttributes.getBoolean(11, false);
        this.f3675 = typedArrayObtainStyledAttributes.getBoolean(6, true);
        this.f3667 = typedArrayObtainStyledAttributes.getBoolean(9, false);
        this.f3657 = typedArrayObtainStyledAttributes.getText(8);
        if (typedArrayObtainStyledAttributes.hasValue(7)) {
            setCheckedState(typedArrayObtainStyledAttributes.getInt(7, 0));
        }
        if (typedArrayObtainStyledAttributes.hasValue(10)) {
            if ((!typedArrayObtainStyledAttributes.hasValue(10) || (resourceId3 = typedArrayObtainStyledAttributes.getResourceId(10, 0)) == 0 || (colorStateList2 = AbstractC1630.m4515(context3, resourceId3)) == null) && (!typedArrayObtainStyledAttributes.hasValue(10) || (resourceId2 = typedArrayObtainStyledAttributes.getResourceId(10, 0)) == 0 || (colorStateList2 = AbstractC1630.m4515(context3, resourceId2)) == null)) {
                colorStateList2 = typedArrayObtainStyledAttributes.getColorStateList(10);
            }
            setRippleColor(colorStateList2);
        }
        typedArrayObtainStyledAttributes.recycle();
        m2931();
    }

    private String getButtonStateDescription() {
        int i = this.f3668;
        return i == 1 ? getResources().getString(R.string.h) : i == 0 ? getResources().getString(R.string.h) : getResources().getString(R.string.h);
    }

    private ColorStateList getMaterialThemeColorsTintList() {
        if (this.f3660 == null) {
            int i = ᵲᵧˇ.ᵶᵥᵝ(this, R.attr.h);
            int i2 = ᵲᵧˇ.ᵶᵥᵝ(this, R.attr.h);
            int i3 = ᵲᵧˇ.ᵶᵥᵝ(this, R.attr.h);
            int i4 = ᵲᵧˇ.ᵶᵥᵝ(this, R.attr.h);
            this.f3660 = new ColorStateList(f3652, new int[]{ᵲᵧˇ.ˊᵙᵾᵲ(1.0f, i3, i2), ᵲᵧˇ.ˊᵙᵾᵲ(1.0f, i3, i), ᵲᵧˇ.ˊᵙᵾᵲ(0.54f, i3, i4), ᵲᵧˇ.ˊᵙᵾᵲ(0.38f, i3, i4), ᵲᵧˇ.ˊᵙᵾᵲ(0.38f, i3, i4)});
        }
        return this.f3660;
    }

    private ColorStateList getSuperButtonTintList() {
        ColorStateList colorStateList = this.f3658;
        return colorStateList != null ? colorStateList : super.getButtonTintList() != null ? super.getButtonTintList() : getSupportButtonTintList();
    }

    private void setRippleColor(ColorStateList colorStateList) {
        if (colorStateList == null) {
            return;
        }
        Drawable background = getBackground();
        if (background instanceof DrawableWrapper) {
            background = ((DrawableWrapper) background).getDrawable();
        }
        if (background instanceof RippleDrawable) {
            ((RippleDrawable) background).setColor(colorStateList);
        }
    }

    @Override // android.widget.CompoundButton
    public Drawable getButtonDrawable() {
        return this.f3670;
    }

    public Drawable getButtonIconDrawable() {
        return this.f3662;
    }

    public ColorStateList getButtonIconTintList() {
        return this.f3664;
    }

    public PorterDuff.Mode getButtonIconTintMode() {
        return this.f3663;
    }

    @Override // android.widget.CompoundButton
    public ColorStateList getButtonTintList() {
        return this.f3658;
    }

    public int getCheckedState() {
        return this.f3668;
    }

    public CharSequence getErrorAccessibilityLabel() {
        return this.f3657;
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public final boolean isChecked() {
        return this.f3668 == 1;
    }

    @Override // android.widget.TextView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (this.f3665 && this.f3658 == null && this.f3664 == null) {
            setUseMaterialThemeColors(true);
        }
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final int[] onCreateDrawableState(int i) {
        int[] iArrCopyOf;
        int[] iArrOnCreateDrawableState = super.onCreateDrawableState(i + 2);
        if (getCheckedState() == 2) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f3654);
        }
        if (this.f3667) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f3653);
        }
        int i2 = 0;
        while (true) {
            if (i2 >= iArrOnCreateDrawableState.length) {
                iArrCopyOf = Arrays.copyOf(iArrOnCreateDrawableState, iArrOnCreateDrawableState.length + 1);
                iArrCopyOf[iArrOnCreateDrawableState.length] = 16842912;
                break;
            }
            int i3 = iArrOnCreateDrawableState[i2];
            if (i3 == 16842912) {
                iArrCopyOf = iArrOnCreateDrawableState;
                break;
            }
            if (i3 == 0) {
                iArrCopyOf = (int[]) iArrOnCreateDrawableState.clone();
                iArrCopyOf[i2] = 16842912;
                break;
            }
            i2++;
        }
        this.f3673 = iArrCopyOf;
        return iArrOnCreateDrawableState;
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final void onDraw(Canvas canvas) {
        Drawable buttonDrawable;
        if (!this.f3675 || !TextUtils.isEmpty(getText()) || (buttonDrawable = getButtonDrawable()) == null) {
            super.onDraw(canvas);
            return;
        }
        int width = ((getWidth() - buttonDrawable.getIntrinsicWidth()) / 2) * (getLayoutDirection() == 1 ? -1 : 1);
        int iSave = canvas.save();
        canvas.translate(width, 0.0f);
        super.onDraw(canvas);
        canvas.restoreToCount(iSave);
        if (getBackground() != null) {
            Rect bounds = buttonDrawable.getBounds();
            getBackground().setHotspotBounds(bounds.left + width, bounds.top, bounds.right + width, bounds.bottom);
        }
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        if (accessibilityNodeInfo != null && this.f3667) {
            accessibilityNodeInfo.setText(((Object) accessibilityNodeInfo.getText()) + ", " + ((Object) this.f3657));
        }
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof C2165)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        C2165 c2165 = (C2165) parcelable;
        super.onRestoreInstanceState(c2165.getSuperState());
        setCheckedState(c2165.f8617);
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final Parcelable onSaveInstanceState() {
        C2165 c2165 = new C2165(super.onSaveInstanceState());
        c2165.f8617 = getCheckedState();
        return c2165;
    }

    @Override // defpackage.C5126, android.widget.CompoundButton
    public void setButtonDrawable(int i) {
        setButtonDrawable(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), i));
    }

    @Override // defpackage.C5126, android.widget.CompoundButton
    public void setButtonDrawable(Drawable drawable) {
        this.f3670 = drawable;
        this.f3659 = false;
        m2931();
    }

    public void setButtonIconDrawable(Drawable drawable) {
        this.f3662 = drawable;
        m2931();
    }

    public void setButtonIconDrawableResource(int i) {
        setButtonIconDrawable(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), i));
    }

    public void setButtonIconTintList(ColorStateList colorStateList) {
        if (this.f3664 == colorStateList) {
            return;
        }
        this.f3664 = colorStateList;
        m2931();
    }

    public void setButtonIconTintMode(PorterDuff.Mode mode) {
        if (this.f3663 == mode) {
            return;
        }
        this.f3663 = mode;
        m2931();
    }

    @Override // android.widget.CompoundButton
    public void setButtonTintList(ColorStateList colorStateList) {
        if (this.f3658 == colorStateList) {
            return;
        }
        this.f3658 = colorStateList;
        m2931();
    }

    @Override // android.widget.CompoundButton
    public void setButtonTintMode(PorterDuff.Mode mode) {
        setSupportButtonTintMode(mode);
        m2931();
    }

    public void setCenterIfNoTextEnabled(boolean z) {
        this.f3675 = z;
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public void setChecked(boolean z) {
        setCheckedState(z ? 1 : 0);
    }

    public void setCheckedState(int i) {
        AutofillManager autofillManager;
        CompoundButton.OnCheckedChangeListener onCheckedChangeListener;
        if (this.f3668 != i) {
            this.f3668 = i;
            super.setChecked(i == 1);
            refreshDrawableState();
            int i2 = Build.VERSION.SDK_INT;
            if (i2 >= 30 && this.f3656 == null) {
                super.setStateDescription(getButtonStateDescription());
            }
            if (this.f3666) {
                return;
            }
            this.f3666 = true;
            LinkedHashSet linkedHashSet = this.f3674;
            if (linkedHashSet != null) {
                Iterator it = linkedHashSet.iterator();
                if (it.hasNext()) {
                    it.next().getClass();
                    C1685.m4560();
                    return;
                }
            }
            if (this.f3668 != 2 && (onCheckedChangeListener = this.f3661) != null) {
                onCheckedChangeListener.onCheckedChanged(this, isChecked());
            }
            if (i2 >= 26 && (autofillManager = (AutofillManager) getContext().getSystemService(AutofillManager.class)) != null) {
                autofillManager.notifyValueChanged(this);
            }
            this.f3666 = false;
        }
    }

    public void setErrorAccessibilityLabel(CharSequence charSequence) {
        this.f3657 = charSequence;
    }

    public void setErrorAccessibilityLabelResource(int i) {
        setErrorAccessibilityLabel(i != 0 ? getResources().getText(i) : null);
    }

    public void setErrorShown(boolean z) {
        if (this.f3667 == z) {
            return;
        }
        this.f3667 = z;
        refreshDrawableState();
        Iterator it = this.f3672.iterator();
        if (it.hasNext()) {
            it.next().getClass();
            C1685.m4560();
        }
    }

    @Override // android.widget.CompoundButton
    public void setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener onCheckedChangeListener) {
        this.f3661 = onCheckedChangeListener;
    }

    @Override // android.widget.CompoundButton, android.view.View
    public void setStateDescription(CharSequence charSequence) {
        this.f3656 = charSequence;
        if (charSequence != null) {
            super.setStateDescription(charSequence);
        } else {
            if (Build.VERSION.SDK_INT < 30 || charSequence != null) {
                return;
            }
            super.setStateDescription(getButtonStateDescription());
        }
    }

    public void setUseMaterialThemeColors(boolean z) {
        this.f3665 = z;
        if (z) {
            setButtonTintList(getMaterialThemeColorsTintList());
        } else {
            setButtonTintList(null);
        }
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public final void toggle() {
        setChecked(!isChecked());
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m2931() {
        ColorStateList colorStateList;
        ColorStateList colorStateList2;
        C1033 c1033;
        Drawable drawableMutate = this.f3670;
        ColorStateList colorStateList3 = this.f3658;
        PorterDuff.Mode buttonTintMode = getButtonTintMode();
        if (drawableMutate == null) {
            drawableMutate = null;
        } else if (colorStateList3 != null) {
            drawableMutate = drawableMutate.mutate();
            if (buttonTintMode != null) {
                drawableMutate.setTintMode(buttonTintMode);
            }
        }
        this.f3670 = drawableMutate;
        Drawable drawableMutate2 = this.f3662;
        ColorStateList colorStateList4 = this.f3664;
        PorterDuff.Mode mode = this.f3663;
        if (drawableMutate2 == null) {
            drawableMutate2 = null;
        } else if (colorStateList4 != null) {
            drawableMutate2 = drawableMutate2.mutate();
            if (mode != null) {
                drawableMutate2.setTintMode(mode);
            }
        }
        this.f3662 = drawableMutate2;
        if (this.f3659) {
            C3195 c3195 = this.f3671;
            if (c3195 != null) {
                C2922 c2922 = c3195.f12131;
                Drawable drawable = c3195.f18606;
                C4194 c4194 = this.f3669;
                if (drawable != null) {
                    AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) drawable;
                    if (c4194.f15997 == null) {
                        c4194.f15997 = new C0332(c4194);
                    }
                    animatedVectorDrawable.unregisterAnimationCallback(c4194.f15997);
                }
                ArrayList arrayList = c3195.f12133;
                if (arrayList != null && c4194 != null) {
                    arrayList.remove(c4194);
                    if (c3195.f12133.size() == 0 && (c1033 = c3195.f12132) != null) {
                        c2922.f11257.removeListener(c1033);
                        c3195.f12132 = null;
                    }
                }
                Drawable drawable2 = c3195.f18606;
                if (drawable2 != null) {
                    AnimatedVectorDrawable animatedVectorDrawable2 = (AnimatedVectorDrawable) drawable2;
                    if (c4194.f15997 == null) {
                        c4194.f15997 = new C0332(c4194);
                    }
                    animatedVectorDrawable2.registerAnimationCallback(c4194.f15997);
                } else if (c4194 != null) {
                    if (c3195.f12133 == null) {
                        c3195.f12133 = new ArrayList();
                    }
                    if (!c3195.f12133.contains(c4194)) {
                        c3195.f12133.add(c4194);
                        if (c3195.f12132 == null) {
                            c3195.f12132 = new C1033(1, c3195);
                        }
                        c2922.f11257.addListener(c3195.f12132);
                    }
                }
            }
            if (Build.VERSION.SDK_INT >= 24) {
                Drawable drawable3 = this.f3670;
                if ((drawable3 instanceof AnimatedStateListDrawable) && c3195 != null) {
                    ((AnimatedStateListDrawable) drawable3).addTransition(R.id.h, R.id.h, c3195, false);
                    ((AnimatedStateListDrawable) this.f3670).addTransition(R.id.h, R.id.h, c3195, false);
                }
            }
        }
        Drawable drawable4 = this.f3670;
        if (drawable4 != null && (colorStateList2 = this.f3658) != null) {
            drawable4.setTintList(colorStateList2);
        }
        Drawable drawable5 = this.f3662;
        if (drawable5 != null && (colorStateList = this.f3664) != null) {
            drawable5.setTintList(colorStateList);
        }
        Drawable drawable6 = this.f3670;
        Drawable drawable7 = this.f3662;
        if (drawable6 == null) {
            drawable6 = drawable7;
        } else if (drawable7 != null) {
            int intrinsicWidth = drawable7.getIntrinsicWidth();
            if (intrinsicWidth == -1) {
                intrinsicWidth = drawable6.getIntrinsicWidth();
            }
            int intrinsicHeight = drawable7.getIntrinsicHeight();
            if (intrinsicHeight == -1) {
                intrinsicHeight = drawable6.getIntrinsicHeight();
            }
            if (intrinsicWidth > drawable6.getIntrinsicWidth() || intrinsicHeight > drawable6.getIntrinsicHeight()) {
                float f = intrinsicWidth / intrinsicHeight;
                if (f >= drawable6.getIntrinsicWidth() / drawable6.getIntrinsicHeight()) {
                    int intrinsicWidth2 = drawable6.getIntrinsicWidth();
                    intrinsicHeight = (int) (intrinsicWidth2 / f);
                    intrinsicWidth = intrinsicWidth2;
                } else {
                    intrinsicHeight = drawable6.getIntrinsicHeight();
                    intrinsicWidth = (int) (f * intrinsicHeight);
                }
            }
            LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{drawable6, drawable7});
            layerDrawable.setLayerSize(1, intrinsicWidth, intrinsicHeight);
            layerDrawable.setLayerGravity(1, 17);
            drawable6 = layerDrawable;
        }
        super.setButtonDrawable(drawable6);
        refreshDrawableState();
    }
}
