package p000.p001.p002.p003.p004;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import ar.tvplayer.core.data.db.entities.ޏ;
import ar.tvplayer.core.data.prefs.ރ;
import ar.tvplayer.core.data.repositories.ޔ;
import ar.tvplayer.core.data.repositories.ޡ;
import ar.tvplayer.core.data.repositories.ჾ;
import ar.tvplayer.core.domain.ލ;
import ar.tvplayer.tv.player.ui.CustomPlayerView;
import p000.p001.p002.p003.C0663;
import p025.p026.C1340;
import p025.p026.C1356;
import p037.p089.p090.ActivityC1999;
import p037.p091.p093.AbstractC2098;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.p405.InterfaceC6575;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ނ.֏.֏.֏.֏.ތ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C0571 extends AbstractC2098 {

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public String f2846;

    @Override // p037.p106.AbstractC2273, androidx.fragment.app.Fragment
    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
    }

    @Override // p037.p106.AbstractC2273
    /* JADX INFO: renamed from: ֏ */
    public void mo1836(Bundle bundle, String str) {
        PreferenceScreen preferenceScreenM4334 = this.f7243.m4334(getContext());
        preferenceScreenM4334.m389((CharSequence) getString(C0663.player_display_mode));
        m4320(preferenceScreenM4334);
        Drawable drawable = ލ.֏(this, false, 1);
        Drawable drawable2 = ލ.ޅ(this);
        ޏ[] r15 = {ޏ.އ, ޏ.ޅ, ޏ.ކ, ޏ.ދ, ޏ.ވ, ޏ.މ, ޏ.ފ};
        String[] strArr = {getString(C0663.player_display_mode_normal), getString(C0663.player_display_mode_full), getString(C0663.player_display_mode_zoom), getString(C0663.player_display_mode_zoom) + " - 2.35:1", getString(C0663.player_display_mode_reduced), "4:3", "16:9"};
        int i = 0;
        int i2 = 0;
        while (i2 < 7) {
            ޏ r1 = r15[i2];
            int i3 = i + 1;
            String strValueOf = String.valueOf(r1.ރ);
            boolean z = r1 == C0567.f2840;
            Drawable drawable3 = z ? drawable2 : drawable;
            String str2 = strArr[i];
            C6635.m9823((Object) str2, "titles[index]");
            int i4 = i2;
            String[] strArr2 = strArr;
            ލ.֏(this, strValueOf, str2, (CharSequence) null, drawable3, false, false, 0, 116);
            if (z) {
                this.f2846 = strValueOf;
                m4319(strValueOf);
            }
            i2 = i4 + 1;
            i = i3;
            strArr = strArr2;
        }
        if (C0567.f2837 != null) {
            String string = getString(C0663.player_apply_to_all_channels);
            C6635.m9823((Object) string, "getString(R.string.player_apply_to_all_channels)");
            ލ.֏(this, "applyToAllChannels", string, (CharSequence) null, (Drawable) null, false, false, 0, 124);
        }
    }

    @Override // p037.p106.AbstractC2273, p037.p106.C2287.InterfaceC2290
    /* JADX INFO: renamed from: ؠ */
    public boolean mo1837(Preference preference) {
        ޏ r12;
        if (preference == null) {
            C6635.m9824("pref");
            throw null;
        }
        if (super.mo1837(preference)) {
            return true;
        }
        String str = preference.f1018;
        if (str != null && str.hashCode() == 2080198216 && str.equals("applyToAllChannels")) {
            String str2 = this.f2846;
            if (str2 != null && (r12 = ޏ.ލ.֏(Integer.parseInt(str2))) != null) {
                ރ r1 = ރ.ߠ;
                int i = r12.ރ;
                if (r1 == null) {
                    throw null;
                }
                int iIntValue = Integer.valueOf(i).intValue();
                ރ r13 = ރ.ߠ;
                if (r13 == null) {
                    throw null;
                }
                ރ.ľ.m9836(r13, ރ.ށ[166], Integer.valueOf(iIntValue));
                C4303.m7160(C1356.f4507, C1340.f4488, null, new ޔ((InterfaceC6575) null), 2, null);
            }
            ActivityC1999 activity = getActivity();
            if (activity != null) {
                activity.finishAfterTransition();
            }
        } else if (!C6635.m9825((Object) this.f2846, (Object) preference.f1018)) {
            this.f2846 = preference.f1018;
            ލ.֏(this, preference);
            ޏ.֏ r14 = ޏ.ލ;
            String str3 = preference.f1018;
            C6635.m9823((Object) str3, "pref.key");
            ޏ r122 = r14.֏(Integer.parseInt(str3));
            if (r122 != null) {
                CustomPlayerView customPlayerView = C0567.f2839;
                if (customPlayerView != null) {
                    customPlayerView.֏(r122, true);
                }
                Long l = C0567.f2837;
                if (l == null) {
                    Long l2 = C0567.f2838;
                    if (l2 != null) {
                        if (l2 == null) {
                            C6635.m9822();
                            throw null;
                        }
                        C4303.m7160(C1356.f4507, C1340.f4488, null, new ჾ(l2.longValue(), r122, (InterfaceC6575) null), 2, null);
                    }
                } else {
                    if (l == null) {
                        C6635.m9822();
                        throw null;
                    }
                    C4303.m7160(C1356.f4507, C1340.f4488, null, new ޡ(l.longValue(), r122, (InterfaceC6575) null), 2, null);
                }
            }
        }
        return true;
    }
}
