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

import X.0Bx;
import X.0C0;
import X.0CH;
import X.0EB;
import X.0EF;
import X.0HH;
import X.1Bn;
import X.2Mg;
import X.2P2;
import X.2Pr;
import X.2bM;
import X.2ca;
import X.2dc;
import X.2fM;
import X.3HC;
import X.3YN;
import X.3YS;
import X.3YV;
import X.3YY;
import X.3YZ;
import X.3Ya;
import X.3Yb;
import X.3af;
import X.4Fh;
import X.4HR;
import X.4h2;
import X.4hP;
import X.4r1;
import X.6iy;
import X.9Y3;
import X.A7H;
import X.ARD;
import X.ARE;
import X.B3L;
import X.B3N;
import X.B3T;
import X.B3X;
import X.B3Z;
import X.BTK;
import X.BTT;
import X.BTW;
import X.BTY;
import X.BTZ;
import X.BU0;
import X.BU1;
import X.BU3;
import X.BU4;
import X.BU5;
import X.BU6;
import X.BU7;
import X.BU8;
import X.BUA;
import X.BUB;
import X.BUC;
import X.BUD;
import X.BUI;
import X.BUM;
import X.BUQ;
import X.BUS;
import X.BUT;
import X.BUX;
import X.BUY;
import X.C2188AoK;
import X.C2990B3a;
import X.C2991B3b;
import X.C2992B3c;
import X.C2993B3d;
import X.C3002B3m;
import X.C3636BRw;
import X.C3666BTa;
import X.C3670BTe;
import X.C3673BTh;
import X.C3674BTi;
import X.C3676BTk;
import X.C3677BTl;
import X.C3679BTn;
import X.C3680BTo;
import X.C3682BTq;
import X.C3683BTr;
import X.C3684BTs;
import X.C3687BTv;
import X.C3690BTy;
import X.C3718BVa;
import X.C3747BWd;
import X.C3757BWn;
import X.C3758BWo;
import X.C3762BWs;
import X.C3764BWu;
import X.Csa;
import X.Css;
import X.Csw;
import X.Csy;
import X.Cuh;
import X.Cus;
import X.Cv8;
import X.Cva;
import X.Cvh;
import X.CwK;
import X.CwU;
import X.Cwc;
import X.Cwf;
import X.Cwu;
import X.D1G;
import X.D8s;
import X.DAe;
import X.DAj;
import X.DCr;
import X.KEM;
import X.LeS;
import X.Lel;
import X.Lpk;
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.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.LiveData;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.assem.arch.viewModel.AssemViewModel;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.utils.KeyboardUtils;
import com.ss.android.ugc.aweme.qna.vm.QnaBannerViewModel;
import com.ss.android.ugc.aweme.qna.vm.QnaSelectedPageViewModel;
import com.ss.android.ugc.aweme.qna.vm.QnaSuggestedTabViewModel;
import com.ss.android.ugc.aweme.qna_search.vm.QnaSearchViewModel;
import com.ss.android.ugc.aweme.sticker.data.QaStruct;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;
import kotlin.h.b.n;

public class QnaSuggestedTabFragment extends BaseQnaTabFragment implements ARE {
    public static final BUQ LJJI = new BUQ((byte) 0);
    public QnaSuggestedTabViewModel LJIIIIZZ;
    public QnaSearchViewModel LJIIIZ;
    public String LJIIJ;
    public boolean LJIIJJI;
    public View LJIIL;
    public C3758BWo LJIILIIL;
    public C3757BWn LJIILJJIL;
    public String LJIILL;
    public final BUS LJIILLIIL;
    public final boolean LJIIZILJ;
    public C3718BVa LJIJ;
    public ConstraintLayout LJIJI;
    public 3YS LJIJJ;
    public String LJIJJLI;
    public final AtomicLong LJIL;
    public final int LJJ;
    public final Csa LJJIFFI;
    public final Csa LJJII;
    public RecyclerView LJJIII;
    public SparseArray LJJIIJ;

    static {
        Covode.recordClassIndex(101728);
    }

    public final int LIZ() {
        return 2131831374;
    }

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

    public final String LIZIZ() {
        return "suggested";
    }

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

    public final QnaBannerViewModel LJII() {
        return (QnaBannerViewModel) this.LJJIFFI.getValue();
    }

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

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

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

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

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

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

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

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

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

    public final void LJIIIZ() {
        this.LJIIJ = String.valueOf(System.currentTimeMillis());
    }

    public void onResume() {
        QnaSuggestedTabFragment.super.onResume();
        if (this.LJIIJJI) {
            this.LJIIJJI = false;
            LJIIIZ();
        }
    }

    public final C2993B3d LJIIIIZZ() {
        Serializable serializable;
        Bundle arguments = getArguments();
        C2993B3d b3d = null;
        if (arguments != null) {
            serializable = arguments.getSerializable("qna_profile_mode");
        } else {
            serializable = null;
        }
        if (serializable instanceof C2993B3d) {
            b3d = serializable;
        }
        return b3d;
    }

    public void onPause() {
        QnaSuggestedTabFragment.super.onPause();
        ConstraintLayout LIZ = LIZ(this.LJIJI);
        if (LIZ != null) {
            LIZ.clearFocus();
        }
        KeyboardUtils.LIZJ(getView());
    }

    public final void LIZJ() {
        C3764BWu bWu;
        super.LIZJ();
        C3718BVa bVa = this.LJIJ;
        if (bVa != null) {
            0EF layoutManager = bVa.getLayoutManager();
            if (!(layoutManager instanceof LinearLayoutManager)) {
                layoutManager = null;
            }
            LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
            if (linearLayoutManager != null) {
                int LJIIJ2 = linearLayoutManager.LJIIJ();
                int LJIIL2 = linearLayoutManager.LJIIL();
                ArrayList arrayList = new ArrayList();
                while (LJIIJ2 <= LJIIL2) {
                    int i = LJIIJ2 + 1;
                    RecyclerView.ViewHolder LJFF = bVa.LJFF(LJIIJ2);
                    if (!(LJFF instanceof C3762BWs)) {
                        LJFF = null;
                    }
                    C3762BWs bWs = (C3762BWs) LJFF;
                    if (!(bWs == null || (bWu = bWs.LIZ) == null)) {
                        arrayList.add(bWu);
                    }
                    LJIIJ2 = i;
                }
                C3758BWo bWo = this.LJIILIIL;
                if (bWo == null) {
                    n.LIZ("");
                }
                bWo.LIZIZ(arrayList);
            }
        }
    }

    public QnaSuggestedTabFragment() {
        Csa csa;
        Csa csa2;
        Csw csw = Csw.LIZ;
        D1G LIZ = KEM.LIZ.LIZ(QnaBannerViewModel.class);
        C3683BTr bTr = new C3683BTr(LIZ);
        BUB bub = BUB.INSTANCE;
        if (n.LIZ(csw, Csw.LIZ)) {
            csa = new Csa(LIZ, bTr, Css.LIZ, C2188AoK.LIZ((0CH) this, true), C2188AoK.LIZ((0C0) this, true), A7H.LIZ, bub, C2188AoK.LIZ((Fragment) this, true), C2188AoK.LIZIZ((Fragment) this, true));
        } else if (csw != null && !n.LIZ(csw, Csy.LIZ)) {
            throw new IllegalArgumentException("Do not support this scope here.");
        } else {
            csa = new Csa(LIZ, bTr, Css.LIZ, C2188AoK.LIZ((0CH) this, false), C2188AoK.LIZ((0C0) this, false), A7H.LIZ, bub, C2188AoK.LIZ((Fragment) this, false), C2188AoK.LIZIZ((Fragment) this, false));
        }
        this.LJJIFFI = csa;
        Csw csw2 = Csw.LIZ;
        D1G LIZ2 = KEM.LIZ.LIZ(QnaSelectedPageViewModel.class);
        C3684BTs bTs = new C3684BTs(LIZ2);
        BUC buc = BUC.INSTANCE;
        if (n.LIZ(csw2, Csw.LIZ)) {
            csa2 = new Csa(LIZ2, bTs, Css.LIZ, C2188AoK.LIZ((0CH) this, true), C2188AoK.LIZ((0C0) this, true), A7H.LIZ, buc, C2188AoK.LIZ((Fragment) this, true), C2188AoK.LIZIZ((Fragment) this, true));
        } else if (csw2 != null && !n.LIZ(csw2, Csy.LIZ)) {
            throw new IllegalArgumentException("Do not support this scope here.");
        } else {
            csa2 = new Csa(LIZ2, bTs, Css.LIZ, C2188AoK.LIZ((0CH) this, false), C2188AoK.LIZ((0C0) this, false), A7H.LIZ, buc, C2188AoK.LIZ((Fragment) this, false), C2188AoK.LIZIZ((Fragment) this, false));
        }
        this.LJJII = csa2;
        this.LJIILLIIL = new BUS();
        this.LJIIZILJ = true;
        this.LJIL = new AtomicLong(-1);
        this.LJJ = 3000;
    }

    public final void LIZLLL() {
        Serializable serializable;
        C2993B3d LJIIIIZZ2 = LJIIIIZZ();
        if (LJIIIIZZ2 == null || LJIIIIZZ2 != C2993B3d.FYP_BANNER) {
            QnaSuggestedTabViewModel qnaSuggestedTabViewModel = this.LJIIIIZZ;
            if (qnaSuggestedTabViewModel == null) {
                return;
            }
            if (9Y3.LIZ(9Y3.LIZ(), true, "public_qna_suggested_tab", 0) == 3) {
                BTK btk = qnaSuggestedTabViewModel.LIZ;
                String LIZIZ = 2dc.LIZ().LIZIZ(LeS.LIZIZ(new 2Mg[]{btk.LIZ(btk.LIZJ), btk.LIZIZ(btk.LIZLLL)}));
                n.LIZIZ(LIZIZ, "");
                btk.LIZ(LIZIZ, LeS.LIZIZ(new C3636BRw[]{C3636BRw.RECOMMEND, C3636BRw.INVITATION}), false);
            } else if (BU7.LIZIZ()) {
                qnaSuggestedTabViewModel.LIZ.LIZ();
            } else if (BU7.LIZ()) {
                qnaSuggestedTabViewModel.LIZ.LIZIZ();
            }
        } else {
            Bundle arguments = getArguments();
            Lel lel = null;
            if (arguments != null) {
                serializable = arguments.getSerializable("question_ids");
            } else {
                serializable = null;
            }
            if (!(serializable instanceof long[])) {
                serializable = null;
            }
            long[] jArr = (long[]) serializable;
            QnaSuggestedTabViewModel qnaSuggestedTabViewModel2 = this.LJIIIIZZ;
            if (qnaSuggestedTabViewModel2 != null) {
                BTK btk2 = qnaSuggestedTabViewModel2.LIZ;
                if (jArr != null) {
                    M12.LIZ(jArr);
                    int length = jArr.length;
                    if (length == 0) {
                        lel = Lel.INSTANCE;
                    } else if (length != 1) {
                        M12.LIZ(jArr);
                        lel = new ArrayList(jArr.length);
                        for (long valueOf : jArr) {
                            lel.add(Long.valueOf(valueOf));
                        }
                    } else {
                        lel = 6iy.LIZ(Long.valueOf(jArr[0]));
                    }
                }
                btk2.LIZ((List<Long>) lel);
            }
        }
    }

    public static final /* synthetic */ C3758BWo LIZ(QnaSuggestedTabFragment qnaSuggestedTabFragment) {
        C3758BWo bWo = qnaSuggestedTabFragment.LJIILIIL;
        if (bWo == null) {
            n.LIZ("");
        }
        return bWo;
    }

    public final Lpk LIZIZ(ConstraintLayout constraintLayout) {
        if (constraintLayout != null) {
            return constraintLayout.findViewById(2131369134);
        }
        return null;
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        LIZ(C3682BTq.LIZ);
    }

    public final ConstraintLayout LIZ(ConstraintLayout constraintLayout) {
        if (constraintLayout != null) {
            return constraintLayout.findViewById(2131369121);
        }
        return null;
    }

    public final void LIZIZ(int i) {
        3af r1 = new 3af(this);
        r1.LIZ(requireContext().getString(i));
        3af.LIZ(r1);
    }

    public final String LIZJ(ConstraintLayout constraintLayout) {
        Editable text;
        Lpk LIZIZ = LIZIZ(constraintLayout);
        if (LIZIZ == null || (text = LIZIZ.getText()) == null) {
            return null;
        }
        return text.toString();
    }

    public void onViewCreated(View view, Bundle bundle) {
        FrameLayout frameLayout;
        LiveData<BUY<2Pr>> liveData;
        LiveData<BUY<B3X>> liveData2;
        LiveData<BUY<Cwu<C3666BTa, String>>> liveData3;
        LiveData<BUY<2Pr>> liveData4;
        LiveData<BUY<2Pr>> liveData5;
        LiveData<BUY<2Pr>> liveData6;
        LiveData<BUY<2Pr>> liveData7;
        LiveData<BUY<String>> liveData8;
        LiveData<BUY<Cwu<List<C2991B3b>, String>>> liveData9;
        LiveData<BUY<List<BTW>>> liveData10;
        LiveData<BUY<List<BTW>>> liveData11;
        1Bn<BUY<2Pr>> r7;
        1Bn<BUY<Integer>> r72;
        LiveData<BUY<Integer>> liveData12;
        LiveData<BUY<2P2>> liveData13;
        LiveData<BUY<BU6>> liveData14;
        1Bn<BUY<String>> r73;
        LiveData<BUY<BU8>> liveData15;
        LiveData<BUY<B3N>> liveData16;
        1Bn<BUY<Cwu<QaStruct, Boolean>>> r74;
        1Bn<BUY<BTT>> r75;
        LiveData<BUY<Integer>> liveData17;
        LiveData<BUY<C3666BTa>> liveData18;
        LiveData<BUY<List<BTW>>> liveData19;
        0EB itemAnimator;
        M12.LIZ(view);
        QnaSuggestedTabFragment.super.onViewCreated(view, bundle);
        QnaSuggestedTabViewModel LIZ = new 0Bx(this).LIZ(QnaSuggestedTabViewModel.class);
        this.LJIIIIZZ = LIZ;
        if (LIZ != null) {
            C2993B3d LJIIIIZZ2 = LJIIIIZZ();
            LIZ.LIZIZ = LJIIIIZZ2;
            BTK btk = LIZ.LIZ;
            if (LJIIIIZZ2 != null) {
                btk.LJIIZILJ = LJIIIIZZ2;
            }
        }
        this.LJIIIZ = new 0Bx(this).LIZ(QnaSearchViewModel.class);
        View view2 = this.LJIIL;
        if (view2 == null) {
            n.LIZ("");
        }
        n.LIZIZ(requireContext(), "");
        C3718BVa bVa = (C3718BVa) view2.findViewById(2131370845);
        this.LJIJ = bVa;
        if (!(bVa == null || (itemAnimator = bVa.getItemAnimator()) == null)) {
            itemAnimator.LJIIJJI = 0;
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel = this.LJIIIIZZ;
        Objects.requireNonNull(qnaSuggestedTabViewModel, "null cannot be cast to non-null type com.ss.android.ugc.aweme.qna.vm.QnaViewHolderClickDelegate");
        BUS bus = this.LJIILLIIL;
        C2993B3d LJIIIIZZ3 = LJIIIIZZ();
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel2 = this.LJIIIIZZ;
        Objects.requireNonNull(qnaSuggestedTabViewModel2, "null cannot be cast to non-null type com.ss.android.ugc.aweme.qna.vm.QnaScrollDelegate");
        QnaSearchViewModel qnaSearchViewModel = this.LJIIIZ;
        Objects.requireNonNull(qnaSearchViewModel, "null cannot be cast to non-null type com.ss.android.ugc.aweme.qna_search.vm.QnaSearchDelegate");
        this.LJIILIIL = new C3758BWo(qnaSuggestedTabViewModel, bus, LJIIIIZZ3, qnaSuggestedTabViewModel2, qnaSearchViewModel);
        C3718BVa bVa2 = this.LJIJ;
        if (bVa2 != null) {
            bVa2.setLayoutManager(new LinearLayoutManager());
        }
        C3718BVa bVa3 = this.LJIJ;
        if (bVa3 != null) {
            C3758BWo bWo = this.LJIILIIL;
            if (bWo == null) {
                n.LIZ("");
            }
            bVa3.setAdapter(bWo);
        }
        C3718BVa bVa4 = this.LJIJ;
        if (bVa4 != null) {
            C3758BWo bWo2 = this.LJIILIIL;
            if (bWo2 == null) {
                n.LIZ("");
            }
            bVa4.LIZ(LIZ(bVa4, bWo2, (Ls2<2Pr>) new BTZ(this)));
        }
        Cus.LIZ(this, (QnaSelectedPageViewModel) this.LJJII.getValue(), BUD.LIZ, (Cvh) null, new C3677BTl(this), 6);
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel3 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel3 == null || (liveData19 = qnaSuggestedTabViewModel3.LIZJ) == null)) {
            liveData19.observe(getViewLifecycleOwner(), new BUX(new C3670BTe(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel4 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel4 == null || (liveData18 = qnaSuggestedTabViewModel4.LIZLLL) == null)) {
            liveData18.observe(getViewLifecycleOwner(), new BUX(new BUA(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel5 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel5 == null || (liveData17 = qnaSuggestedTabViewModel5.LJI) == null)) {
            liveData17.observe(getViewLifecycleOwner(), new BUX(new 2fM(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel6 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel6 == null || (r75 = qnaSuggestedTabViewModel6.LJII) == null)) {
            r75.observe(getViewLifecycleOwner(), new BUX(new C3674BTi(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel7 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel7 == null || (r74 = qnaSuggestedTabViewModel7.LJIIIZ) == null)) {
            r74.observe(getViewLifecycleOwner(), new BUX(new C2992B3c(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel8 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel8 == null || (liveData16 = qnaSuggestedTabViewModel8.LJIIL) == null)) {
            liveData16.observe(getViewLifecycleOwner(), new BUX(new B3T(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel9 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel9 == null || (liveData15 = qnaSuggestedTabViewModel9.LJIILIIL) == null)) {
            liveData15.observe(getViewLifecycleOwner(), new BUX(new C3687BTv(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel10 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel10 == null || (r73 = qnaSuggestedTabViewModel10.LJIIIIZZ) == null)) {
            r73.observe(getViewLifecycleOwner(), new BUX(new 2bM(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel11 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel11 == null || (liveData14 = qnaSuggestedTabViewModel11.LJIILJJIL) == null)) {
            liveData14.observe(getViewLifecycleOwner(), new BUX(new C3679BTn(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel12 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel12 == null || (liveData13 = qnaSuggestedTabViewModel12.LJFF) == null)) {
            liveData13.observe(getViewLifecycleOwner(), new BUX(new C3690BTy(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel13 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel13 == null || (liveData12 = qnaSuggestedTabViewModel13.LJ) == null)) {
            liveData12.observe(getViewLifecycleOwner(), new BUX(new 2ca(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel14 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel14 == null || (r72 = qnaSuggestedTabViewModel14.LJIIJ) == null)) {
            r72.observe(getViewLifecycleOwner(), new BUX(new C3676BTk(this)));
        }
        QnaSuggestedTabViewModel qnaSuggestedTabViewModel15 = this.LJIIIIZZ;
        if (!(qnaSuggestedTabViewModel15 == null || (r7 = qnaSuggestedTabViewModel15.LJIIJJI) == null)) {
            r7.observe(getViewLifecycleOwner(), new BUX(new BU3(this)));
        }
        QnaSearchViewModel qnaSearchViewModel2 = this.LJIIIZ;
        if (!(qnaSearchViewModel2 == null || (liveData11 = qnaSearchViewModel2.LIZIZ) == null)) {
            liveData11.observe(getViewLifecycleOwner(), new BUX(new 3YV(this)));
        }
        QnaSearchViewModel qnaSearchViewModel3 = this.LJIIIZ;
        if (!(qnaSearchViewModel3 == null || (liveData10 = qnaSearchViewModel3.LJIIIIZZ) == null)) {
            liveData10.observe(getViewLifecycleOwner(), new BUX(new 3YY(this)));
        }
        QnaSearchViewModel qnaSearchViewModel4 = this.LJIIIZ;
        if (!(qnaSearchViewModel4 == null || (liveData9 = qnaSearchViewModel4.LJIIIZ) == null)) {
            liveData9.observe(getViewLifecycleOwner(), new BUX(new B3Z(this)));
        }
        QnaSearchViewModel qnaSearchViewModel5 = this.LJIIIZ;
        if (!(qnaSearchViewModel5 == null || (liveData8 = qnaSearchViewModel5.LJ) == null)) {
            liveData8.observe(getViewLifecycleOwner(), new BUX(new 3YZ(this)));
        }
        QnaSearchViewModel qnaSearchViewModel6 = this.LJIIIZ;
        if (!(qnaSearchViewModel6 == null || (liveData7 = qnaSearchViewModel6.LJFF) == null)) {
            liveData7.observe(getViewLifecycleOwner(), new BUX(new 3Ya(this)));
        }
        QnaSearchViewModel qnaSearchViewModel7 = this.LJIIIZ;
        if (!(qnaSearchViewModel7 == null || (liveData6 = qnaSearchViewModel7.LJIIJ) == null)) {
            liveData6.observe(getViewLifecycleOwner(), new BUX(new C3680BTo(this)));
        }
        QnaSearchViewModel qnaSearchViewModel8 = this.LJIIIZ;
        if (!(qnaSearchViewModel8 == null || (liveData5 = qnaSearchViewModel8.LIZJ) == null)) {
            liveData5.observe(getViewLifecycleOwner(), new BUX(new 3YN(this)));
        }
        QnaSearchViewModel qnaSearchViewModel9 = this.LJIIIZ;
        if (!(qnaSearchViewModel9 == null || (liveData4 = qnaSearchViewModel9.LIZLLL) == null)) {
            liveData4.observe(getViewLifecycleOwner(), new BUX(new C3673BTh(this)));
        }
        QnaSearchViewModel qnaSearchViewModel10 = this.LJIIIZ;
        if (!(qnaSearchViewModel10 == null || (liveData3 = qnaSearchViewModel10.LJIIJJI) == null)) {
            liveData3.observe(getViewLifecycleOwner(), new BUX(new BTY(this)));
        }
        QnaSearchViewModel qnaSearchViewModel11 = this.LJIIIZ;
        if (!(qnaSearchViewModel11 == null || (liveData2 = qnaSearchViewModel11.LJI) == null)) {
            liveData2.observe(getViewLifecycleOwner(), new BUX(new C2990B3a(this)));
        }
        QnaSearchViewModel qnaSearchViewModel12 = this.LJIIIZ;
        if (!(qnaSearchViewModel12 == null || (liveData = qnaSearchViewModel12.LJII) == null)) {
            liveData.observe(getViewLifecycleOwner(), new BUX(new 3Yb(this)));
        }
        Cus.LIZ(this, LJII(), C3747BWd.LIZ, (Cvh) null, new C3002B3m(this), 6);
        Cus.LIZ(this, LJII(), 4h2.LIZ, Cva.LIZ(), new 4Fh(this), 4);
        View view3 = this.LJIIL;
        if (view3 == null) {
            n.LIZ("");
        }
        view3.findViewById(2131369147).LIZ();
        if (B3L.LIZ && LJIIIIZZ() != C2993B3d.FYP_BANNER) {
            Lpk lpk = null;
            DAe.LIZ(DAj.LIZ(DCr.LIZLLL), (D8s) null, new 3HC((4r1) null), 3);
            View view4 = this.LJIIL;
            if (view4 == null) {
                n.LIZ("");
            }
            this.LJIJI = view4.findViewById(2131370850);
            this.LJIIIZ = new 0Bx(this).LIZ(QnaSearchViewModel.class);
            QnaSuggestedTabViewModel qnaSuggestedTabViewModel16 = this.LJIIIIZZ;
            Objects.requireNonNull(qnaSuggestedTabViewModel16, "null cannot be cast to non-null type com.ss.android.ugc.aweme.qna.vm.QnaViewHolderClickDelegate");
            QnaSearchViewModel qnaSearchViewModel13 = this.LJIIIZ;
            Objects.requireNonNull(qnaSearchViewModel13, "null cannot be cast to non-null type com.ss.android.ugc.aweme.qna_search.vm.QnaSearchDelegate");
            this.LJIILJJIL = new C3757BWn(qnaSuggestedTabViewModel16, qnaSearchViewModel13);
            View view5 = this.LJIIL;
            if (view5 == null) {
                n.LIZ("");
            }
            RecyclerView findViewById = view5.findViewById(2131370851);
            this.LJJIII = findViewById;
            if (findViewById != null) {
                findViewById.setAdapter(this.LJIILJJIL);
            }
            RecyclerView recyclerView = this.LJJIII;
            if (recyclerView != null) {
                requireContext();
                recyclerView.setLayoutManager(new LinearLayoutManager());
            }
            RecyclerView recyclerView2 = this.LJJIII;
            if (recyclerView2 != null) {
                recyclerView2.setItemAnimator((0EB) null);
            }
            ConstraintLayout constraintLayout = this.LJIJI;
            if (constraintLayout != null) {
                frameLayout = (FrameLayout) constraintLayout.findViewById(2131370846);
            } else {
                frameLayout = null;
            }
            QnaSearchViewModel qnaSearchViewModel14 = this.LJIIIZ;
            if (!(qnaSearchViewModel14 instanceof BUM)) {
                qnaSearchViewModel14 = null;
            }
            Context requireContext = requireContext();
            n.LIZIZ(requireContext, "");
            RecyclerView recyclerView3 = this.LJJIII;
            M12.LIZ(requireContext);
            0HH.LIZ(LayoutInflater.from(requireContext), 2131560927, frameLayout, true);
            if (frameLayout != null) {
                frameLayout.setOnClickListener(BUT.LIZ);
                lpk = (Lpk) frameLayout.findViewById(2131369134);
                View findViewById2 = frameLayout.findViewById(2131369136);
                View findViewById3 = frameLayout.findViewById(2131369137);
                View findViewById4 = frameLayout.findViewById(2131369133);
                if (lpk != null) {
                    lpk.addTextChangedListener(new BU0(findViewById2, qnaSearchViewModel14));
                    lpk.setOnEditorActionListener(new BU4(qnaSearchViewModel14));
                }
                if (findViewById3 != null) {
                    findViewById3.setOnClickListener(new BU1(lpk, findViewById2, qnaSearchViewModel14));
                }
                if (findViewById4 != null) {
                    findViewById4.setOnClickListener(new BUI(qnaSearchViewModel14));
                }
            }
            if (recyclerView3 != null) {
                recyclerView3.setOnTouchListener(new BU5(lpk));
            }
        }
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        View LIZ = 0HH.LIZ(layoutInflater, 2131560943, viewGroup, false);
        n.LIZIZ(LIZ, "");
        this.LJIIL = LIZ;
        if (LIZ == null) {
            n.LIZ("");
        }
        return LIZ;
    }

    public <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 <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 <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 <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 <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 <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);
    }
}
