package androidx.preference;

import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.AbsSavedState;
import ar.tvplayer.tv.R;
import defpackage.AbstractC5234;
import defpackage.C3664;
import defpackage.C5164;
import defpackage.InterfaceC1598;

/* JADX INFO: loaded from: classes3.dex */
public class ListPreference extends DialogPreference {

    /* JADX INFO: renamed from: ˆˀᵯ, reason: contains not printable characters */
    public String f733;

    /* JADX INFO: renamed from: ˏʽˊᵰ, reason: contains not printable characters */
    public final CharSequence[] f734;

    /* JADX INFO: renamed from: ᵚᵹᵔᵜ, reason: contains not printable characters */
    public boolean f735;

    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public String f736;

    /* JADX INFO: renamed from: ᵯˇ, reason: contains not printable characters */
    public final CharSequence[] f737;

    public ListPreference(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, ᵫﾞˌ.ˊᵫᵗ(context, R.attr._32n_res_0x7f0401f7, android.R.attr.dialogPreferenceStyle));
    }

    public ListPreference(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, AbstractC5234.f19726, i, 0);
        CharSequence[] textArray = typedArrayObtainStyledAttributes.getTextArray(2);
        this.f734 = textArray == null ? typedArrayObtainStyledAttributes.getTextArray(0) : textArray;
        CharSequence[] textArray2 = typedArrayObtainStyledAttributes.getTextArray(3);
        this.f737 = textArray2 == null ? typedArrayObtainStyledAttributes.getTextArray(1) : textArray2;
        if (typedArrayObtainStyledAttributes.getBoolean(4, typedArrayObtainStyledAttributes.getBoolean(4, false))) {
            if (C3664.f13901 == null) {
                C3664.f13901 = new C3664(28);
            }
            this.f776 = C3664.f13901;
            mo428();
        }
        typedArrayObtainStyledAttributes.recycle();
        TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, AbstractC5234.f19730, i, 0);
        String string = typedArrayObtainStyledAttributes2.getString(33);
        this.f733 = string == null ? typedArrayObtainStyledAttributes2.getString(7) : string;
        typedArrayObtainStyledAttributes2.recycle();
    }

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public final void m435(String str) {
        boolean zEquals = TextUtils.equals(this.f736, str);
        if (zEquals && this.f735) {
            return;
        }
        this.f736 = str;
        this.f735 = true;
        m448(str);
        if (zEquals) {
            return;
        }
        mo428();
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final int m436(String str) {
        CharSequence[] charSequenceArr;
        if (str == null || (charSequenceArr = this.f737) == null) {
            return -1;
        }
        for (int length = charSequenceArr.length - 1; length >= 0; length--) {
            if (TextUtils.equals(charSequenceArr[length].toString(), str)) {
                return length;
            }
        }
        return -1;
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˉᵲ */
    public final void mo431(Parcelable parcelable) {
        if (!parcelable.getClass().equals(C5164.class)) {
            super.mo431(parcelable);
            return;
        }
        C5164 c5164 = (C5164) parcelable;
        super.mo431(c5164.getSuperState());
        m435(c5164.f19409);
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final Object mo432(TypedArray typedArray, int i) {
        return typedArray.getString(i);
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵨᵧ */
    public final void mo433(Object obj) {
        m435(m458((String) obj));
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final void mo437(CharSequence charSequence) {
        super.mo437(charSequence);
        if (charSequence == null) {
            this.f733 = null;
        } else {
            this.f733 = charSequence.toString();
        }
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˏːˆ */
    public final Parcelable mo434() {
        super.mo434();
        AbsSavedState absSavedState = AbsSavedState.EMPTY_STATE;
        if (this.f762) {
            return absSavedState;
        }
        C5164 c5164 = new C5164();
        c5164.f19409 = this.f736;
        return c5164;
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final CharSequence mo438() {
        CharSequence[] charSequenceArr;
        InterfaceC1598 interfaceC1598 = this.f776;
        if (interfaceC1598 != null) {
            return interfaceC1598.mo4448(this);
        }
        int iM436 = m436(this.f736);
        CharSequence charSequence = (iM436 < 0 || (charSequenceArr = this.f734) == null) ? null : charSequenceArr[iM436];
        CharSequence charSequenceMo438 = super.mo438();
        String str = this.f733;
        if (str != null) {
            if (charSequence == null) {
                charSequence = "";
            }
            String str2 = String.format(str, charSequence);
            if (!TextUtils.equals(str2, charSequenceMo438)) {
                return str2;
            }
        }
        return charSequenceMo438;
    }
}
