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;

/* renamed from: ᵚˊˌ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2655 extends C0643 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public ColorStateList f10305;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public CompoundButton.OnCheckedChangeListener f10306;

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

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final C3430 f10308;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public CharSequence f10309;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public boolean f10310;

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

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

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public boolean f10313;

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

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public final C0271 f10315;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public boolean f10316;

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

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

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

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

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

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

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public Drawable f10323;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public PorterDuff.Mode f10324;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public static final int[] f10302 = {R.attr._11_res_0x7f0405d7};

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public static final int[] f10304 = {R.attr._11_res_0x7f0405d6};

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public static final int[][] f10303 = {new int[]{android.R.attr.state_enabled, R.attr._11_res_0x7f0405d6}, 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}};

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public static final int f10301 = Resources.getSystem().getIdentifier("btn_check_material_anim", "drawable", "android");

    public C2655(Context context, AttributeSet attributeSet) throws XmlPullParserException, Resources.NotFoundException, IOException {
        C3430 c3430;
        int next;
        ColorStateList colorStateList;
        int resourceId;
        ColorStateList colorStateList2;
        int resourceId2;
        int resourceId3;
        int resourceId4;
        int resourceId5;
        super(ᵙᵛᵯ.ᵶʔᵢˊ(context, attributeSet, R.attr._11_res_0x7f0400e8, R.style._11_res_0x7f1406ae, new int[0]), attributeSet);
        this.f10319 = new LinkedHashSet();
        this.f10318 = new LinkedHashSet();
        Context context2 = getContext();
        if (Build.VERSION.SDK_INT >= 24) {
            c3430 = new C3430(context2, 0);
            Resources resources = context2.getResources();
            Resources.Theme theme = context2.getTheme();
            ThreadLocal threadLocal = AbstractC4701.f17378;
            Drawable drawable = resources.getDrawable(R.drawable._11_res_0x7f080205, theme);
            c3430.f10372 = drawable;
            drawable.setCallback(c3430.f12830);
            new C4727(0, c3430.f10372.getConstantState());
        } else {
            int i = C3430.f12829;
            try {
                XmlResourceParser xml = context2.getResources().getXml(R.drawable._11_res_0x7f080205);
                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();
                C3430 c34302 = new C3430(context2, 0);
                c34302.inflate(resources2, xml, attributeSetAsAttributeSet, theme2);
                c3430 = c34302;
            } catch (IOException | XmlPullParserException unused) {
                c3430 = null;
            }
        }
        this.f10308 = c3430;
        this.f10315 = new C0271(this);
        Context context3 = getContext();
        this.f10320 = getButtonDrawable();
        this.f10322 = getSuperButtonTintList();
        setSupportButtonTintList(null);
        ˁˈᵸ.ᵻᵢﹳᵰ(context3, attributeSet, R.attr._11_res_0x7f0400e8, R.style._11_res_0x7f1406ae);
        int[] iArr = AbstractC0914.f4194;
        ˁˈᵸ.ˇʼʤˎ(context3, attributeSet, iArr, R.attr._11_res_0x7f0400e8, R.style._11_res_0x7f1406ae, new int[0]);
        TypedArray typedArrayObtainStyledAttributes = context3.obtainStyledAttributes(attributeSet, iArr, R.attr._11_res_0x7f0400e8, R.style._11_res_0x7f1406ae);
        this.f10323 = (!typedArrayObtainStyledAttributes.hasValue(2) || (resourceId5 = typedArrayObtainStyledAttributes.getResourceId(2, 0)) == 0) ? typedArrayObtainStyledAttributes.getDrawable(2) : ᵕˏᵛ.ˑᵥˁ(context3, resourceId5);
        if (this.f10320 != null && ᵮʛˀ.ᵤᵙᵷ(context3.getTheme(), R.attr._11_res_0x7f040357, false)) {
            int resourceId6 = typedArrayObtainStyledAttributes.getResourceId(0, 0);
            int resourceId7 = typedArrayObtainStyledAttributes.getResourceId(1, 0);
            if (resourceId6 == f10301 && resourceId7 == 0) {
                super.setButtonDrawable((Drawable) null);
                this.f10320 = ᵕˏᵛ.ˑᵥˁ(context3, R.drawable._11_res_0x7f080204);
                this.f10313 = true;
                if (this.f10323 == null) {
                    this.f10323 = ᵕˏᵛ.ˑᵥˁ(context3, R.drawable._11_res_0x7f080206);
                }
            }
        }
        if ((!typedArrayObtainStyledAttributes.hasValue(3) || (resourceId4 = typedArrayObtainStyledAttributes.getResourceId(3, 0)) == 0 || (colorStateList = AbstractC5363.m10989(context3, resourceId4)) == null) && (!typedArrayObtainStyledAttributes.hasValue(3) || (resourceId = typedArrayObtainStyledAttributes.getResourceId(3, 0)) == 0 || (colorStateList = AbstractC5363.m10989(context3, resourceId)) == null)) {
            colorStateList = typedArrayObtainStyledAttributes.getColorStateList(3);
        }
        this.f10307 = colorStateList;
        int i2 = typedArrayObtainStyledAttributes.getInt(4, -1);
        PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
        this.f10324 = ᵩʛʽ.ᵾᵬ(i2);
        this.f10316 = typedArrayObtainStyledAttributes.getBoolean(11, false);
        this.f10312 = typedArrayObtainStyledAttributes.getBoolean(6, true);
        this.f10310 = typedArrayObtainStyledAttributes.getBoolean(9, false);
        this.f10321 = 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 = AbstractC5363.m10989(context3, resourceId3)) == null) && (!typedArrayObtainStyledAttributes.hasValue(10) || (resourceId2 = typedArrayObtainStyledAttributes.getResourceId(10, 0)) == 0 || (colorStateList2 = AbstractC5363.m10989(context3, resourceId2)) == null)) {
                colorStateList2 = typedArrayObtainStyledAttributes.getColorStateList(10);
            }
            setRippleColor(colorStateList2);
        }
        typedArrayObtainStyledAttributes.recycle();
        m6652();
    }

    private String getButtonStateDescription() {
        int i = this.f10314;
        return i == 1 ? getResources().getString(R.string._11_res_0x7f13014b) : i == 0 ? getResources().getString(R.string._11_res_0x7f13014d) : getResources().getString(R.string._11_res_0x7f13014c);
    }

    private ColorStateList getMaterialThemeColorsTintList() {
        if (this.f10305 == null) {
            int i = ᵙᵛᵯ.ˌʾˀ(this, R.attr._11_res_0x7f04013b);
            int i2 = ᵙᵛᵯ.ˌʾˀ(this, R.attr._11_res_0x7f04013e);
            int i3 = ᵙᵛᵯ.ˌʾˀ(this, R.attr._11_res_0x7f040172);
            int i4 = ᵙᵛᵯ.ˌʾˀ(this, R.attr._11_res_0x7f040158);
            this.f10305 = new ColorStateList(f10303, new int[]{ᵙᵛᵯ.ᵿʗᵝʽ(1.0f, i3, i2), ᵙᵛᵯ.ᵿʗᵝʽ(1.0f, i3, i), ᵙᵛᵯ.ᵿʗᵝʽ(0.54f, i3, i4), ᵙᵛᵯ.ᵿʗᵝʽ(0.38f, i3, i4), ᵙᵛᵯ.ᵿʗᵝʽ(0.38f, i3, i4)});
        }
        return this.f10305;
    }

    private ColorStateList getSuperButtonTintList() {
        ColorStateList colorStateList = this.f10322;
        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.f10320;
    }

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

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

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

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

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

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

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

    @Override // android.widget.TextView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (this.f10316 && this.f10322 == null && this.f10307 == 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, f10302);
        }
        if (this.f10310) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, f10304);
        }
        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.f10317 = iArrCopyOf;
        return iArrOnCreateDrawableState;
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final void onDraw(Canvas canvas) {
        Drawable buttonDrawable;
        if (!this.f10312 || !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.f10310) {
            accessibilityNodeInfo.setText(((Object) accessibilityNodeInfo.getText()) + ", " + ((Object) this.f10321));
        }
    }

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

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

    @Override // defpackage.C0643, android.widget.CompoundButton
    public void setButtonDrawable(int i) {
        setButtonDrawable(ᵕˏᵛ.ˑᵥˁ(getContext(), i));
    }

    @Override // defpackage.C0643, android.widget.CompoundButton
    public void setButtonDrawable(Drawable drawable) {
        this.f10320 = drawable;
        this.f10313 = false;
        m6652();
    }

    public void setButtonIconDrawable(Drawable drawable) {
        this.f10323 = drawable;
        m6652();
    }

    public void setButtonIconDrawableResource(int i) {
        setButtonIconDrawable(ᵕˏᵛ.ˑᵥˁ(getContext(), i));
    }

    public void setButtonIconTintList(ColorStateList colorStateList) {
        if (this.f10307 == colorStateList) {
            return;
        }
        this.f10307 = colorStateList;
        m6652();
    }

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

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

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

    public void setCenterIfNoTextEnabled(boolean z) {
        this.f10312 = 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.f10314 != i) {
            this.f10314 = i;
            super.setChecked(i == 1);
            refreshDrawableState();
            int i2 = Build.VERSION.SDK_INT;
            if (i2 >= 30 && this.f10309 == null) {
                super.setStateDescription(getButtonStateDescription());
            }
            if (this.f10311) {
                return;
            }
            this.f10311 = true;
            LinkedHashSet linkedHashSet = this.f10318;
            if (linkedHashSet != null) {
                Iterator it = linkedHashSet.iterator();
                if (it.hasNext()) {
                    it.next().getClass();
                    C0910.m3050();
                    return;
                }
            }
            if (this.f10314 != 2 && (onCheckedChangeListener = this.f10306) != null) {
                onCheckedChangeListener.onCheckedChanged(this, isChecked());
            }
            if (i2 >= 26 && (autofillManager = (AutofillManager) getContext().getSystemService(AutofillManager.class)) != null) {
                autofillManager.notifyValueChanged(this);
            }
            this.f10311 = false;
        }
    }

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

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

    public void setErrorShown(boolean z) {
        if (this.f10310 == z) {
            return;
        }
        this.f10310 = z;
        refreshDrawableState();
        Iterator it = this.f10319.iterator();
        if (it.hasNext()) {
            it.next().getClass();
            C0910.m3050();
        }
    }

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

    @Override // android.widget.CompoundButton, android.view.View
    public void setStateDescription(CharSequence charSequence) {
        this.f10309 = 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.f10316 = z;
        if (z) {
            setButtonTintList(getMaterialThemeColorsTintList());
        } else {
            setButtonTintList(null);
        }
    }

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

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m6652() {
        ColorStateList colorStateList;
        ColorStateList colorStateList2;
        C3345 c3345;
        Drawable drawableMutate = this.f10320;
        ColorStateList colorStateList3 = this.f10322;
        PorterDuff.Mode buttonTintMode = getButtonTintMode();
        if (drawableMutate == null) {
            drawableMutate = null;
        } else if (colorStateList3 != null) {
            drawableMutate = drawableMutate.mutate();
            if (buttonTintMode != null) {
                drawableMutate.setTintMode(buttonTintMode);
            }
        }
        this.f10320 = drawableMutate;
        Drawable drawableMutate2 = this.f10323;
        ColorStateList colorStateList4 = this.f10307;
        PorterDuff.Mode mode = this.f10324;
        if (drawableMutate2 == null) {
            drawableMutate2 = null;
        } else if (colorStateList4 != null) {
            drawableMutate2 = drawableMutate2.mutate();
            if (mode != null) {
                drawableMutate2.setTintMode(mode);
            }
        }
        this.f10323 = drawableMutate2;
        if (this.f10313) {
            C3430 c3430 = this.f10308;
            if (c3430 != null) {
                C0353 c0353 = c3430.f12831;
                Drawable drawable = c3430.f10372;
                C0271 c0271 = this.f10315;
                if (drawable != null) {
                    AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) drawable;
                    if (c0271.f1855 == null) {
                        c0271.f1855 = new C4115(c0271);
                    }
                    animatedVectorDrawable.unregisterAnimationCallback(c0271.f1855);
                }
                ArrayList arrayList = c3430.f12832;
                if (arrayList != null && c0271 != null) {
                    arrayList.remove(c0271);
                    if (c3430.f12832.size() == 0 && (c3345 = c3430.f12833) != null) {
                        c0353.f2099.removeListener(c3345);
                        c3430.f12833 = null;
                    }
                }
                Drawable drawable2 = c3430.f10372;
                if (drawable2 != null) {
                    AnimatedVectorDrawable animatedVectorDrawable2 = (AnimatedVectorDrawable) drawable2;
                    if (c0271.f1855 == null) {
                        c0271.f1855 = new C4115(c0271);
                    }
                    animatedVectorDrawable2.registerAnimationCallback(c0271.f1855);
                } else if (c0271 != null) {
                    if (c3430.f12832 == null) {
                        c3430.f12832 = new ArrayList();
                    }
                    if (!c3430.f12832.contains(c0271)) {
                        c3430.f12832.add(c0271);
                        if (c3430.f12833 == null) {
                            c3430.f12833 = new C3345(1, c3430);
                        }
                        c0353.f2099.addListener(c3430.f12833);
                    }
                }
            }
            if (Build.VERSION.SDK_INT >= 24) {
                Drawable drawable3 = this.f10320;
                if ((drawable3 instanceof AnimatedStateListDrawable) && c3430 != null) {
                    ((AnimatedStateListDrawable) drawable3).addTransition(R.id._11_res_0x7f0b00cc, R.id._11_res_0x7f0b0427, c3430, false);
                    ((AnimatedStateListDrawable) this.f10320).addTransition(R.id._11_res_0x7f0b0202, R.id._11_res_0x7f0b0427, c3430, false);
                }
            }
        }
        Drawable drawable4 = this.f10320;
        if (drawable4 != null && (colorStateList2 = this.f10322) != null) {
            drawable4.setTintList(colorStateList2);
        }
        Drawable drawable5 = this.f10323;
        if (drawable5 != null && (colorStateList = this.f10307) != null) {
            drawable5.setTintList(colorStateList);
        }
        Drawable drawable6 = this.f10320;
        Drawable drawable7 = this.f10323;
        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();
    }
}
