package defpackage;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.CompoundButton;
import android.widget.TextView;

/* renamed from: ᵪʚᵯʝ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3855 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public boolean f14328;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final TextView f14329;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public ColorStateList f14331 = null;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public PorterDuff.Mode f14332 = null;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public boolean f14330 = false;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public boolean f14333 = false;

    public /* synthetic */ C3855(TextView textView) {
        this.f14329 = textView;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public void m8500(AttributeSet attributeSet, int i) {
        int resourceId;
        int resourceId2;
        CompoundButton compoundButton = (CompoundButton) this.f14329;
        Context context = compoundButton.getContext();
        int[] iArr = AbstractC0542.f2820;
        C1570 c1570M4541 = C1570.m4541(context, attributeSet, iArr, i);
        TypedArray typedArray = (TypedArray) c1570M4541.f6230;
        AbstractC2873.m7025(compoundButton, compoundButton.getContext(), iArr, attributeSet, (TypedArray) c1570M4541.f6230, i);
        try {
            if (typedArray.hasValue(1) && (resourceId2 = typedArray.getResourceId(1, 0)) != 0) {
                try {
                    compoundButton.setButtonDrawable(ᵕˏᵛ.ˑᵥˁ(compoundButton.getContext(), resourceId2));
                } catch (Resources.NotFoundException unused) {
                }
            } else if (typedArray.hasValue(0) && (resourceId = typedArray.getResourceId(0, 0)) != 0) {
                compoundButton.setButtonDrawable(ᵕˏᵛ.ˑᵥˁ(compoundButton.getContext(), resourceId));
            }
            if (typedArray.hasValue(2)) {
                compoundButton.setButtonTintList(c1570M4541.m4549(2));
            }
            if (typedArray.hasValue(3)) {
                compoundButton.setButtonTintMode(AbstractC1991.m5512(typedArray.getInt(3, -1), null));
            }
            c1570M4541.m4542();
        } catch (Throwable th) {
            c1570M4541.m4542();
            throw th;
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public void m8501() {
        CompoundButton compoundButton = (CompoundButton) this.f14329;
        Drawable buttonDrawable = compoundButton.getButtonDrawable();
        if (buttonDrawable != null) {
            if (this.f14330 || this.f14333) {
                Drawable drawableMutate = buttonDrawable.mutate();
                if (this.f14330) {
                    drawableMutate.setTintList(this.f14331);
                }
                if (this.f14333) {
                    drawableMutate.setTintMode(this.f14332);
                }
                if (drawableMutate.isStateful()) {
                    drawableMutate.setState(compoundButton.getDrawableState());
                }
                compoundButton.setButtonDrawable(drawableMutate);
            }
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public void m8502() {
        C5174 c5174 = (C5174) this.f14329;
        Drawable checkMarkDrawable = c5174.getCheckMarkDrawable();
        if (checkMarkDrawable != null) {
            if (this.f14330 || this.f14333) {
                Drawable drawableMutate = checkMarkDrawable.mutate();
                if (this.f14330) {
                    drawableMutate.setTintList(this.f14331);
                }
                if (this.f14333) {
                    drawableMutate.setTintMode(this.f14332);
                }
                if (drawableMutate.isStateful()) {
                    drawableMutate.setState(c5174.getDrawableState());
                }
                c5174.setCheckMarkDrawable(drawableMutate);
            }
        }
    }
}
