package androidx.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.AbsSavedState;
import android.widget.SeekBar;
import android.widget.TextView;
import ar.tvplayer.tv.R;
import defpackage.AbstractC4608;
import defpackage.C0190;
import defpackage.C2102;
import defpackage.C2733;
import defpackage.C5451;
import defpackage.ViewOnKeyListenerC4139;

/* loaded from: classes3.dex */
public class SeekBarPreference extends Preference {

    /* renamed from: ʽᵢˊ, reason: contains not printable characters */
    public boolean f791;

    /* renamed from: ʾˋˊᵽ, reason: contains not printable characters */
    public final boolean f792;

    /* renamed from: ʿᵘˆ, reason: contains not printable characters */
    public TextView f793;

    /* renamed from: ᵎʾ, reason: contains not printable characters */
    public final C2733 f794;

    /* renamed from: ᵠᵪˀᵻ, reason: contains not printable characters */
    public SeekBar f795;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public int f796;

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public int f797;

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public int f798;

    /* renamed from: ᵰʖʢ, reason: contains not printable characters */
    public final boolean f799;

    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public int f800;

    /* renamed from: ᵷᵦﹳ, reason: contains not printable characters */
    public final ViewOnKeyListenerC4139 f801;

    /* renamed from: ᵺᵜᵰ, reason: contains not printable characters */
    public final boolean f802;

    public SeekBarPreference(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, R.attr._11_res_0x7f04056a, 0);
        this.f794 = new C2733(this);
        this.f801 = new ViewOnKeyListenerC4139(1, this);
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, AbstractC4608.f17085, R.attr._11_res_0x7f04056a, 0);
        this.f797 = typedArrayObtainStyledAttributes.getInt(3, 0);
        int i = typedArrayObtainStyledAttributes.getInt(1, 100);
        int i2 = this.f797;
        i = i < i2 ? i2 : i;
        if (i != this.f800) {
            this.f800 = i;
            mo428();
        }
        int i3 = typedArrayObtainStyledAttributes.getInt(4, 0);
        if (i3 != this.f798) {
            this.f798 = Math.min(this.f800 - this.f797, Math.abs(i3));
            mo428();
        }
        this.f799 = typedArrayObtainStyledAttributes.getBoolean(2, true);
        this.f792 = typedArrayObtainStyledAttributes.getBoolean(5, false);
        this.f802 = typedArrayObtainStyledAttributes.getBoolean(6, false);
        typedArrayObtainStyledAttributes.recycle();
    }

    @Override // androidx.preference.Preference
    /* renamed from: ˑᵱ */
    public final void mo429(Object obj) {
        if (obj == null) {
            obj = 0;
        }
        int iIntValue = ((Integer) obj).intValue();
        if (m454() && m459() == null) {
            iIntValue = this.f765.m10458().getInt(this.f775, iIntValue);
        }
        m468(iIntValue, true);
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final void m468(int i, boolean z) {
        int i2 = this.f797;
        if (i < i2) {
            i = i2;
        }
        int i3 = this.f800;
        if (i > i3) {
            i = i3;
        }
        if (i != this.f796) {
            this.f796 = i;
            TextView textView = this.f793;
            if (textView != null) {
                textView.setText(String.valueOf(i));
            }
            if (m454()) {
                int i4 = ~i;
                if (m454() && m459() == null) {
                    i4 = this.f765.m10458().getInt(this.f775, i4);
                }
                if (i != i4) {
                    if (m459() != null) {
                        C0190.m1432("Not implemented on this data store");
                        return;
                    }
                    SharedPreferences.Editor editorM10457 = this.f765.m10457();
                    editorM10457.putInt(this.f775, i);
                    if (!this.f765.f18589) {
                        editorM10457.apply();
                    }
                }
            }
            if (z) {
                mo428();
            }
        }
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵞʡ */
    public final void mo431(Parcelable parcelable) {
        if (!parcelable.getClass().equals(C5451.class)) {
            super.mo431(parcelable);
            return;
        }
        C5451 c5451 = (C5451) parcelable;
        super.mo431(c5451.getSuperState());
        this.f796 = c5451.f20476;
        this.f797 = c5451.f20475;
        this.f800 = c5451.f20477;
        mo428();
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵨᵳʝ */
    public final Parcelable mo432() {
        super.mo432();
        AbsSavedState absSavedState = AbsSavedState.EMPTY_STATE;
        if (this.f755) {
            return absSavedState;
        }
        C5451 c5451 = new C5451();
        c5451.f20476 = this.f796;
        c5451.f20475 = this.f797;
        c5451.f20477 = this.f800;
        return c5451;
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵳٴᵶ */
    public final void mo426(C2102 c2102) {
        super.mo426(c2102);
        c2102.f9071.setOnKeyListener(this.f801);
        this.f795 = (SeekBar) c2102.m5691(R.id._11_res_0x7f0b0355);
        TextView textView = (TextView) c2102.m5691(R.id._11_res_0x7f0b0356);
        this.f793 = textView;
        if (this.f792) {
            textView.setVisibility(0);
        } else {
            textView.setVisibility(8);
            this.f793 = null;
        }
        SeekBar seekBar = this.f795;
        if (seekBar == null) {
            return;
        }
        seekBar.setOnSeekBarChangeListener(this.f794);
        this.f795.setMax(this.f800 - this.f797);
        int i = this.f798;
        SeekBar seekBar2 = this.f795;
        if (i != 0) {
            seekBar2.setKeyProgressIncrement(i);
        } else {
            this.f798 = seekBar2.getKeyProgressIncrement();
        }
        this.f795.setProgress(this.f796 - this.f797);
        int i2 = this.f796;
        TextView textView2 = this.f793;
        if (textView2 != null) {
            textView2.setText(String.valueOf(i2));
        }
        this.f795.setEnabled(mo458());
    }

    @Override // androidx.preference.Preference
    /* renamed from: ᵸʓᵠ */
    public final Object mo434(TypedArray typedArray, int i) {
        return Integer.valueOf(typedArray.getInt(i, 0));
    }
}
