package com.ss.android.ugc.aweme.ui.fragment;

import X.0CH;
import X.0HH;
import X.2Pr;
import X.4HR;
import X.4hP;
import X.7he;
import X.A14;
import X.A7H;
import X.AM9;
import X.AN1;
import X.ANJ;
import X.ARD;
import X.ARE;
import X.AnonymousClass9sC;
import X.C2188AoK;
import X.Crj;
import X.Csc;
import X.Css;
import X.Cuh;
import X.Cv8;
import X.Cvh;
import X.CwK;
import X.CwU;
import X.Cwc;
import X.Cwf;
import X.HeD;
import X.KEM;
import X.Ls2;
import X.LsC;
import X.LsD;
import X.LsE;
import X.LsF;
import X.Lsh;
import X.M12;
import X.PHD;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import androidx.fragment.app.Fragment;
import com.bytedance.assem.arch.viewModel.AssemViewModel;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.foundation.fragment.BaseFragment;
import com.ss.android.ugc.aweme.feed.assem.photos.PhotoViewModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.model.PostModeDetailParams;
import com.ss.android.ugc.aweme.viewmodel.PostModeActivityViewModel;
import java.io.Serializable;
import kotlin.h.b.n;

public final class PostModeSimpleFragment extends BaseFragment implements ARE, ANJ {
    public static final AN1 LJ = new AN1((byte) 0);
    public PostModeDetailParams LJFF;
    public final Crj LJI = 7he.LIZ(new AnonymousClass9sC(this));
    public final Csc LJII = new Csc(KEM.LIZ.LIZ(PhotoViewModel.class), (Ls2) null, Css.LIZ, C2188AoK.LIZ((0CH) this, false), A7H.LIZ, A14.INSTANCE, C2188AoK.LIZ((Fragment) this, true), C2188AoK.LIZIZ((Fragment) this, true));
    public SparseArray LJIIIIZZ;

    static {
        Covode.recordClassIndex(121262);
    }

    public final View LIZ(int i) {
        if (this.LJIIIIZZ == null) {
            this.LJIIIIZZ = new SparseArray();
        }
        View view = (View) this.LJIIIIZZ.get(i);
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LJIIIIZZ.put(i, findViewById);
        return findViewById;
    }

    public final PostModeActivityViewModel LIZ() {
        return (PostModeActivityViewModel) this.LJI.getValue();
    }

    public final void LJI() {
        SparseArray sparseArray = this.LJIIIIZZ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final /* synthetic */ void onDestroyView() {
        PostModeSimpleFragment.super.onDestroyView();
        LJI();
    }

    public final 0CH getActualLifecycleOwner() {
        ARD.LIZIZ(this);
        return this;
    }

    public final Cv8 getActualLifecycleOwnerHolder() {
        ARD.LIZ(this);
        return this;
    }

    public final 4hP getActualReceiver() {
        ARD.LIZLLL(this);
        return this;
    }

    public final Cuh<4hP> getActualReceiverHolder() {
        ARD.LIZJ(this);
        return this;
    }

    public final 0CH getHostLifecycleOwner() {
        M12.LIZ(this);
        return null;
    }

    public final 0CH getOwnLifecycleOwner() {
        ARD.LJ(this);
        return this;
    }

    public final 4hP getReceiverForHostVM() {
        M12.LIZ(this);
        return null;
    }

    public final boolean getUniqueOnlyDefault() {
        return ARD.LJFF(this);
    }

    public final boolean LJJJJI() {
        PostModeDetailParams postModeDetailParams = this.LJFF;
        if (postModeDetailParams == null) {
            n.LIZ("");
        }
        return postModeDetailParams.LJIILJJIL;
    }

    public final void onCreate(Bundle bundle) {
        PostModeSimpleFragment.super.onCreate(bundle);
        LIZ(AM9.LIZ);
    }

    public final Aweme LIZ(Bundle bundle) {
        Serializable serializable;
        Serializable serializable2 = null;
        if (bundle != null) {
            serializable = bundle.getSerializable("aweme");
        } else {
            serializable = null;
        }
        if (serializable instanceof Aweme) {
            serializable2 = serializable;
        }
        return (Aweme) serializable2;
    }

    public final void onViewCreated(View view, Bundle bundle) {
        PostModeDetailParams postModeDetailParams;
        M12.LIZ(view);
        PostModeSimpleFragment.super.onViewCreated(view, bundle);
        Bundle arguments = getArguments();
        if (arguments == null || (postModeDetailParams = (PostModeDetailParams) arguments.getParcelable("POST_DETAIL_PARAMS")) == null) {
            new PostModeDetailParams
            /*  JADX ERROR: Method code generation error
                jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0018: CONSTRUCTOR  (r0v23 ? I:com.ss.android.ugc.aweme.model.PostModeDetailParams) =  call: com.ss.android.ugc.aweme.model.PostModeDetailParams.<init>():void type: CONSTRUCTOR in method: com.ss.android.ugc.aweme.ui.fragment.PostModeSimpleFragment.onViewCreated(android.view.View, android.os.Bundle):void, dex: classes5.dex
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:256)
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:221)
                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:109)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:55)
                	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:92)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:58)
                	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:98)
                	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:142)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:62)
                	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:92)
                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:58)
                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:211)
                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:204)
                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:318)
                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:271)
                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:240)
                	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
                	at java.util.ArrayList.forEach(ArrayList.java:1259)
                	at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                	at java.util.stream.Sink$ChainedReference.end(Sink.java:258)
                	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483)
                	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
                	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
                	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
                	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:236)
                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:227)
                	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:112)
                	at jadx.core.codegen.ClassGen.makeClass(ClassGen.java:78)
                	at jadx.core.codegen.CodeGen.wrapCodeGen(CodeGen.java:44)
                	at jadx.core.codegen.CodeGen.generateJavaCode(CodeGen.java:33)
                	at jadx.core.codegen.CodeGen.generate(CodeGen.java:21)
                	at jadx.core.ProcessClass.generateCode(ProcessClass.java:61)
                	at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:273)
                Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Code variable not set in r0v23 ?
                	at jadx.core.dex.instructions.args.SSAVar.getCodeVar(SSAVar.java:189)
                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:620)
                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:364)
                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:250)
                	... 34 more
                */
            /*
                this = this;
                X.M12.LIZ(r9)
                com.ss.android.ugc.aweme.ui.fragment.PostModeSimpleFragment.super.onViewCreated(r9, r10)
                android.os.Bundle r1 = r8.getArguments()
                if (r1 == 0) goto L_0x0016
                java.lang.String r0 = "POST_DETAIL_PARAMS"
                android.os.Parcelable r0 = r1.getParcelable(r0)
                com.ss.android.ugc.aweme.model.PostModeDetailParams r0 = (com.ss.android.ugc.aweme.model.PostModeDetailParams) r0
                if (r0 != 0) goto L_0x001b
            L_0x0016:
                com.ss.android.ugc.aweme.model.PostModeDetailParams r0 = new com.ss.android.ugc.aweme.model.PostModeDetailParams
                r0.<init>()
            L_0x001b:
                r8.LJFF = r0
                android.os.Bundle r0 = r8.getArguments()
                com.ss.android.ugc.aweme.feed.model.Aweme r7 = r8.LIZ((android.os.Bundle) r0)
                androidx.recyclerview.widget.LinearLayoutManager r3 = new androidx.recyclerview.widget.LinearLayoutManager
                r8.requireContext()
                r3.<init>()
                r4 = 2131368745(0x7f0a1b29, float:1.8357449E38)
                android.view.View r0 = r8.LIZ(r4)
                androidx.recyclerview.widget.RecyclerView r0 = (androidx.recyclerview.widget.RecyclerView) r0
                if (r0 == 0) goto L_0x003b
                r0.setLayoutManager(r3)
            L_0x003b:
                X.AHP r6 = new X.AHP
                X.1hK r5 = r8.requireActivity()
                java.lang.String r0 = "null cannot be cast to non-null type com.ss.android.ugc.aweme.ui.activity.PostModeDetailActivity"
                java.util.Objects.requireNonNull(r5, r0)
                com.ss.android.ugc.aweme.ui.activity.PostModeDetailActivity r5 = (com.ss.android.ugc.aweme.ui.activity.PostModeDetailActivity) r5
                android.view.View r2 = r8.LIZ(r4)
                X.AQG r2 = (X.AQG) r2
                java.lang.String r1 = ""
                kotlin.h.b.n.LIZIZ(r2, r1)
                com.ss.android.ugc.aweme.model.PostModeDetailParams r0 = r8.LJFF
                if (r0 != 0) goto L_0x005a
                kotlin.h.b.n.LIZ(r1)
            L_0x005a:
                boolean r0 = r0.LJIILJJIL
                r6.<init>(r5, r7, r2, r0)
                android.view.View r0 = r8.LIZ(r4)
                androidx.recyclerview.widget.RecyclerView r0 = (androidx.recyclerview.widget.RecyclerView) r0
                if (r0 == 0) goto L_0x006a
                r0.setAdapter(r6)
            L_0x006a:
                android.view.View r1 = r8.LIZ(r4)
                androidx.recyclerview.widget.RecyclerView r1 = (androidx.recyclerview.widget.RecyclerView) r1
                X.9sJ r0 = new X.9sJ
                r0.<init>(r8)
                r1.LIZ(r0)
                X.AOx r2 = X.C1011AOx.LIZ
                android.view.View r1 = r8.LIZ(r4)
                androidx.recyclerview.widget.RecyclerView r1 = (androidx.recyclerview.widget.RecyclerView) r1
                com.ss.android.ugc.aweme.viewmodel.PostModeActivityViewModel r0 = r8.LIZ()
                r2.LIZ((androidx.recyclerview.widget.RecyclerView) r1, (com.ss.android.ugc.aweme.viewmodel.PostModeActivityViewModel) r0)
                android.view.View r1 = r8.LIZ(r4)
                X.AQG r1 = (X.AQG) r1
                if (r1 == 0) goto L_0x0096
                r0 = 1
                r1.LJJJ = r0
                r0 = r8
                r1.setDragUpDelegate(r0)
            L_0x0096:
                android.view.View r1 = r8.LIZ(r4)
                X.AQG r1 = (X.AQG) r1
                if (r1 == 0) goto L_0x00ae
                X.AME r0 = new X.AME
                r0.<init>(r8)
                r1.setUpperThresholdCallback(r0)
                X.AMC r0 = new X.AMC
                r0.<init>(r8)
                r1.setBottomThresholdCallback(r0)
            L_0x00ae:
                com.ss.android.ugc.aweme.viewmodel.PostModeActivityViewModel r0 = r8.LIZ()
                X.1Bn<java.lang.Boolean> r2 = r0.LJIJ
                X.0CH r1 = r8.getViewLifecycleOwner()
                X.9sF r0 = new X.9sF
                r0.<init>(r8, r3)
                r2.observe(r1, r0)
                X.Csc r0 = r8.LJII
                java.lang.Object r1 = r0.getValue()
                com.ss.android.ugc.aweme.feed.assem.photos.PhotoViewModel r1 = (com.ss.android.ugc.aweme.feed.assem.photos.PhotoViewModel) r1
                X.PHD r2 = X.AMK.LIZ
                r3 = 0
                X.AKV r4 = new X.AKV
                r4.<init>(r8)
                r5 = 6
                r0 = r8
                X.Cus.LIZ(r0, r1, r2, r3, r4, r5)
                com.ss.android.ugc.aweme.viewmodel.PostModeActivityViewModel r0 = r8.LIZ()
                X.1Bn<java.lang.Boolean> r2 = r0.LJIIZILJ
                X.0CH r1 = r8.getViewLifecycleOwner()
                X.AM7 r0 = new X.AM7
                r0.<init>(r8)
                r2.observe(r1, r0)
                com.ss.android.ugc.aweme.viewmodel.PostModeActivityViewModel r0 = r8.LIZ()
                androidx.lifecycle.LiveData<X.2Pr> r2 = r0.LJ
                X.0CH r1 = r8.getViewLifecycleOwner()
                X.AKS r0 = new X.AKS
                r0.<init>(r8)
                r2.observe(r1, r0)
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.ui.fragment.PostModeSimpleFragment.onViewCreated(android.view.View, android.os.Bundle):void");
        }

        public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
            M12.LIZ(layoutInflater);
            View LIZ = 0HH.LIZ(layoutInflater, 2131560746, viewGroup, false);
            View findViewById = LIZ.findViewById(2131362731);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
            layoutParams.addRule(10, -1);
            layoutParams.height = HeD.LIZIZ(requireContext()) / 3;
            n.LIZIZ(findViewById, "");
            findViewById.setLayoutParams(layoutParams);
            return LIZ;
        }

        public final <S extends 4HR> void subscribe(AssemViewModel<S> assemViewModel, Cvh<S> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super S, 2Pr> lsD) {
            M12.LIZ(assemViewModel, cvh, lsD);
            ARD.LIZ(this, assemViewModel, cvh, lsC, lsD);
        }

        public final <S extends 4HR, A> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
            M12.LIZ(assemViewModel, phd, cvh, lsD);
            ARD.LIZ(this, assemViewModel, phd, cvh, lsC, lsD);
        }

        public final <S extends 4HR, A> void selectSubscribeOnAsync(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
            M12.LIZ(assemViewModel, phd, cvh, lsD);
            ARD.LIZIZ(this, assemViewModel, phd, cvh, lsC, lsD);
        }

        public final <S extends 4HR, A, B> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, Cvh<CwU<A, B>> cvh, LsC<? super Throwable, 2Pr> lsC, LsE<? super 4hP, ? super A, ? super B, 2Pr> lsE) {
            M12.LIZ(assemViewModel, phd, phd2, cvh, lsE);
            ARD.LIZ(this, assemViewModel, phd, phd2, cvh, lsC, lsE);
        }

        public final <S extends 4HR, A, B, C> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, Cvh<Cwc<A, B, C>> cvh, LsC<? super Throwable, 2Pr> lsC, LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF) {
            LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF2 = lsF;
            AssemViewModel<S> assemViewModel2 = assemViewModel;
            PHD<S, ? extends A> phd4 = phd;
            PHD<S, ? extends B> phd5 = phd2;
            PHD<S, ? extends C> phd6 = phd3;
            Cvh<Cwc<A, B, C>> cvh2 = cvh;
            M12.LIZ(assemViewModel2, phd4, phd5, phd6, cvh2, lsF2);
            ARD.LIZ(this, assemViewModel2, phd4, phd5, phd6, cvh2, lsC, lsF2);
        }

        public final <S extends 4HR, A, B, C, D> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, PHD<S, ? extends D> phd4, Cvh<Cwf<A, B, C, D>> cvh, LsC<? super Throwable, 2Pr> lsC, Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh) {
            Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh2 = lsh;
            AssemViewModel<S> assemViewModel2 = assemViewModel;
            PHD<S, ? extends A> phd5 = phd;
            PHD<S, ? extends B> phd6 = phd2;
            PHD<S, ? extends C> phd7 = phd3;
            PHD<S, ? extends D> phd8 = phd4;
            Cvh<Cwf<A, B, C, D>> cvh2 = cvh;
            M12.LIZ(assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsh2);
            ARD.LIZ(this, assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsC, lsh2);
        }
    }
