package androidx.preference;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.widget.Checkable;
import android.widget.Switch;
import ar.tvplayer.tv.R;
import defpackage.AbstractC5234;
import defpackage.C2644;
import defpackage.C3385;

/* JADX INFO: loaded from: classes3.dex */
public class SwitchPreference extends TwoStatePreference {

    /* JADX INFO: renamed from: ˏʽˊᵰ, reason: contains not printable characters */
    public final String f803;

    /* JADX INFO: renamed from: ᵮᵟᵡ, reason: contains not printable characters */
    public final C2644 f804;

    /* JADX INFO: renamed from: ᵯˇ, reason: contains not printable characters */
    public final String f805;

    public SwitchPreference(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, ᵫﾞˌ.ˊᵫᵗ(context, R.attr.h, android.R.attr.switchPreferenceStyle), 0);
    }

    public SwitchPreference(Context context, AttributeSet attributeSet, int i, int i2) {
        super(context, attributeSet, i, i2);
        this.f804 = new C2644(this, 1);
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, AbstractC5234.f19727, i, i2);
        String string = typedArrayObtainStyledAttributes.getString(7);
        this.f810 = string == null ? typedArrayObtainStyledAttributes.getString(0) : string;
        if (this.f812) {
            mo428();
        }
        String string2 = typedArrayObtainStyledAttributes.getString(6);
        this.f811 = string2 == null ? typedArrayObtainStyledAttributes.getString(1) : string2;
        if (!this.f812) {
            mo428();
        }
        String string3 = typedArrayObtainStyledAttributes.getString(9);
        this.f803 = string3 == null ? typedArrayObtainStyledAttributes.getString(3) : string3;
        mo428();
        String string4 = typedArrayObtainStyledAttributes.getString(8);
        this.f805 = string4 == null ? typedArrayObtainStyledAttributes.getString(4) : string4;
        mo428();
        this.f813 = typedArrayObtainStyledAttributes.getBoolean(5, typedArrayObtainStyledAttributes.getBoolean(2, false));
        typedArrayObtainStyledAttributes.recycle();
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public final void m469(View view) {
        boolean z = view instanceof Switch;
        if (z) {
            ((Switch) view).setOnCheckedChangeListener(null);
        }
        if (view instanceof Checkable) {
            ((Checkable) view).setChecked(this.f812);
        }
        if (z) {
            Switch r4 = (Switch) view;
            r4.setTextOn(this.f803);
            r4.setTextOff(this.f805);
            r4.setOnCheckedChangeListener(this.f804);
        }
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˌᴵ */
    public final void mo425(View view) {
        super.mo425(view);
        if (((AccessibilityManager) this.f758.getSystemService("accessibility")).isEnabled()) {
            m469(view.findViewById(android.R.id.switch_widget));
            m471(view.findViewById(android.R.id.summary));
        }
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ᵪᵹᵥᵻ */
    public void mo426(C3385 c3385) {
        super.mo426(c3385);
        m469(c3385.m7744(android.R.id.switch_widget));
        m471(c3385.m7744(android.R.id.summary));
    }
}
