package p037.p041.p051;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.CompoundButton;
import p037.p041.C1477;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p041.p043.p044.C1527;
import p037.p065.p078.C1920;

/* JADX INFO: renamed from: މ.ؠ.ގ.ކ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1614 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final CompoundButton f5240;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public ColorStateList f5241 = null;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public PorterDuff.Mode f5242 = null;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public boolean f5243 = false;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public boolean f5244 = false;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public boolean f5245;

    public C1614(CompoundButton compoundButton) {
        this.f5240 = compoundButton;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m3153() {
        Drawable drawableM2895 = LayoutInflaterFactory2C1494.C1505.m2895(this.f5240);
        if (drawableM2895 != null) {
            if (this.f5243 || this.f5244) {
                Drawable drawableMutate = LayoutInflaterFactory2C1494.C1505.m2972(drawableM2895).mutate();
                if (this.f5243) {
                    drawableMutate.setTintList(this.f5241);
                }
                if (this.f5244) {
                    drawableMutate.setTintMode(this.f5242);
                }
                if (drawableMutate.isStateful()) {
                    drawableMutate.setState(this.f5240.getDrawableState());
                }
                this.f5240.setButtonDrawable(drawableMutate);
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m3154(AttributeSet attributeSet, int i) {
        boolean z;
        int iM3305;
        int iM33052;
        C1689 c1689M3294 = C1689.m3294(this.f5240.getContext(), attributeSet, C1477.CompoundButton, i, 0);
        CompoundButton compoundButton = this.f5240;
        C1920.m3742(compoundButton, compoundButton.getContext(), C1477.CompoundButton, attributeSet, c1689M3294.f5496, i, 0);
        try {
            if (!c1689M3294.m3307(C1477.CompoundButton_buttonCompat) || (iM33052 = c1689M3294.m3305(C1477.CompoundButton_buttonCompat, 0)) == 0) {
                z = false;
            } else {
                try {
                    this.f5240.setButtonDrawable(C1527.m3025(this.f5240.getContext(), iM33052));
                    z = true;
                } catch (Resources.NotFoundException unused) {
                    z = false;
                }
            }
            if (!z && c1689M3294.m3307(C1477.CompoundButton_android_button) && (iM3305 = c1689M3294.m3305(C1477.CompoundButton_android_button, 0)) != 0) {
                this.f5240.setButtonDrawable(C1527.m3025(this.f5240.getContext(), iM3305));
            }
            if (c1689M3294.m3307(C1477.CompoundButton_buttonTint)) {
                this.f5240.setButtonTintList(c1689M3294.m3296(C1477.CompoundButton_buttonTint));
            }
            if (c1689M3294.m3307(C1477.CompoundButton_buttonTintMode)) {
                this.f5240.setButtonTintMode(C1650.m3240(c1689M3294.m3301(C1477.CompoundButton_buttonTintMode, -1), null));
            }
            c1689M3294.f5496.recycle();
        } catch (Throwable th) {
            c1689M3294.f5496.recycle();
            throw th;
        }
    }
}
