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

import X.04R;
import X.0CH;
import X.0HH;
import X.1hK;
import X.2K7;
import X.2Pr;
import X.2UX;
import X.2bf;
import X.2cN;
import X.2nK;
import X.2tE;
import X.2uR;
import X.33m;
import X.33n;
import X.39Y;
import X.3As;
import X.3BB;
import X.3F7;
import X.3af;
import X.3c7;
import X.3cA;
import X.3cC;
import X.3cI;
import X.46i;
import X.4HR;
import X.4WT;
import X.4WV;
import X.4WW;
import X.4YP;
import X.4YQ;
import X.4hP;
import X.7he;
import X.A7H;
import X.ARD;
import X.ARE;
import X.C2188AoK;
import X.C2801AyD;
import X.C2802AyE;
import X.C2805AyH;
import X.C2806AyI;
import X.C2807AyJ;
import X.C2808AyK;
import X.C2809AyL;
import X.C2810AyM;
import X.C2815AyR;
import X.C2816AyS;
import X.C2817AyT;
import X.C2818AyU;
import X.C2819AyV;
import X.C2821AyX;
import X.C2822AyY;
import X.C6391CZv;
import X.C6474CbG;
import X.Crj;
import X.Csc;
import X.Css;
import X.Cuh;
import X.Cv8;
import X.Cva;
import X.Cvh;
import X.CwK;
import X.CwU;
import X.Cwc;
import X.Cwf;
import X.KEM;
import X.Lf3;
import X.LnI;
import X.Lpk;
import X.Ls2;
import X.LsC;
import X.LsD;
import X.LsE;
import X.LsF;
import X.Lsh;
import X.Lw4;
import X.M12;
import X.Mk2;
import X.Mk3;
import X.PHD;
import X.PhE;
import X.PlI;
import X.Qeg;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.Editable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.constraintlayout.widget.ConstraintLayout;
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.bytedance.keva.Keva;
import com.bytedance.router.arg.RouteArgExtension;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.base.utils.KeyboardUtils;
import com.ss.android.ugc.aweme.im.service.model.IMUser;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.qainvitation.service.IQAInvitationService;
import com.ss.android.ugc.aweme.qainvitation.service.QAInvitationService;
import com.ss.android.ugc.aweme.qna.model.AskQuestionParam;
import com.ss.android.ugc.aweme.qna.vm.QnaCreationViewModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import kotlin.h.b.n;
import kotlin.o.z;

@C6391CZv
public final class QnaAskQuestionFragment extends BaseFragment implements ARE, 2bf {
    public static final C2822AyY LJIIIZ = new C2822AyY((byte) 0);
    public 4WW LJ;
    public final IQAInvitationService LJFF;
    public List<? extends User> LJI;
    public List<? extends IMUser> LJII;
    public boolean LJIIIIZZ;
    public final Crj LJIIJ = RouteArgExtension.INSTANCE.navArg(this);
    public final Crj LJIIJJI = 7he.LIZ(new C2809AyL(this));
    public final Csc LJIIL = new Csc(KEM.LIZ.LIZ(QnaCreationViewModel.class), (Ls2) null, Css.LIZ, C2188AoK.LIZ((0CH) this, false), A7H.LIZ, C2810AyM.INSTANCE, C2188AoK.LIZ((Fragment) this, true), C2188AoK.LIZIZ((Fragment) this, true));
    public Runnable LJIILIIL;
    public SparseArray LJIILJJIL;

    static {
        Covode.recordClassIndex(101671);
    }

    private final QnaCreationViewModel LJIIIZ() {
        return (QnaCreationViewModel) this.LJIIL.getValue();
    }

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

    public final AskQuestionParam LIZIZ() {
        return (AskQuestionParam) this.LJIIJ.getValue();
    }

    public final void LIZJ() {
    }

    public final AskQuestionParam LIZLLL() {
        return (AskQuestionParam) this.LJIIJJI.getValue();
    }

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

    public final /* synthetic */ void onDestroyView() {
        QnaAskQuestionFragment.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 static boolean LJIIJ() {
        try {
            return 2K7.LIZ.LIZJ();
        } catch (Exception unused) {
            return false;
        }
    }

    public final void onResume() {
        QnaAskQuestionFragment.super.onResume();
        LIZ(false);
        LJIIJJI();
    }

    private final void LJIIJJI() {
        Lpk LIZ = LIZ(2131362420);
        if (LIZ != null) {
            LIZ.postDelayed(new C2805AyH(this), 100);
        }
    }

    public QnaAskQuestionFragment() {
        IQAInvitationService LIZIZ = QAInvitationService.LIZIZ();
        n.LIZIZ(LIZIZ, "");
        this.LJFF = LIZIZ;
        this.LJI = new ArrayList();
        this.LJII = new ArrayList();
    }

    public final void LJIIIIZZ() {
        List<? extends IMUser> list;
        List<? extends IMUser> list2 = this.LJII;
        List<? extends User> list3 = null;
        if (list2 != null) {
            ArrayList arrayList = new ArrayList();
            for (T next : list2) {
                String uid = ((IMUser) next).getUid();
                IAccountUserService LJFF2 = 46i.LJFF();
                n.LIZIZ(LJFF2, "");
                if (!n.LIZ(uid, LJFF2.getCurUserId())) {
                    arrayList.add(next);
                }
            }
            list = arrayList;
        } else {
            list = null;
        }
        this.LJII = list;
        List<? extends User> list4 = this.LJI;
        if (list4 != null) {
            ArrayList arrayList2 = new ArrayList();
            for (T next2 : list4) {
                String uid2 = ((User) next2).getUid();
                IAccountUserService LJFF3 = 46i.LJFF();
                n.LIZIZ(LJFF3, "");
                if (!n.LIZ(uid2, LJFF3.getCurUserId())) {
                    arrayList2.add(next2);
                }
            }
            list3 = arrayList2;
        }
        this.LJI = list3;
        LIZ(list3);
    }

    public final void LIZ() {
        ArrayList<User> invitedUsers;
        User user;
        ArrayList<User> invitedUsers2 = LIZLLL().getInvitedUsers();
        if (invitedUsers2 != null && !invitedUsers2.isEmpty()) {
            Keva repo = Keva.getRepo("question_repo");
            StringBuilder sb = new StringBuilder("ask_question_invite_message_show");
            IAccountUserService LJFF2 = 46i.LJFF();
            n.LIZIZ(LJFF2, "");
            sb.append(LJFF2.getCurUserId());
            if (repo.getBoolean(sb.toString(), true) && (invitedUsers = LIZLLL().getInvitedUsers()) != null && (user = invitedUsers.get(0)) != null) {
                3As LIZ = LIZ(2131366146);
                n.LIZIZ(LIZ, "");
                n.LIZIZ(user, "");
                33m r2 = new 33m(this, user, LIZ);
                this.LJIILIIL = r2;
                LIZ.postDelayed(r2, 300);
                Keva repo2 = Keva.getRepo("question_repo");
                StringBuilder sb2 = new StringBuilder("ask_question_invite_message_show");
                IAccountUserService LJFF3 = 46i.LJFF();
                n.LIZIZ(LJFF3, "");
                sb2.append(LJFF3.getCurUserId());
                repo2.storeBoolean(sb2.toString(), false);
            }
        }
    }

    public final void LJII() {
        String str;
        String enterMethod;
        Lpk LIZ = LIZ(2131362420);
        if (LIZ != null) {
            LIZ.getContext();
            if (!LJIIJ()) {
                3BB r1 = new 3BB(LIZ.getContext());
                r1.LIZIZ(2131827476);
                r1.LIZIZ();
                return;
            }
            IAccountUserService LJFF2 = 46i.LJFF();
            String str2 = "";
            n.LIZIZ(LJFF2, str2);
            if (!LJFF2.isLogin()) {
                AskQuestionParam LIZIZ = LIZIZ();
                if (LIZIZ == null || (str = LIZIZ.getEnterFrom()) == null) {
                    str = str2;
                }
                AskQuestionParam LIZIZ2 = LIZIZ();
                if (!(LIZIZ2 == null || (enterMethod = LIZIZ2.getEnterMethod()) == null)) {
                    str2 = enterMethod;
                }
                Lw4.LIZ(this, str, str2, new C2819AyV(this));
                return;
            }
            C6474CbG cbG = (C6474CbG) LIZ(2131362418);
            if (cbG != null) {
                cbG.setLoading(true);
            }
            C6474CbG cbG2 = (C6474CbG) LIZ(2131362418);
            if (cbG2 != null) {
                cbG2.setClickable(false);
            }
            C6474CbG cbG3 = (C6474CbG) LIZ(2131362419);
            if (cbG3 != null) {
                cbG3.setClickable(false);
            }
            ConstraintLayout LIZ2 = LIZ(2131362421);
            if (LIZ2 != null) {
                LIZ2.setClickable(false);
            }
            String valueOf = String.valueOf(LIZ.getText());
            LJIIIIZZ();
            if (this.LJ == null) {
                String replace = new Lf3("(?m)^[ \t]*\r?\n").replace(valueOf, str2);
                Objects.requireNonNull(replace, "null cannot be cast to non-null type kotlin.CharSequence");
                if (z.LIZIZ(replace).toString().length() == 0) {
                    LIZ(true);
                    return;
                }
                QnaCreationViewModel LJIIIZ2 = LJIIIZ();
                CharSequence LIZIZ3 = z.LIZIZ(valueOf);
                List<? extends User> list = this.LJI;
                M12.LIZ(LIZIZ3);
                LJIIIZ2.setState(C2815AyR.LIZ);
                try {
                    String LIZ3 = LJIIIZ2.LIZ(list);
                    C2808AyK ayK = LJIIIZ2.LIZ.LIZIZ;
                    IAccountUserService LJFF3 = 46i.LJFF();
                    n.LIZIZ(LJFF3, str2);
                    String curUserId = LJFF3.getCurUserId();
                    n.LIZIZ(curUserId, str2);
                    Long LJI2 = 2tE.LJI(curUserId);
                    String obj = LIZIZ3.toString();
                    n.LIZIZ(LIZ3, str2);
                    2cN LIZ4 = ayK.LIZ(LJI2, obj, LIZ3).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(new C2807AyJ(LJIIIZ2), new C2806AyI(LJIIIZ2));
                    n.LIZIZ(LIZ4, str2);
                    LJIIIZ2.disposeOnClear(LIZ4);
                } catch (Exception e) {
                    0HH.LIZ(e);
                }
            }
        }
    }

    public final void onCreate(Bundle bundle) {
        Window window;
        QnaAskQuestionFragment.super.onCreate(bundle);
        LIZ(C2801AyD.LIZ);
        1hK activity = getActivity();
        if (activity != null && (window = activity.getWindow()) != null) {
            window.setSoftInputMode(16);
        }
    }

    public final void LIZ(Ls2<2Pr> ls2) {
        IAccountUserService LJFF2 = 46i.LJFF();
        String str = "";
        n.LIZIZ(LJFF2, str);
        if (!LJFF2.isLogin()) {
            1hK activity = getActivity();
            if (activity != null) {
                String enterFrom = LIZLLL().getEnterFrom();
                if (enterFrom == null) {
                    enterFrom = str;
                }
                String enterMethod = LIZLLL().getEnterMethod();
                if (enterMethod != null) {
                    str = enterMethod;
                }
                Lw4.LIZ(activity, enterFrom, str, new C2821AyX(this, ls2));
                return;
            }
            return;
        }
        ls2.invoke();
    }

    public final void LIZIZ(int i) {
        int i2 = 8;
        if (1 <= i && 5 > i) {
            Qeg LIZ = LIZ(2131362416);
            if (LIZ != null) {
                LIZ.setVisibility(8);
            }
            C6474CbG cbG = (C6474CbG) LIZ(2131362419);
            if (cbG != null) {
                cbG.setEnabled(true);
            }
            C6474CbG cbG2 = (C6474CbG) LIZ(2131362419);
            if (cbG2 != null) {
                cbG2.setIconTintColorRes(2130968666);
            }
            C6474CbG cbG3 = (C6474CbG) LIZ(2131362418);
            if (cbG3 != null) {
                cbG3.setEnabled(false);
            }
        } else if (5 <= i && 150 >= i) {
            Qeg LIZ2 = LIZ(2131362416);
            if (LIZ2 != null) {
                if (i >= 130) {
                    i2 = 0;
                }
                LIZ2.setVisibility(i2);
            }
            C6474CbG cbG4 = (C6474CbG) LIZ(2131362419);
            if (cbG4 != null) {
                cbG4.setEnabled(true);
            }
            C6474CbG cbG5 = (C6474CbG) LIZ(2131362419);
            if (cbG5 != null) {
                cbG5.setIconTintColorRes(2130968666);
            }
            C6474CbG cbG6 = (C6474CbG) LIZ(2131362418);
            if (cbG6 != null) {
                cbG6.setEnabled(this.LJIIIIZZ);
            }
        } else {
            Qeg LIZ3 = LIZ(2131362416);
            if (LIZ3 != null) {
                if (i != 0) {
                    i2 = 0;
                }
                LIZ3.setVisibility(i2);
            }
            C6474CbG cbG7 = (C6474CbG) LIZ(2131362419);
            if (cbG7 != null) {
                cbG7.setEnabled(false);
            }
            C6474CbG cbG8 = (C6474CbG) LIZ(2131362419);
            if (cbG8 != null) {
                cbG8.setIconTintColorRes(2130968667);
            }
            C6474CbG cbG9 = (C6474CbG) LIZ(2131362418);
            if (cbG9 != null) {
                cbG9.setEnabled(false);
            }
        }
    }

    public final void LIZ(List<? extends User> list) {
        boolean z;
        if (list == null || list.isEmpty()) {
            z = true;
        } else {
            z = false;
        }
        if (z) {
            3As LIZ = LIZ(2131366146);
            if (LIZ != null) {
                LIZ.setVisibility(8);
            }
            Qeg LIZ2 = LIZ(2131366149);
            if (LIZ2 != null) {
                LIZ2.setVisibility(0);
                return;
            }
            return;
        }
        3As LIZ3 = LIZ(2131366146);
        if (LIZ3 != null) {
            LIZ3.setVisibility(0);
        }
        Qeg LIZ4 = LIZ(2131366149);
        if (LIZ4 != null) {
            LIZ4.setVisibility(8);
        }
        3As LIZ5 = LIZ(2131366146);
        if (LIZ5 != null) {
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            int LIZ6 = LnI.LIZ(TypedValue.applyDimension(1, 24.0f, system.getDisplayMetrics()));
            Resources system2 = Resources.getSystem();
            n.LIZIZ(system2, "");
            LIZ5.LIZ(LIZ6, LnI.LIZ(TypedValue.applyDimension(1, 13.5f, system2.getDisplayMetrics())));
        }
        3As LIZ7 = LIZ(2131366146);
        if (LIZ7 != null) {
            LIZ7.LIZ(list, (long) list.size());
        }
    }

    public final void LIZJ(int i) {
        ForegroundColorSpan foregroundColorSpan;
        Resources resources;
        Resources resources2;
        Resources resources3;
        Resources resources4;
        ForegroundColorSpan foregroundColorSpan2;
        Resources resources5;
        ForegroundColorSpan foregroundColorSpan3;
        Resources resources6;
        String valueOf = String.valueOf(i);
        ForegroundColorSpan foregroundColorSpan4 = null;
        if (!3F7.LIZ(getContext())) {
            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(valueOf + "/150");
            if (i > 150 || i <= 0) {
                Context context = getContext();
                if (context == null || (resources5 = context.getResources()) == null) {
                    foregroundColorSpan2 = null;
                } else {
                    foregroundColorSpan2 = new ForegroundColorSpan(resources5.getColor(2131100212));
                }
                spannableStringBuilder.setSpan(foregroundColorSpan2, 0, valueOf.length(), 18);
            } else {
                Context context2 = getContext();
                if (context2 == null || (resources6 = context2.getResources()) == null) {
                    foregroundColorSpan3 = null;
                } else {
                    foregroundColorSpan3 = new ForegroundColorSpan(resources6.getColor(2131099758));
                }
                spannableStringBuilder.setSpan(foregroundColorSpan3, 0, valueOf.length(), 18);
            }
            Context context3 = getContext();
            if (!(context3 == null || (resources4 = context3.getResources()) == null)) {
                foregroundColorSpan4 = new ForegroundColorSpan(resources4.getColor(2131099758));
            }
            spannableStringBuilder.setSpan(foregroundColorSpan4, valueOf.length(), spannableStringBuilder.length(), 18);
            Qeg LIZ = LIZ(2131362416);
            if (LIZ != null) {
                LIZ.setText(spannableStringBuilder);
                return;
            }
            return;
        }
        SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder("150/" + valueOf);
        Context context4 = getContext();
        if (context4 == null || (resources3 = context4.getResources()) == null) {
            foregroundColorSpan = null;
        } else {
            foregroundColorSpan = new ForegroundColorSpan(resources3.getColor(2131099758));
        }
        spannableStringBuilder2.setSpan(foregroundColorSpan, 0, 4, 18);
        if (i > 150 || i <= 0) {
            Context context5 = getContext();
            if (!(context5 == null || (resources = context5.getResources()) == null)) {
                foregroundColorSpan4 = new ForegroundColorSpan(resources.getColor(2131100212));
            }
            spannableStringBuilder2.setSpan(foregroundColorSpan4, 4, spannableStringBuilder2.length(), 18);
        } else {
            Context context6 = getContext();
            if (!(context6 == null || (resources2 = context6.getResources()) == null)) {
                foregroundColorSpan4 = new ForegroundColorSpan(resources2.getColor(2131099758));
            }
            spannableStringBuilder2.setSpan(foregroundColorSpan4, 4, spannableStringBuilder2.length(), 18);
        }
        Qeg LIZ2 = LIZ(2131362416);
        if (LIZ2 != null) {
            LIZ2.setText(spannableStringBuilder2);
        }
    }

    public final void LIZ(boolean z) {
        Integer num;
        int i;
        int i2;
        Editable text;
        04R LIZ = LIZ(2131362420);
        if (LIZ == null || (text = LIZ.getText()) == null) {
            num = null;
        } else {
            num = Integer.valueOf(text.length());
        }
        if (num != null) {
            i = num.intValue();
        } else {
            i = 0;
        }
        LIZIZ(i);
        if (num != null) {
            i2 = num.intValue();
        } else {
            i2 = 0;
        }
        LIZJ(i2);
        C6474CbG cbG = (C6474CbG) LIZ(2131362418);
        if (cbG != null) {
            cbG.setLoading(false);
        }
        C6474CbG cbG2 = (C6474CbG) LIZ(2131362418);
        if (cbG2 != null) {
            cbG2.setClickable(true);
        }
        C6474CbG cbG3 = (C6474CbG) LIZ(2131362419);
        if (cbG3 != null) {
            cbG3.setClickable(true);
        }
        ConstraintLayout LIZ2 = LIZ(2131362421);
        if (LIZ2 != null) {
            LIZ2.setClickable(true);
        }
        if (z) {
            3af r1 = new 3af(this);
            r1.LJ(2131831275);
            3af.LIZ(r1);
        }
    }

    public final void onViewCreated(View view, Bundle bundle) {
        Qeg LIZ;
        3c7 LIZ2;
        M12.LIZ(view);
        QnaAskQuestionFragment.super.onViewCreated(view, bundle);
        Context context = getContext();
        int i = 0;
        if (!(context == null || (LIZ2 = LIZ(2131362423)) == null)) {
            2uR r3 = new 2uR();
            3cA r1 = new 3cA();
            r1.LIZ(2131755735);
            r1.LIZIZ = true;
            r1.LIZ(new 39Y(this));
            r3.LIZ(new 3cI[]{r1});
            3cC r12 = new 3cC();
            String string = context.getString(2131831273);
            n.LIZIZ(string, "");
            r12.LIZ(string);
            r3.LIZ(r12);
            r3.LIZLLL = true;
            LIZ2.setNavActions(r3);
        }
        C6474CbG cbG = (C6474CbG) LIZ(2131362419);
        if (cbG != null) {
            cbG.setOnClickListener(new 4WV(this));
        }
        C6474CbG cbG2 = (C6474CbG) LIZ(2131362418);
        if (cbG2 != null) {
            cbG2.setOnClickListener(new C2818AyU(this));
        }
        Lpk LIZ3 = LIZ(2131362420);
        if (LIZ3 != null) {
            LIZ3.setRawInputType(1);
        }
        Lpk LIZ4 = LIZ(2131362420);
        if (LIZ4 != null) {
            LIZ4.setOnEditorActionListener(new C2802AyE(this));
        }
        Lpk LIZ5 = LIZ(2131362420);
        if (LIZ5 != null) {
            LIZ5.addTextChangedListener(new 33n(this));
        }
        LIZ(2131362421).setOnClickListener(new 4WT(this));
        LIZ(false);
        LJIIJJI();
        AskQuestionParam LIZLLL = LIZLLL();
        String enterFrom = LIZLLL.getEnterFrom();
        String enterMethod = LIZLLL.getEnterMethod();
        2UX r13 = new 2UX();
        if (enterFrom != null) {
            r13.LIZ("enter_from", enterFrom);
        }
        if (enterMethod != null) {
            r13.LIZ("enter_method", enterMethod);
        }
        2nK.LIZ("ask_question", r13.LIZ);
        String question = LIZLLL.getQuestion();
        if (question != null && question.length() > 0 && question.length() <= 150) {
            Lpk LIZ6 = LIZ(2131362420);
            if (LIZ6 != null) {
                LIZ6.setText(question);
            }
            Lpk LIZ7 = LIZ(2131362420);
            if (LIZ7 != null) {
                LIZ7.post(new C2817AyT(question, this));
            }
            this.LJIIIIZZ = true;
        }
        ArrayList<User> invitedUsers = LIZLLL.getInvitedUsers();
        if (invitedUsers != null && (!invitedUsers.isEmpty())) {
            this.LJI = invitedUsers;
            this.LJII = this.LJFF.LIZ(invitedUsers);
        }
        String bannerText = LIZLLL.getBannerText();
        if (!(bannerText == null || bannerText.length() <= 0 || (LIZ = LIZ(2131362413)) == null)) {
            LIZ.setText(bannerText);
        }
        if (LIZLLL.getBannerShow()) {
            ConstraintLayout LIZ8 = LIZ(2131362414);
            if (LIZ8 != null) {
                LIZ8.setVisibility(0);
            }
        } else {
            String bannerText2 = LIZLLL.getBannerText();
            if (bannerText2 == null || bannerText2.length() == 0) {
                Keva repo = Keva.getRepo("question_repo");
                StringBuilder sb = new StringBuilder("ask_question_banner_message_show");
                IAccountUserService LJFF2 = 46i.LJFF();
                n.LIZIZ(LJFF2, "");
                sb.append(LJFF2.getCurUserId());
                if (repo.getBoolean(sb.toString(), true)) {
                    Keva repo2 = Keva.getRepo("question_repo");
                    StringBuilder sb2 = new StringBuilder("ask_question_banner_message_show");
                    IAccountUserService LJFF3 = 46i.LJFF();
                    n.LIZIZ(LJFF3, "");
                    sb2.append(LJFF3.getCurUserId());
                    repo2.storeBoolean(sb2.toString(), false);
                    ConstraintLayout LIZ9 = LIZ(2131362414);
                    if (LIZ9 != null) {
                        LIZ9.setVisibility(0);
                    }
                }
            }
            ConstraintLayout LIZ10 = LIZ(2131362414);
            if (LIZ10 != null) {
                LIZ10.setVisibility(8);
            }
        }
        C6474CbG cbG3 = (C6474CbG) LIZ(2131362419);
        if (cbG3 != null) {
            if (!LIZLLL.getRecordShow()) {
                i = 8;
            }
            cbG3.setVisibility(i);
        }
        if (LIZLLL.getAutoInvite()) {
            LIZ(2131362421).callOnClick();
        }
        LIZ(this.LJI);
        AssemViewModel.asyncSubscribe$default(LJIIIZ(), C2816AyS.LIZ, Cva.LIZ(), new 4YP(this), (Ls2) null, new 4YQ(this), 8, (Object) null);
        KeyboardUtils.LIZ(this, getView(), this);
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return 0HH.LIZ(layoutInflater, 2131560947, viewGroup, false);
    }

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