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.AbstractC5234;
import defpackage.C1264;
import defpackage.C2941;
import defpackage.C3385;
import defpackage.C4468;
import defpackage.ViewOnKeyListenerC0124;

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

    /* JADX INFO: renamed from: ˆʤᵳ, reason: contains not printable characters */
    public int f791;

    /* JADX INFO: renamed from: ˆˀᵯ, reason: contains not printable characters */
    public final boolean f792;

    /* JADX INFO: renamed from: ˏʜᵪ, reason: contains not printable characters */
    public int f793;

    /* JADX INFO: renamed from: ˏʽˊᵰ, reason: contains not printable characters */
    public TextView f794;

    /* JADX INFO: renamed from: ᵘᵝ, reason: contains not printable characters */
    public int f795;

    /* JADX INFO: renamed from: ᵚᵹᵔᵜ, reason: contains not printable characters */
    public final C2941 f796;

    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public final boolean f797;

    /* JADX INFO: renamed from: ᵬᵦˋ, reason: contains not printable characters */
    public int f798;

    /* JADX INFO: renamed from: ᵮᵟᵡ, reason: contains not printable characters */
    public SeekBar f799;

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

    /* JADX INFO: renamed from: ᵱᵭ, reason: contains not printable characters */
    public final ViewOnKeyListenerC0124 f801;

    /* JADX INFO: renamed from: ᵹʾᵢᵯ, reason: contains not printable characters */
    public boolean f802;

    public SeekBarPreference(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, R.attr._24n_res_0x7f04056a, 0);
        this.f796 = new C2941(this);
        this.f801 = new ViewOnKeyListenerC0124(1, this);
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, AbstractC5234.f19731, R.attr._24n_res_0x7f04056a, 0);
        this.f793 = typedArrayObtainStyledAttributes.getInt(3, 0);
        int i = typedArrayObtainStyledAttributes.getInt(1, 100);
        int i2 = this.f793;
        i = i < i2 ? i2 : i;
        if (i != this.f795) {
            this.f795 = i;
            mo428();
        }
        int i3 = typedArrayObtainStyledAttributes.getInt(4, 0);
        if (i3 != this.f791) {
            this.f791 = Math.min(this.f795 - this.f793, Math.abs(i3));
            mo428();
        }
        this.f800 = typedArrayObtainStyledAttributes.getBoolean(2, true);
        this.f797 = typedArrayObtainStyledAttributes.getBoolean(5, false);
        this.f792 = typedArrayObtainStyledAttributes.getBoolean(6, false);
        typedArrayObtainStyledAttributes.recycle();
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final void m468(int i, boolean z) {
        int i2 = this.f793;
        if (i < i2) {
            i = i2;
        }
        int i3 = this.f795;
        if (i > i3) {
            i = i3;
        }
        if (i != this.f798) {
            this.f798 = i;
            TextView textView = this.f794;
            if (textView != null) {
                textView.setText(String.valueOf(i));
            }
            if (m450()) {
                int i4 = ~i;
                if (m450() && m444() == null) {
                    i4 = this.f769.m4485().getInt(this.f752, i4);
                }
                if (i != i4) {
                    if (m444() != null) {
                        C4468.m9515("Not implemented on this data store");
                        return;
                    }
                    SharedPreferences.Editor editorM4482 = this.f769.m4482();
                    editorM4482.putInt(this.f752, i);
                    if (!this.f769.f6503) {
                        editorM4482.apply();
                    }
                }
            }
            if (z) {
                mo428();
            }
        }
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˉᵲ */
    public final void mo431(Parcelable parcelable) {
        if (!parcelable.getClass().equals(C1264.class)) {
            super.mo431(parcelable);
            return;
        }
        C1264 c1264 = (C1264) parcelable;
        super.mo431(c1264.getSuperState());
        this.f798 = c1264.f5316;
        this.f793 = c1264.f5318;
        this.f795 = c1264.f5317;
        mo428();
    }

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

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˊᵨᵧ */
    public final void mo433(Object obj) {
        if (obj == null) {
            obj = 0;
        }
        int iIntValue = ((Integer) obj).intValue();
        if (m450() && m444() == null) {
            iIntValue = this.f769.m4485().getInt(this.f752, iIntValue);
        }
        m468(iIntValue, true);
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ˏːˆ */
    public final Parcelable mo434() {
        super.mo434();
        AbsSavedState absSavedState = AbsSavedState.EMPTY_STATE;
        if (this.f762) {
            return absSavedState;
        }
        C1264 c1264 = new C1264();
        c1264.f5316 = this.f798;
        c1264.f5318 = this.f793;
        c1264.f5317 = this.f795;
        return c1264;
    }

    @Override // androidx.preference.Preference
    /* JADX INFO: renamed from: ᵪᵹᵥᵻ */
    public final void mo426(C3385 c3385) {
        super.mo426(c3385);
        c3385.f18236.setOnKeyListener(this.f801);
        this.f799 = (SeekBar) c3385.m7744(R.id.pd);
        TextView textView = (TextView) c3385.m7744(R.id._4pn_res_0x7f0b0356);
        this.f794 = textView;
        if (this.f797) {
            textView.setVisibility(0);
        } else {
            textView.setVisibility(8);
            this.f794 = null;
        }
        SeekBar seekBar = this.f799;
        if (seekBar == null) {
            return;
        }
        seekBar.setOnSeekBarChangeListener(this.f796);
        this.f799.setMax(this.f795 - this.f793);
        int i = this.f791;
        SeekBar seekBar2 = this.f799;
        if (i != 0) {
            seekBar2.setKeyProgressIncrement(i);
        } else {
            this.f791 = seekBar2.getKeyProgressIncrement();
        }
        this.f799.setProgress(this.f798 - this.f793);
        int i2 = this.f798;
        TextView textView2 = this.f794;
        if (textView2 != null) {
            textView2.setText(String.valueOf(i2));
        }
        this.f799.setEnabled(mo456());
    }
}
