package p000.p001.p002.p016.p017;

import android.content.Context;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import ar.tvplayer.core.data.db.entities.ފ;
import ar.tvplayer.core.data.db.entities.ޠ;
import ar.tvplayer.core.data.prefs.ރ;
import ar.tvplayer.core.domain.ލ;
import ar.tvplayer.core.ui.view.LogoImageView;
import ar.tvplayer.core.util.CommonUtilsKt;
import java.util.HashMap;
import kotlin.TypeCastException;
import p000.p001.p002.p008.p009.C0884;
import p000.p001.p002.p016.C1155;
import p000.p001.p002.p016.C1156;
import p000.p001.p002.p016.C1157;
import p000.p001.p021.p022.C1219;
import p000.p001.p021.p022.C1250;
import p000.p001.p021.p023.C1262;
import p000.p001.p021.p023.C1267;
import p000.p001.p021.p024.AbstractC1272;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p065.p066.AbstractC1802;
import p037.p065.p066.C1801;
import p037.p065.p066.C1806;
import p037.p065.p066.C1825;
import p037.p089.p090.ActivityC1999;
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 C1163 extends AbstractC1272 {

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final InterfaceC6538 f4236;

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

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

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

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

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

        public C1164(long j) {
            this.f4238 = j;
        }

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

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

        public int hashCode() {
            return ހ.֏(this.f4238);
        }

        public String toString() {
            return C2803.m4883(C2803.m4889("Args(reminderId="), this.f4238, ")");
        }

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

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

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

    /* JADX INFO: renamed from: ނ.֏.֏.ބ.ނ.ؠ$ހ, reason: contains not printable characters */
    public static final class C1167 implements AbstractC1802.InterfaceC1803 {

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final /* synthetic */ boolean f4241;

        public C1167(C1825 c1825, C1825 c18252, boolean z) {
            this.f4241 = z;
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ֏ */
        public void mo1260(AbstractC1802 abstractC1802) {
            ActivityC1999 activity;
            if (abstractC1802 == null) {
                C6635.m9824("animator");
                throw null;
            }
            if (this.f4241 || (activity = C1163.this.getActivity()) == null) {
                return;
            }
            activity.finish();
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo1548(AbstractC1802 abstractC1802, boolean z) {
            C1801.m3550(this, abstractC1802, z);
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ؠ */
        public void mo1549(AbstractC1802 abstractC1802) {
            if (abstractC1802 != null) {
                return;
            }
            C6635.m9824("animator");
            throw null;
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ؠ */
        public /* synthetic */ void mo1550(AbstractC1802 abstractC1802, boolean z) {
            C1801.m3551(this, abstractC1802, z);
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ހ */
        public void mo1261(AbstractC1802 abstractC1802) {
            if (abstractC1802 != null) {
                return;
            }
            C6635.m9824("animator");
            throw null;
        }

        @Override // p037.p065.p066.AbstractC1802.InterfaceC1803
        /* JADX INFO: renamed from: ށ */
        public void mo1551(AbstractC1802 abstractC1802) {
            if (abstractC1802 != null) {
                return;
            }
            C6635.m9824("animator");
            throw null;
        }
    }

    public C1163() {
        super(C1156.fragment_reminder_popup);
        this.f4236 = C4303.m7065((InterfaceC6603) new C1166());
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final /* synthetic */ void m2439(C1163 c1163) {
        Button button = (Button) c1163.m2442(C1155.btnWatch);
        C6635.m9823((Object) button, "btnWatch");
        if (button.getLayoutParams().width == -2) {
            Button button2 = (Button) c1163.m2442(C1155.btnWatch);
            C6635.m9823((Object) button2, "btnWatch");
            if (button2.getWidth() > 0) {
                Button button3 = (Button) c1163.m2442(C1155.btnWatch);
                C6635.m9823((Object) button3, "btnWatch");
                ViewGroup.LayoutParams layoutParams = button3.getLayoutParams();
                if (layoutParams == null) {
                    throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
                }
                Button button4 = (Button) c1163.m2442(C1155.btnWatch);
                C6635.m9823((Object) button4, "btnWatch");
                layoutParams.width = button4.getWidth();
                button3.setLayoutParams(layoutParams);
                Button button5 = (Button) c1163.m2442(C1155.btnDismiss);
                C6635.m9823((Object) button5, "btnDismiss");
                ViewGroup.LayoutParams layoutParams2 = button5.getLayoutParams();
                if (layoutParams2 == null) {
                    throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
                }
                Button button6 = (Button) c1163.m2442(C1155.btnDismiss);
                C6635.m9823((Object) button6, "btnDismiss");
                layoutParams2.width = button6.getWidth();
                button5.setLayoutParams(layoutParams2);
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final /* synthetic */ void m2440(C1163 c1163, ޠ r9) {
        ConstraintLayout constraintLayout = (ConstraintLayout) c1163.m2442(C1155.popup);
        C6635.m9823((Object) constraintLayout, "popup");
        C1219.m2480(constraintLayout, 50, 0.0f, 2);
        ފ r3 = (ފ) r9.֏.getValue();
        LogoImageView logoImageViewM2442 = c1163.m2442(C1155.ivLogo);
        C6635.m9823((Object) logoImageViewM2442, "ivLogo");
        C1219.m2490((Fragment) c1163, r3, (ImageView) logoImageViewM2442, C0884.m2160(), 0, 8);
        TextView textView = (TextView) c1163.m2442(C1155.tvProgramTitle);
        C6635.m9823((Object) textView, "tvProgramTitle");
        textView.setText(r9.ދ);
        TextView textView2 = (TextView) c1163.m2442(C1155.tvProgramTime);
        C6635.m9823((Object) textView2, "tvProgramTime");
        textView2.setText(ލ.ؠ(r9.މ, false, 2) + " — " + ލ.ؠ(r9.ފ, false, 2));
        int iM6974 = C4303.m6974((((double) r9.މ) - (((double) System.currentTimeMillis()) / 1000.0d)) / ((double) 60));
        TextView textView3 = (TextView) c1163.m2442(C1155.tvTimeLeft);
        C6635.m9823((Object) textView3, "tvTimeLeft");
        textView3.setText(iM6974 > 0 ? c1163.getString(C1157.reminders_time_left, Integer.valueOf(iM6974)) : c1163.getString(C1157.reminders_now));
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static final /* synthetic */ void m2441(C1163 c1163, ޠ r5) {
        if (c1163 == null) {
            throw null;
        }
        LayoutInflaterFactory2C1494.C1505.m2936(r5.ށ, (C1267) r5.ؠ.getValue(), (C1262) null, 4);
        if (ލ.ޅ) {
            ލ.ކ = true;
            c1163.mo1520();
            return;
        }
        ލ.ބ = true;
        Context contextRequireContext = c1163.requireContext();
        C6635.m9823((Object) contextRequireContext, "requireContext()");
        CommonUtilsKt.֏(contextRequireContext, true);
        ActivityC1999 activity = c1163.getActivity();
        if (activity != null) {
            activity.finish();
        }
    }

    @Override // p000.p001.p021.p024.AbstractC1272, androidx.fragment.app.Fragment
    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        mo1519();
    }

    @Override // p000.p001.p021.p024.AbstractC1272, androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        if (view == null) {
            C6635.m9824("view");
            throw null;
        }
        super.onViewCreated(view, bundle);
        CommonUtilsKt.ؠ(this, new C1168(this, null));
        if (ރ.ߠ.ࢣ() == 0) {
            ((Button) m2442(C1155.btnWatch)).requestFocus();
        } else {
            ((Button) m2442(C1155.btnDismiss)).requestFocus();
        }
    }

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

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m2443(boolean z) {
        ConstraintLayout constraintLayout = (ConstraintLayout) m2442(C1155.popup);
        C6635.m9823((Object) constraintLayout, "popup");
        if ((constraintLayout.getVisibility() == 0) == z) {
            return;
        }
        C1825 c1825M3601 = C1825.m3601((ConstraintLayout) m2442(C1155.popup), View.ALPHA, z ? 1.0f : 0.0f);
        c1825M3601.mo3562(300L);
        ConstraintLayout constraintLayout2 = (ConstraintLayout) m2442(C1155.popup);
        C6635.m9823((Object) constraintLayout2, "popup");
        c1825M3601.m3553(new C1250(constraintLayout2));
        C6635.m9823((Object) c1825M3601, "ObjectAnimator.ofFloat(p…stenerX(popup))\n        }");
        int iM2502 = C1219.m2502(this, 32);
        C1825 c1825M36012 = C1825.m3601((ConstraintLayout) m2442(C1155.popup), View.TRANSLATION_Y, z ? 0.0f : -iM2502);
        c1825M36012.mo3562(300L);
        C6635.m9823((Object) c1825M36012, "ObjectAnimator.ofFloat(p… duration = 300\n        }");
        if (z) {
            ConstraintLayout constraintLayout3 = (ConstraintLayout) m2442(C1155.popup);
            C6635.m9823((Object) constraintLayout3, "popup");
            constraintLayout3.setVisibility(0);
            ConstraintLayout constraintLayout4 = (ConstraintLayout) m2442(C1155.popup);
            C6635.m9823((Object) constraintLayout4, "popup");
            constraintLayout4.setAlpha(0.0f);
            ConstraintLayout constraintLayout5 = (ConstraintLayout) m2442(C1155.popup);
            C6635.m9823((Object) constraintLayout5, "popup");
            constraintLayout5.setTranslationY(-iM2502);
        }
        C1806 c1806 = new C1806();
        c1806.m3578(c1825M3601, c1825M36012);
        c1806.m3553(new C1167(c1825M3601, c1825M36012, z));
        c1806.mo3569();
    }

    @Override // p000.p001.p021.p024.AbstractC1272
    /* JADX INFO: renamed from: ވ */
    public void mo1519() {
        HashMap map = this.f4237;
        if (map != null) {
            map.clear();
        }
    }

    @Override // p000.p001.p021.p024.AbstractC1272
    /* JADX INFO: renamed from: މ */
    public boolean mo1520() {
        m2443(false);
        return true;
    }
}
