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

import X.0CC;
import X.0CD;
import X.0HB;
import X.0Q2;
import X.0Q9;
import X.1I0;
import X.1hK;
import X.2EE;
import X.2GO;
import X.2HZ;
import X.2I4;
import X.2N1;
import X.2N2;
import X.2Pr;
import X.2kf;
import X.2oJ;
import X.2oK;
import X.2oQ;
import X.2oW;
import X.2or;
import X.2te;
import X.2th;
import X.2zc;
import X.2zi;
import X.2zr;
import X.3Q9;
import X.3ae;
import X.3dU;
import X.3da;
import X.3di;
import X.3rX;
import X.41K;
import X.46i;
import X.4ZZ;
import X.4lv;
import X.7XP;
import X.7hc;
import X.7he;
import X.7xA;
import X.878;
import X.8RI;
import X.8ZQ;
import X.Bb8;
import X.C0295Crj;
import X.C1826Dfy;
import X.C3223E5z;
import X.C3658EMs;
import X.C3736EPs;
import X.C3926EXa;
import X.C4396EgK;
import X.C4397EgL;
import X.C4398EgM;
import X.C4399EgN;
import X.C4400EgO;
import X.C4405EgT;
import X.C4407EgV;
import X.C4408EgW;
import X.C4415Egd;
import X.C4420Egi;
import X.C4482Ehi;
import X.C4506Ei6;
import X.C4549Ein;
import X.C4559Eix;
import X.C4571Ej9;
import X.C4577EjF;
import X.C4580EjI;
import X.C4590EjS;
import X.C4602Eje;
import X.C4645EkL;
import X.C4649EkP;
import X.C4650EkQ;
import X.C4677Ekr;
import X.C4679Ekt;
import X.C4685Ekz;
import X.C4697ElB;
import X.C4820EnA;
import X.C4829EnJ;
import X.C5233Etp;
import X.C5340EvY;
import X.C5380EwC;
import X.CqM;
import X.E6J;
import X.EXZ;
import X.F4I;
import X.FjH;
import X.HeD;
import X.ISm;
import X.LeS;
import X.Lth;
import X.M12;
import X.Mjy;
import X.Mk2;
import X.Mk3;
import X.OQZ;
import X.P8Q;
import X.P8R;
import X.POl;
import X.PgU;
import X.PhE;
import X.PlI;
import X.Qw9;
import X.Rc9;
import X.SzB;
import X.TnV;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;
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 com.bytedance.covode.number.Covode;
import com.bytedance.tiktok.homepage.mainfragment.InterceptHomeViewPagerProtocol;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.awemeservice.AwemeService;
import com.ss.android.ugc.aweme.awemeservice.api.IAwemeService;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.friends.FriendsFeed;
import com.ss.android.ugc.aweme.feed.ui.BaseFeedListFragment;
import com.ss.android.ugc.aweme.friendstab.tab.StateOwner$fragmentLifeCycle$1;
import com.ss.android.ugc.aweme.friendstab.tab.TopFriendsTabScrollProfileStrategy;
import com.ss.android.ugc.aweme.homepage.api.data.HomePageDataViewModel;
import com.ss.android.ugc.aweme.main.TabChangeManager;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import kotlin.h.b.n;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.ThreadMode;

public final class SocialFriendsTabFragment extends BaseFeedListFragment<C4396EgK> implements 1I0, C4829EnJ, C5380EwC, C4679Ekt, 2oJ, 2oK, C4482Ehi, 3Q9, 2HZ, 2GO {
    public final FriendsFeedFragmentPanel LJIIL = new FriendsFeedFragmentPanel();
    public C4397EgL LJIILIIL;
    public C4590EjS LJIILJJIL;
    public final C0295Crj LJIILL = 7he.LIZ(7hc.NONE, new 2zc(this));
    public final Mjy LJIIZILJ = new Mjy();
    public String LJIJ = "";
    public SparseArray LJJII;

    static {
        Covode.recordClassIndex(81612);
    }

    public final String LJII() {
        return "SocialFriendsTabFragment";
    }

    public final void LJIILLIIL() {
    }

    public final void LJJIIJ() {
    }

    public final boolean LJJIJIIJI() {
        return true;
    }

    public final boolean aD_() {
        return true;
    }

    public final String az_() {
        return "MainTabPage";
    }

    public final void cu_() {
    }

    public final String getBtmPageCode() {
        return "b2863";
    }

    public final Map<Integer, Object> getSubscriberEventTypes() {
        HashMap hashMap = new HashMap();
        hashMap.put(281, new Rc9(SocialFriendsTabFragment.class, "onRemoveAwemesByUidEvent", 7XP.class, ThreadMode.MAIN, 0, false));
        hashMap.put(224, new Rc9(SocialFriendsTabFragment.class, "onVideoPublishEvent", C5233Etp.class, ThreadMode.POSTING, 0, false));
        return hashMap;
    }

    public final String LIZJ() {
        return Qw9.LIZ(this);
    }

    public final boolean LJIIL() {
        return this.LJIIL.LLJI();
    }

    public final void LJIILJJIL() {
        this.LJIIL.LLJJJJJIL();
    }

    public final 2EE LJIJI() {
        return this.LJIIL.LJLLL();
    }

    public final Map<String, String> aE_() {
        return 0Q9.LIZIZ(this);
    }

    private final boolean LJIJ() {
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        return egL.LIZ();
    }

    public final void LJI() {
        3di r1 = this.LJIIJ;
        n.LIZIZ(r1, "");
        r1.setRefreshing(true);
        LIZ(false);
    }

    public final /* synthetic */ C3926EXa LJIIIIZZ() {
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        return egL.LIZ;
    }

    public final String aB_() {
        return String.valueOf(hashCode());
    }

    public final void ct_() {
        LJIJ();
        if (8ZQ.LIZ()) {
            F4I.LIZ.LIZIZ();
        }
    }

    public final void onDestroy() {
        SocialFriendsTabFragment.super.onDestroy();
        EventBus.LIZ().LIZIZ(this);
        this.LJIIZILJ.dispose();
    }

    public final P8R LIZIZ() {
        P8Q p8q = P8R.LIZ;
        Context context = getContext();
        if (context == null) {
            n.LIZIZ();
        }
        n.LIZIZ(context, "");
        return p8q.LIZ(context, this);
    }

    public final boolean LJ() {
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        C4396EgK egK = egL.LIZ;
        if (egK.LJII == null || !egK.LJII.LIZJ) {
            return false;
        }
        return true;
    }

    public final boolean LJIIJ() {
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        egL.LIZ.LIZIZ = true;
        return LJIJ();
    }

    public final boolean LJIILIIL() {
        if ((this.LJIIL.LLILLIZIL() instanceof 2oW) || this.LJIIL.LIZ) {
            return true;
        }
        return false;
    }

    public final SparseArray<Lth> LJJIJ() {
        SparseArray<Lth> LJJIJ = SocialFriendsTabFragment.super.LJJIJ();
        n.LIZIZ(LJJIJ, "");
        LJJIJ.append(C4677Ekr.LIZJ, this.LJIIL);
        return LJJIJ;
    }

    public final boolean aC_() {
        0CD lifecycle = getLifecycle();
        n.LIZIZ(lifecycle, "");
        return lifecycle.LIZ().isAtLeast(0CC.RESUMED);
    }

    public final void onDestroyView() {
        super.onDestroyView();
        this.LJIIL.LJIJ();
        C4590EjS ejS = this.LJIILJJIL;
        if (ejS != null) {
            ejS.LIZ();
        }
        SparseArray sparseArray = this.LJJII;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final void LJIIJJI() {
        PgU LIZIZ = PgU.LIZ(C4420Egi.LIZ).LIZIZ(PhE.LIZIZ(PlI.LIZJ));
        n.LIZIZ(LIZIZ, "");
        LIZIZ.LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(new C4415Egd(this), 41K.LIZ);
    }

    public final void onResume() {
        Window window;
        1hK activity = getActivity();
        if (activity != null && n.LIZ(TabChangeManager.LJII.LIZ(activity).LIZ(), this)) {
            0Q2.LIZ(this);
        }
        this.LJIIL.LJIILJJIL = true;
        super.onResume();
        this.LJIIL.LJIILJJIL = false;
        if (getUserVisibleHint() && isResumed()) {
            7xA.LIZ(C4602Eje.FRIENDS_TAB);
            CqM.LIZ(new C4697ElB(1, this.LJIIL.LJLLLL(), this.LJIIL));
        }
        1hK activity2 = getActivity();
        if (activity2 != null && (window = activity2.getWindow()) != null) {
            window.setBackgroundDrawableResource(2131099677);
        }
    }

    public static final /* synthetic */ C4397EgL LIZ(SocialFriendsTabFragment socialFriendsTabFragment) {
        C4397EgL egL = socialFriendsTabFragment.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        return egL;
    }

    private final boolean LIZIZ(Aweme aweme) {
        if (aweme == null || aweme.getAwemeType() != 40) {
            return false;
        }
        return true;
    }

    public final OQZ LIZ(Context context) {
        M12.LIZ(context);
        C4649EkP ekP = new C4649EkP(context);
        ekP.LIZ(C4577EjF.LIZ, C4650EkQ.LIZ, new C4645EkL(this));
        ekP.LIZLLL(1);
        ekP.setUseScreenHeight(context.getResources().getDimensionPixelSize(2131165737));
        return ekP;
    }

    public final void LIZLLL(boolean z) {
        super.LIZLLL(z);
        CqM.LIZ(new C4697ElB(2, this.LJIIL.LJLLLL(), this.LJIIL));
        this.LJIIL.LJIILJJIL(z);
        8RI.LIZIZ(false);
    }

    public final int LIZ(Aweme aweme) {
        M12.LIZ(aweme);
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        Bb8 bb8 = egL.LIZ.LJII;
        if (bb8.mData == null || ((C4408EgW) bb8.mData).LIZJ == null) {
            return 0;
        }
        for (FriendsFeed next : ((C4408EgW) bb8.mData).LIZJ) {
            if (next.getAweme() != null && TextUtils.equals(aweme.getAid(), next.getAweme().getAid())) {
                return next.getSource();
            }
        }
        return 0;
    }

    public final void LIZIZ(Bundle bundle) {
        M12.LIZ(bundle);
        setUserVisibleHint(false);
        this.LJIIL.LIZLLL(false);
        String string = bundle.getString(C4820EnA.LIZIZ, "");
        if (n.LIZ(string, C4820EnA.LIZLLL)) {
            LIZLLL(true);
        } else if (n.LIZ(string, C4820EnA.LIZJ)) {
            2EE LJLLL = this.LJIIL.LJLLL();
            if (LJLLL != null) {
                LJLLL.LIZIZ(1);
            }
            2I4 r1 = HomePageDataViewModel.LJIILJJIL;
            1hK activity = getActivity();
            if (activity == null) {
                n.LIZIZ();
            }
            n.LIZIZ(activity, "");
            Aweme aweme = r1.LIZ(activity).LJIIJ;
            if (aweme != null) {
                3dU.LIZ.LIZ(aweme.getAid());
            }
            LJJIJIIJIL();
        }
    }

    public final void LIZ(FjH fjH) {
        this.LIZJ.LIZ((int) HeD.LIZIZ(getActivity(), 49.0f), (int) HeD.LIZIZ(getActivity(), 113.0f));
        this.LJIIJ = new 3da(this.LIZJ);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:28:0x008f, code lost:
        if (r0.LIZIZ() != false) goto L_0x0091;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZJ(boolean r6) {
        /*
            r5 = this;
            boolean r0 = r5.getUserVisibleHint()
            if (r0 == 0) goto L_0x000c
            boolean r0 = r5.aq_()
            if (r0 != 0) goto L_0x000d
        L_0x000c:
            return
        L_0x000d:
            r4 = 1
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r4)
            X.8RI.LIZIZ(r0)
            super.LIZJ(r6)
            X.ElB r2 = new X.ElB
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            com.ss.android.ugc.aweme.feed.model.Aweme r1 = r0.LJLLLL()
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            r2.<init>(r4, r1, r0)
            X.CqM.LIZ(r2)
            java.lang.String r3 = ""
            if (r6 == 0) goto L_0x006a
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            r0.LJJIIZ()
        L_0x0031:
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            X.2EE r0 = r0.LJLLL()
            if (r0 == 0) goto L_0x003c
            r0.LJJJJIZL()
        L_0x003c:
            r5.LJJIJIL()
            X.1hK r0 = r5.getActivity()
            if (r0 == 0) goto L_0x0051
            android.view.Window r1 = r0.getWindow()
            if (r1 == 0) goto L_0x0051
            r0 = 2131099677(0x7f06001d, float:1.7811714E38)
            r1.setBackgroundDrawableResource(r0)
        L_0x0051:
            com.ss.android.ugc.aweme.comment.services.CommentService r4 = com.ss.android.ugc.aweme.comment.CommentServiceImpl.LJI()
            android.content.Context r2 = r5.getContext()
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            com.ss.android.ugc.aweme.feed.model.Aweme r1 = r0.LJLLLL()
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            X.TnV r0 = r0.LLIFFJFJJ
            kotlin.h.b.n.LIZIZ(r0, r3)
            r4.LIZ(r2, r1, r0)
            goto L_0x000c
        L_0x006a:
            r2 = 0
            X.OQZ r1 = r5.LIZIZ(r2)
            X.EgL r0 = r5.LJIILIIL
            if (r0 != 0) goto L_0x0076
            kotlin.h.b.n.LIZ(r3)
        L_0x0076:
            boolean r0 = r0.LIZIZ()
            if (r0 != 0) goto L_0x0091
            if (r1 == 0) goto L_0x0094
            boolean r0 = r1.LJ()
            if (r0 != r4) goto L_0x0094
            X.EgL r0 = r5.LJIILIIL
            if (r0 != 0) goto L_0x008b
            kotlin.h.b.n.LIZ(r3)
        L_0x008b:
            boolean r0 = r0.LIZIZ()
            if (r0 == 0) goto L_0x0094
        L_0x0091:
            r5.LIZ((boolean) r2)
        L_0x0094:
            com.ss.android.ugc.aweme.friendstab.ui.FriendsFeedFragmentPanel r0 = r5.LJIIL
            r0.LLJJI()
            goto L_0x0031
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.friendstab.ui.SocialFriendsTabFragment.LIZJ(boolean):void");
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public final void onRemoveAwemesByUidEvent(7XP r9) {
        M12.LIZ(r9);
        Aweme aweme = r9.LIZ;
        if (aweme != null) {
            FriendsFeedFragmentPanel friendsFeedFragmentPanel = this.LJIIL;
            String authorUid = aweme.getAuthorUid();
            ArrayList arrayList = new ArrayList();
            if (friendsFeedFragmentPanel.LJJLIIIJJI != null && !878.LIZ(friendsFeedFragmentPanel.LJJLIIIJJI.LJI())) {
                List LJI = friendsFeedFragmentPanel.LJJLIIIJJI.LJI();
                for (int i = 0; i < LJI.size(); i++) {
                    Aweme aweme2 = (Aweme) LJI.get(i);
                    if (aweme2 != null && TextUtils.equals(authorUid, aweme2.getAuthorUid())) {
                        arrayList.add(aweme2);
                    }
                }
            }
            n.LIZIZ(arrayList, "");
            if (!arrayList.isEmpty()) {
                C4397EgL egL = this.LJIILIIL;
                if (egL == null) {
                    n.LIZ("");
                }
                int LIZ = egL.LIZ.LIZ((List<? extends Aweme>) arrayList);
                C4397EgL egL2 = this.LJIILIIL;
                if (egL2 == null) {
                    n.LIZ("");
                }
                List<String> LJFF = egL2.LIZ.LJFF();
                if (LJFF != null && LIZ == LJFF.size()) {
                    C4397EgL egL3 = this.LJIILIIL;
                    if (egL3 == null) {
                        n.LIZ("");
                    }
                    C4396EgK egK = egL3.LIZ;
                    if (egK.LJII != null) {
                        EXZ exz = egK.LJII;
                        n.LIZIZ(exz, "");
                        if (exz.isHasMore()) {
                            LJIJ();
                        }
                    }
                }
                friendsFeedFragmentPanel.LIZJ(aweme.getAid());
            }
        }
    }

    @ISm
    public final void onVideoPublishEvent(C5233Etp etp) {
        OQZ LIZIZ;
        M12.LIZ(etp);
        if (C4685Ekz.LIZ.LJIILIIL() && etp.LIZ == 15) {
            3rX.LIZIZ = true;
            if (etp.LIZIZ instanceof Aweme) {
                IAwemeService LIZIZ2 = AwemeService.LIZIZ();
                Object obj = etp.LIZIZ;
                Objects.requireNonNull(obj, "null cannot be cast to non-null type com.ss.android.ugc.aweme.feed.model.Aweme");
                Aweme LIZ = LIZIZ2.LIZ((Aweme) obj);
                if (!4lv.LIZ.LIZLLL(LIZ) && !LIZIZ(LIZ)) {
                    if (LIZ != null) {
                        C4397EgL egL = this.LJIILIIL;
                        if (egL == null) {
                            n.LIZ("");
                        }
                        egL.LIZ(LIZ);
                    }
                    OQZ LIZIZ3 = LIZIZ(true);
                    if (LIZIZ3 != null) {
                        LIZIZ3.LIZLLL();
                    }
                }
            } else if (etp.LIZIZ instanceof List) {
                Object obj2 = etp.LIZIZ;
                Objects.requireNonNull(obj2, "null cannot be cast to non-null type kotlin.collections.List<com.ss.android.ugc.aweme.feed.model.Aweme>");
                boolean z = false;
                for (Aweme LIZ2 : POl.LIZ((List) obj2)) {
                    Aweme LIZ3 = AwemeService.LIZIZ().LIZ(LIZ2);
                    if (!4lv.LIZ.LIZLLL(LIZ3) && !LIZIZ(LIZ3) && LIZ3 != null) {
                        C4397EgL egL2 = this.LJIILIIL;
                        if (egL2 == null) {
                            n.LIZ("");
                        }
                        egL2.LIZ(LIZ3);
                        z = true;
                    }
                }
                if (z && (LIZIZ = LIZIZ(true)) != null) {
                    LIZIZ.LIZLLL();
                }
            }
        }
    }

    public final void LIZ(Bundle bundle) {
        M12.LIZ(bundle);
        0Q2.LIZ(this);
        setUserVisibleHint(true);
        this.LJIIL.LIZLLL(true);
        if (isResumed()) {
            7xA.LIZ(C4602Eje.FRIENDS_TAB);
            C4571Ej9 ej9 = new C4571Ej9();
            ej9.LIZ = "homepage_friends";
            ej9.LJFF();
        }
        LIZJ(true);
    }

    public final boolean LIZ(boolean z) {
        if (!super.LIZ(z)) {
            return false;
        }
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        egL.LIZ(z, !LJIILL());
        if (8ZQ.LIZ()) {
            F4I.LIZ.LIZIZ();
        }
        return true;
    }

    public final void onViewCreated(View view, Bundle bundle) {
        Object obj;
        M12.LIZ(view);
        M12.LIZ(this);
        getLifecycle().LIZ(new StateOwner$fragmentLifeCycle$1());
        this.LJIILIIL = new C4397EgL();
        super.onViewCreated(view, bundle);
        LJJIJIL();
        if (this.LJIL == 0) {
            this.LJIL = 31;
            this.LJIJJLI = "homepage_friends";
        }
        FriendsFeedFragmentPanel friendsFeedFragmentPanel = this.LJIIL;
        TnV tnV = new TnV();
        tnV.setEventType(this.LJIJJLI);
        tnV.setPageType(this.LJIL + 0);
        friendsFeedFragmentPanel.LIZ(tnV);
        friendsFeedFragmentPanel.LIZ(view, bundle);
        friendsFeedFragmentPanel.LIZ(this);
        friendsFeedFragmentPanel.LIZIZ = this;
        friendsFeedFragmentPanel.LIZ(this);
        friendsFeedFragmentPanel.LJLJJL = this;
        friendsFeedFragmentPanel.LIZLLL(true);
        this.LJIIIZ.a_(this.LJIIL);
        C4397EgL egL = this.LJIILIIL;
        if (egL == null) {
            n.LIZ("");
        }
        egL.LIZ.LIZ = this.LJIIL;
        this.LJIIIZ.LIZ((C4506Ei6) this.LJIIL);
        C4397EgL egL2 = this.LJIILIIL;
        if (egL2 == null) {
            n.LIZ("");
        }
        egL2.LIZ.LIZ(new C4407EgV());
        try {
            C4397EgL egL3 = this.LJIILIIL;
            if (egL3 == null) {
                n.LIZ("");
            }
            C3223E5z LIZLLL = C1826Dfy.LIZ.LIZLLL();
            String str = this.LJIJJLI;
            n.LIZIZ(str, "");
            1hK requireActivity = requireActivity();
            n.LIZIZ(requireActivity, "");
            E6J LIZIZ = LIZLLL.LIZIZ(str, requireActivity);
            M12.LIZ(LIZIZ);
            C4396EgK egK = egL3.LIZ;
            M12.LIZ(LIZIZ);
            C4407EgV egV = egK.LJII;
            if (egV != null) {
                egV.LJFF = LIZIZ;
            }
            obj = 2Pr.LIZ;
            2te.constructor-impl(obj);
        } catch (Throwable th) {
            obj = 2th.LIZ(th);
            2te.constructor-impl(obj);
        }
        Throwable r0 = 2te.exceptionOrNull-impl(obj);
        if (r0 != null) {
            2kf.LIZ("TTRecUser FriendsFeedPresenter setRecUserBigCardController fail ".concat(String.valueOf(r0)));
        }
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        if (LJFF.isLogin()) {
            C4397EgL egL4 = this.LJIILIIL;
            if (egL4 == null) {
                n.LIZ("");
            }
            C4400EgO egO = C4398EgM.LJ;
            int type = C4399EgN.REFRESH.getType();
            2N1 LIZ = 2N2.LIZ("feed");
            n.LIZIZ(LIZ, "");
            String LIZIZ2 = LIZ.LIZIZ();
            n.LIZIZ(LIZIZ2, "");
            C4398EgM LIZ2 = egO.LIZ(1, type, LIZIZ2);
            LIZ2.LIZIZ = null;
            LIZ2.LIZJ = null;
            LIZ2.LIZLLL = null;
            C4405EgT LIZ3 = LIZ2.LIZ();
            egL4.LIZ.LIZ(new Object[]{1, LIZ3});
        } else {
            this.LJIIL.LJFF();
        }
        if (C4685Ekz.LIZ.LJIILJJIL()) {
            View findViewById = view.findViewById(2131365168);
            if (findViewById != null) {
                C3736EPs.LIZ(findViewById);
            }
        } else {
            4ZZ findViewById2 = view.findViewById(2131366426);
            if (findViewById2 != null) {
                findViewById2.setOnClickListener(new 2zr(this));
            }
            4ZZ findViewById3 = view.findViewById(2131366433);
            if (findViewById3 != null) {
                findViewById3.setOnClickListener(new 2zi(this));
            }
            View findViewById4 = view.findViewById(2131367349);
            if (findViewById4 != null) {
                3ae r7 = new 3ae();
                r7.LIZIZ = 2130968619;
                Resources system = Resources.getSystem();
                n.LIZIZ(system, "");
                r7.LIZJ = Float.valueOf(TypedValue.applyDimension(1, 2.0f, system.getDisplayMetrics()));
                Context context = view.getContext();
                n.LIZIZ(context, "");
                findViewById4.setBackground(r7.LIZ(context));
                findViewById4.setOnClickListener(new C5340EvY(this, view));
            }
            View findViewById5 = view.findViewById(2131365168);
            if (findViewById5 != null) {
                findViewById5.requestApplyInsets();
            }
        }
        if (this.LJIILJJIL == null && 8ZQ.LIZ()) {
            this.LJIILJJIL = C4580EjI.LIZ(getActivity(), this.LIZIZ);
        }
        8RI.LIZIZ(true);
        2oQ LIZ4 = 2oQ.LIZ();
        n.LIZIZ(LIZ4, "");
        LIZ4.LIZJ(false);
        EventBus.LIZ(EventBus.LIZ(), this);
        this.LJIIL.LIZ(new C4549Ein(this));
        if (C4685Ekz.LIZ.LJIILJJIL()) {
            C3658EMs LIZ5 = SzB.LIZ(this);
            1hK requireActivity2 = requireActivity();
            n.LIZIZ(requireActivity2, "");
            TopFriendsTabScrollProfileStrategy topFriendsTabScrollProfileStrategy = new TopFriendsTabScrollProfileStrategy(requireActivity2);
            C4559Eix.LIZ(LIZ5, InterceptHomeViewPagerProtocol.class, LeS.LIZJ(new InterceptHomeViewPagerProtocol[]{topFriendsTabScrollProfileStrategy}));
            0CD lifecycle = getLifecycle();
            if (lifecycle != null) {
                lifecycle.LIZ(new SocialFriendsTabFragment$onViewCreated$$inlined$registerProtocol$1(LIZ5, topFriendsTabScrollProfileStrategy));
            }
        }
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        2or.LIZ("homepage_friends");
        Context context = getContext();
        Activity activity = null;
        if (context != null) {
            while (true) {
                if (!(context instanceof Activity)) {
                    if (context instanceof ContextWrapper) {
                        context = ((ContextWrapper) context).getBaseContext();
                        if (context == null) {
                            break;
                        }
                    } else {
                        break;
                    }
                } else {
                    activity = (Activity) context;
                    break;
                }
            }
        }
        return 0HB.LIZ(activity, 2131559818);
    }
}
