package p000.p001.p002.p006.p007;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.fragment.app.Fragment;
import androidx.leanback.widget.picker.Picker;
import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.RecyclerView;
import ar.tvplayer.core.util.CommonUtilsKt;
import java.util.ArrayList;
import java.util.HashMap;
import kotlin.TypeCastException;
import p000.p001.p002.p003.p004.C0567;
import p000.p001.p002.p006.C0732;
import p000.p001.p002.p006.C0733;
import p000.p001.p002.p006.C0734;
import p000.p001.p021.p022.C1219;
import p037.p089.p090.AbstractC2014;
import p037.p091.p093.AbstractC2098;
import p037.p091.p095.p096.C2194;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.InterfaceC6538;
import p402.InterfaceC6540;
import p402.p411.p412.InterfaceC6603;
import p402.p411.p413.AbstractC6636;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ނ.֏.֏.ؠ.֏.ހ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C0702 extends AbstractC2098 {

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final InterfaceC6538 f3167 = C4303.m7065((InterfaceC6603) new C0705());

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public HashMap f3168;

    /* JADX INFO: renamed from: ނ.֏.֏.ؠ.֏.ހ$֏, reason: contains not printable characters */
    @InterfaceC6540
    public static final class C0703 implements Parcelable {
        public static final Parcelable.Creator CREATOR = new C0704();

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final int f3169;

        /* JADX INFO: renamed from: ނ.֏.֏.ؠ.֏.ހ$֏$֏, reason: contains not printable characters */
        public static class C0704 implements Parcelable.Creator {
            @Override // android.os.Parcelable.Creator
            public final Object createFromParcel(Parcel parcel) {
                if (parcel != null) {
                    return new C0703(parcel.readInt());
                }
                C6635.m9824("in");
                throw null;
            }

            @Override // android.os.Parcelable.Creator
            public final Object[] newArray(int i) {
                return new C0703[i];
            }
        }

        public C0703(int i) {
            this.f3169 = i;
        }

        @Override // android.os.Parcelable
        public int describeContents() {
            return 0;
        }

        public boolean equals(Object obj) {
            if (this != obj) {
                return (obj instanceof C0703) && this.f3169 == ((C0703) obj).f3169;
            }
            return true;
        }

        public int hashCode() {
            return this.f3169;
        }

        public String toString() {
            return C2803.m4882(C2803.m4889("Args(duration="), this.f3169, ")");
        }

        @Override // android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i) {
            if (parcel != null) {
                parcel.writeInt(this.f3169);
            } else {
                C6635.m9824("parcel");
                throw null;
            }
        }
    }

    /* JADX INFO: renamed from: ނ.֏.֏.ؠ.֏.ހ$ؠ, reason: contains not printable characters */
    public static final class C0705 extends AbstractC6636 implements InterfaceC6603<C0703> {
        public C0705() {
            super(0);
        }

        @Override // p402.p411.p412.InterfaceC6603
        /* JADX INFO: renamed from: ނ */
        public C0703 mo1543() {
            return (C0703) CommonUtilsKt.֏(C0702.this);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final /* synthetic */ void m2019(C0702 c0702) {
        AbstractC2014 childFragmentManager;
        C2194 c2194M317 = ((Picker) c0702.m2021(C0732.durationPicker)).m317(0);
        C6635.m9823((Object) c2194M317, "durationPicker.getColumnAt(0)");
        int i = c2194M317.f7128;
        C2194 c2194M3172 = ((Picker) c0702.m2021(C0732.durationPicker)).m317(1);
        C6635.m9823((Object) c2194M3172, "durationPicker.getColumnAt(1)");
        C0567.f2843 = Integer.valueOf((i * 60) + (c2194M3172.f7128 * 5));
        Fragment fragment = c0702.mParentFragment;
        if (fragment == null || (childFragmentManager = fragment.getChildFragmentManager()) == null) {
            return;
        }
        CommonUtilsKt.֏(childFragmentManager);
    }

    @Override // p037.p106.AbstractC2273, androidx.fragment.app.Fragment
    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        HashMap map = this.f3168;
        if (map != null) {
            map.clear();
        }
    }

    @Override // p037.p091.p093.AbstractC2098, p037.p106.AbstractC2273, androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        if (view == null) {
            C6635.m9824("view");
            throw null;
        }
        super.onViewCreated(view, bundle);
        RecyclerView recyclerView = this.f7244;
        C6635.m9823((Object) recyclerView, "listView");
        ViewGroup.LayoutParams layoutParams = recyclerView.getLayoutParams();
        if (layoutParams == null) {
            throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
        }
        layoutParams.height = -2;
        recyclerView.setLayoutParams(layoutParams);
        RecyclerView recyclerView2 = this.f7244;
        C6635.m9823((Object) recyclerView2, "listView");
        ViewParent parent = recyclerView2.getParent();
        if (parent == null) {
            throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup");
        }
        C1219.m2471((ViewGroup) parent, C0733.include_duration_picker, true);
        C2194 c2194 = new C2194();
        c2194.f7131 = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"};
        c2194.f7129 = 0;
        c2194.f7130 = 24;
        C2194 c21942 = new C2194();
        c21942.f7131 = new String[]{"00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55"};
        c21942.f7129 = 0;
        c21942.f7130 = 11;
        Picker picker = (Picker) m2021(C0732.durationPicker);
        picker.setSeparator(":");
        picker.setColumns(C4303.m7158((Object[]) new C2194[]{c2194, c21942}));
        int i = ((C0703) this.f3167.getValue()).f3169 / 60;
        int iAbs = Math.abs(((C0703) this.f3167.getValue()).f3169 % 60);
        picker.m319(0, i, false);
        picker.m319(1, iAbs / 5, false);
        picker.requestFocus();
        picker.setActivated(true);
        C0706 c0706 = new C0706(this, c2194, c21942);
        if (picker.f914 == null) {
            picker.f914 = new ArrayList<>();
        }
        picker.f914.add(c0706);
        picker.setOnClickListener(new ViewOnClickListenerC0707(this, c2194, c21942));
        m2022(0);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public View m2021(int i) {
        if (this.f3168 == null) {
            this.f3168 = new HashMap();
        }
        View view = (View) this.f3168.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View view2 = this.mView;
        if (view2 == null) {
            return null;
        }
        View viewFindViewById = view2.findViewById(i);
        this.f3168.put(Integer.valueOf(i), viewFindViewById);
        return viewFindViewById;
    }

    @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(C0734.recordings_duration_h_min));
        m4320(preferenceScreenM4334);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m2022(int i) {
        if (i != 0) {
            return;
        }
        C2194 c2194M317 = ((Picker) m2021(C0732.durationPicker)).m317(0);
        C2194 c2194M3172 = ((Picker) m2021(C0732.durationPicker)).m317(1);
        C6635.m9823((Object) c2194M317, "hoursColumn");
        int i2 = c2194M317.f7128;
        if (i2 == 0) {
            C6635.m9823((Object) c2194M3172, "minutesColumn");
            c2194M3172.f7129 = 1;
            c2194M3172.f7130 = c2194M3172.f7131.length - 1;
        } else if (i2 == c2194M317.f7130) {
            C6635.m9823((Object) c2194M3172, "minutesColumn");
            c2194M3172.f7129 = 0;
            c2194M3172.f7130 = 0;
        } else {
            C6635.m9823((Object) c2194M3172, "minutesColumn");
            c2194M3172.f7129 = 0;
            c2194M3172.f7130 = c2194M3172.f7131.length - 1;
        }
        ((Picker) m2021(C0732.durationPicker)).m320(1, c2194M3172);
    }
}
