package com.ss.android.ugc.aweme.feed.panel;

import X.070;
import X.07U;
import X.0Gp;
import X.0HH;
import X.1hK;
import X.5Fn;
import X.6zd;
import X.7QN;
import X.7RI;
import X.7ZQ;
import X.7dO;
import X.7qE;
import X.878;
import X.8B3;
import X.8Bc;
import X.8Dl;
import X.8Fc;
import X.8Qp;
import X.8RG;
import X.8eL;
import X.8qY;
import X.95y;
import X.9EH;
import X.9XD;
import X.9Y3;
import X.9YP;
import X.9mr;
import X.AnonymousClass2EE;
import X.AnonymousClass2GO;
import X.AnonymousClass2GY;
import X.AnonymousClass2HI;
import X.AnonymousClass2HJ;
import X.AnonymousClass2HM;
import X.AnonymousClass2HX;
import X.AnonymousClass2IR;
import X.AnonymousClass2JO;
import X.AnonymousClass2K7;
import X.AnonymousClass2KS;
import X.AnonymousClass2LA;
import X.AnonymousClass2LD;
import X.AnonymousClass2MI;
import X.AnonymousClass2N2;
import X.AnonymousClass2N3;
import X.AnonymousClass2V7;
import X.AnonymousClass2YM;
import X.AnonymousClass2aZ;
import X.AnonymousClass3BB;
import X.AnonymousClass4RT;
import X.B71;
import X.BbC;
import X.C00392Fp;
import X.C00652Gp;
import X.C00822Hg;
import X.C00882Hm;
import X.C01082Ig;
import X.C01172Ip;
import X.C01272Iz;
import X.C01492Jv;
import X.C01612Kh;
import X.C04702We;
import X.C05502Zg;
import X.C05532Zj;
import X.C06762eC;
import X.C06772eD;
import X.C09942jK;
import X.C10002jQ;
import X.C10012jR;
import X.C10772kf;
import X.C11722mC;
import X.C11862mQ;
import X.C12422nK;
import X.C12982oE;
import X.C13232od;
import X.C13282oi;
import X.C224738l;
import X.C29173Yf;
import X.C30053af;
import X.C31373cn;
import X.C31473cx;
import X.C31483cy;
import X.C31543d4;
import X.C31553d5;
import X.C31563d6;
import X.C31573d7;
import X.C31603dA;
import X.C31613dB;
import X.C31623dC;
import X.C31633dD;
import X.C31643dE;
import X.C31653dF;
import X.C31663dG;
import X.C31673dH;
import X.C31683dI;
import X.C31693dJ;
import X.C31713dL;
import X.C31723dM;
import X.C31733dN;
import X.C31753dP;
import X.C31763dQ;
import X.C31773dR;
import X.C31783dS;
import X.C31823dW;
import X.C31843dY;
import X.C31853dZ;
import X.C31863da;
import X.C31873db;
import X.C31883dc;
import X.C31893dd;
import X.C31913df;
import X.C31923dg;
import X.C31933dh;
import X.C31973dl;
import X.C31983dm;
import X.C32003do;
import X.C32013dp;
import X.C32043ds;
import X.C32053dt;
import X.C32073dv;
import X.C32153e3;
import X.C32373eP;
import X.C32533ef;
import X.C32543eg;
import X.C32573ej;
import X.C33843gm;
import X.C34453hl;
import X.C39873qV;
import X.C40833s3;
import X.C481749h;
import X.C55034Zr;
import X.C55484aa;
import X.C55754b1;
import X.C59694hN;
import X.C62534lx;
import X.C69044wS;
import X.Cgr;
import X.Cl7;
import X.CqM;
import X.DcP;
import X.Dfy;
import X.DzH;
import X.ESC;
import X.Ecz;
import X.EgP;
import X.Ej4;
import X.EjI;
import X.Ekz;
import X.Eq7;
import X.Etp;
import X.Euv;
import X.Ev8;
import X.F6U;
import X.F9f;
import X.FLK;
import X.ISm;
import X.JMC;
import X.LDj;
import X.LFp;
import X.M12;
import X.OQZ;
import X.Otb;
import X.PbK;
import X.RQw;
import X.RR2;
import X.RR4;
import X.Rc9;
import X.Spm;
import X.T3s;
import android.app.Activity;
import android.content.Context;
import android.database.DataSetObserver;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.LiveData;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.ugc.aweme.commercialize.intelligence.feed.AdReRankServiceManager;
import com.bytedance.keva.Keva;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.ugc.aweme.UgAllServiceImpl;
import com.ss.android.ugc.aweme.comment.CommentServiceImpl;
import com.ss.android.ugc.aweme.commercialize.feed.timegap.AdShowTimeGapManager;
import com.ss.android.ugc.aweme.compliance.api.a;
import com.ss.android.ugc.aweme.experiment.FeedRefreshViewModel;
import com.ss.android.ugc.aweme.feed.experiment.SmartNewClassifyConfig;
import com.ss.android.ugc.aweme.feed.experiment.SmartNewRegressionConfig;
import com.ss.android.ugc.aweme.feed.helper.RecFeedShareComponentController;
import com.ss.android.ugc.aweme.feed.interest.viewmodel.InterestViewModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeRawAd;
import com.ss.android.ugc.aweme.feed.model.AwemeStatisticsBackup;
import com.ss.android.ugc.aweme.feed.model.BaseFeedPageParams;
import com.ss.android.ugc.aweme.feed.model.Video;
import com.ss.android.ugc.aweme.feed.model.VideoUrlModel;
import com.ss.android.ugc.aweme.homepage.api.interaction.ScrollSwitchStateManager;
import com.ss.android.ugc.aweme.homepage.api.msadapt.IMSAdaptionService;
import com.ss.android.ugc.aweme.homepage.msadapt.MSAdaptionService;
import com.ss.android.ugc.aweme.main.TabChangeManager;
import com.ss.android.ugc.aweme.main.page.AwemeChangeCallBack;
import com.ss.android.ugc.aweme.ml.api.SmartFeedLoadMoreService;
import com.ss.android.ugc.aweme.ml.infra.ISmartClassifyService;
import com.ss.android.ugc.aweme.ml.infra.ISmartRegressCalculateService;
import com.ss.android.ugc.aweme.ml.infra.SmartClassifySceneConfig;
import com.ss.android.ugc.aweme.ml.infra.SmartRegressionSceneConfig;
import com.ss.android.ugc.aweme.services.BusinessComponentServiceUtils;
import com.ss.android.ugc.aweme.watch.history.WatchHistoryService;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.h.b.n;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONException;
import org.json.JSONObject;

public class FullFeedFragmentPanel extends BaseListFragmentPanel implements BbC<Aweme>, AnonymousClass2HJ, C31553d5, Eq7, 8RG, AnonymousClass2GO {
    public static boolean LJ = true;
    public static boolean LJFF;
    public ViewGroup LIZ;
    public ViewStub LIZIZ;
    public C40833s3 LIZJ;
    public boolean LIZLLL;
    public int LJI;
    public boolean LJII = true;
    public int LJIIIIZZ = -1;
    public Otb LJIIIZ;
    public int LJIIJ = 0;
    public C30053af LJIIJJI;
    public DataSetObserver LJIIL = new DataSetObserver() {
        static {
            Covode.recordClassIndex(79177);
        }

        public final void onChanged() {
            FullFeedFragmentPanel.this.LJI++;
            UgAllServiceImpl.LIZJ();
        }
    };
    public C32543eg LJIILIIL = new C32533ef(this);
    public boolean LJIILJJIL = false;
    public boolean LJIILL = false;
    public int LJIILLIIL = -1;
    public C32153e3 LJIIZILJ = new C31843dY(this);
    public String LJIJ = null;
    public int LJIJI = 0;
    public boolean LJIJJ = false;
    public C29173Yf LJIJJLI;
    public boolean LJIL;
    public Handler LJJ = new Handler(Looper.getMainLooper());
    public String LJJI = "";
    public C31933dh LJJIFFI;
    public AtomicBoolean LJJII = new AtomicBoolean(false);
    public boolean LJJIII = false;
    public boolean LJJIIJ = false;
    public boolean LJJIIJZLJL = true;
    public final List<07U<Aweme, Integer>> LJJIIZ = new ArrayList();
    public boolean LJJIIZI = false;
    public boolean LJJIJ = false;
    public int LJJIJIIJI = 0;
    public boolean LJJIJIIJIL = false;

    public final void LIZJ(int i) {
    }

    public void LJIIJ() {
    }

    public void LJIIJJI() {
    }

    public void LJIIL() {
    }

    public void LJIILJJIL() {
    }

    public boolean LJIILL() {
        return true;
    }

    public void LJIL() {
    }

    public final boolean LJJIJIIJIL() {
        return false;
    }

    public Map<Integer, Object> getSubscriberEventTypes() {
        Map<Integer, Object> subscriberEventTypes = super.getSubscriberEventTypes();
        subscriberEventTypes.put(305, new Rc9(FullFeedFragmentPanel.class, "onDeleteAwemeEvent", C31543d4.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(79, new Rc9(FullFeedFragmentPanel.class, "onDislikeAwemeEvent", C34453hl.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(306, new Rc9(FullFeedFragmentPanel.class, "onVideoCleanModeEvent", C31733dN.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(307, new Rc9(FullFeedFragmentPanel.class, "onInterceptedResumePlayOnResume", C31913df.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(308, new Rc9(FullFeedFragmentPanel.class, "onVPAOptOutEvent", C32003do.class, ThreadMode.MAIN, 0, false));
        subscriberEventTypes.put(10, new Rc9(FullFeedFragmentPanel.class, "onVideoPlayerEvent", 7QN.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(309, new Rc9(FullFeedFragmentPanel.class, "OnDeleteTopViewAwemeEvent", C31603dA.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(209, new Rc9(FullFeedFragmentPanel.class, "onRefreshEvent", EgP.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(241, new Rc9(FullFeedFragmentPanel.class, "onCommentDialogEvent", 9mr.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(310, new Rc9(FullFeedFragmentPanel.class, "deleteRecUserFeedAndScrollNextFeed", C32013dp.class, ThreadMode.MAIN, 0, false));
        subscriberEventTypes.put(311, new Rc9(FullFeedFragmentPanel.class, "onBackupUpdateEvent", C06762eC.class, ThreadMode.POSTING, 0, false));
        return subscriberEventTypes;
    }

    public final ViewGroup LJJJIL() {
        return this.LIZ;
    }

    public final void LIZ(Bundle bundle) {
        super.LIZ(bundle);
        if (this.LJIJJLI == null) {
            this.LJIJJLI = new C29173Yf();
        }
        1hK r2 = this.LLL;
        if (r2 instanceof 1hK) {
            1hK r22 = r2;
            ((LiveData) FeedRefreshViewModel.LIZIZ.LIZ(r22).LIZ.getValue()).observe(r22, new C31693dJ(this));
        }
    }

    /* JADX WARNING: type inference failed for: r0v8, types: [X.375, X.3di] */
    /* JADX WARNING: type inference failed for: r0v13, types: [X.375, X.3di] */
    public void LIZ(View view, Bundle bundle) {
        boolean z;
        super.LIZ(view, bundle);
        this.LIZ = (ViewGroup) view.findViewById(2131364826);
        this.LIZIZ = (ViewStub) view.findViewById(2131362242);
        this.LIZ.setOnClickListener(C31983dm.LIZ);
        1hK r2 = this.LLL;
        if (r2 instanceof 1hK) {
            1hK r1 = r2;
            AwemeChangeCallBack.LIZ(r1, r1, new C31773dR(this));
        }
        this.LLFFF = new C31863da(this.LJJLIIIJ);
        this.LJJJLIIL.LIZ(new C13232od(this, r2));
        0Gp.LIZ(new C32053dt(this));
        this.LJJLIIIJJI.LIZ(this.LJIIL);
        this.LJJJJZI.LIZLLL();
        this.LJJJJZI.LIZ(this.LJJJLIIL, this.LJJLIIIJ);
        this.LJJJJZI.setLabel("main_feed");
        if ("homepage_hot".equals(this.LLIFFJFJJ.getEventType()) && this.LLIFFJFJJ.getPageType() == 0 && a.LJFF().LIZIZ() && a.LJFF().LIZ() != null) {
            LJJI();
        }
        T3s t3s = this.LJJJLIIL;
        if ("homepage_hot".equals(this.LLIFFJFJJ.getEventType()) || (C01612Kh.LIZ.LIZ() && "homepage_follow".equals(this.LLIFFJFJJ.getEventType()))) {
            z = true;
        } else {
            z = false;
        }
        t3s.LJJIIZ = z;
        1hK LJJIFFI2 = LJJIFFI();
        if (LJJIFFI2 == null) {
            C10772kf.LIZ((Exception) new RuntimeException("bindLiveData fail"));
        } else if (LLILIL()) {
            InterestViewModel.LIZIZ.LIZ(LJJIFFI2).LIZ.observe(LJJIFFI2, new C31753dP(this));
            LLJJJJLIIL().LIZ((PbK) new C00882Hm(this));
        }
    }

    public void LIZ(List<Aweme> list, boolean z) {
        boolean z2;
        Aweme LIZIZ2;
        Activity activity;
        if (LLJJIJIL()) {
            this.LJIIIIZZ = 0;
            if (this.LLIIIZ && (activity = this.LLL) != null) {
                try {
                    CommentServiceImpl.LJI().LIZJ(activity);
                } catch (Throwable th) {
                    C10772kf.LIZ(th);
                }
            }
            if (!this.LJJIIJZLJL) {
                WatchHistoryService.LJ().LIZ(LJJIFFI(), b_(true));
            }
            LJJJLIIL();
            this.LLIIZ = true;
            AnonymousClass2EE LJLLL = LJLLL();
            if ((LJLLL instanceof C12982oE) && LJLLLL() != null && !LJLLLL().isAd()) {
                AnonymousClass2V7.LJJIIZ.LIZ(((C12982oE) LJLLL).LJLILLLLZI());
            } else if ((LJLLL instanceof C00392Fp) && LJLLLL() != null && !LJLLLL().isAd()) {
                AnonymousClass2V7.LJJIIZ.LIZ(((C00392Fp) LJLLL).LJJIJIIJIL());
            }
            AnonymousClass2V7.LJJIIZ.LJI();
            AnonymousClass2MI.LIZ.LIZ();
            OQZ LJIILLIIL2 = LJIILLIIL(false);
            if (LJIILLIIL2 != null) {
                LJIILLIIL2.setVisibility(8);
            } else {
                LJIIL();
            }
            LIZLLL(list, false);
            if (this.LJJIIJZLJL) {
                this.LJJIIJZLJL = false;
                if (MSAdaptionService.LIZJ().LIZ(this.LLL) && LLILIL() && (LIZIZ2 = MSAdaptionService.LIZJ().LIZIZ()) != null) {
                    list.add(0, LIZIZ2);
                }
            }
            if (this.LJJLIIIJJI == null || this.LJJLIIIJJI.LIZIZ() != 1 || !LFp.LJJIII(this.LJJLIIIJJI.LJ(0))) {
                z2 = false;
            } else {
                list.add(0, this.LJJLIIIJJI.LJ(0));
                this.LJJJJZI.LIZLLL();
                z2 = true;
            }
            this.LLFFF.setRefreshing(false);
            if (!(this.LJJLIIIJJI == null || this.LJJJLIIL == null || z2)) {
                LDj.LJ().LIZJ(this.LJJLIIIJJI.LJ(this.LJJJLIIL.getCurrentItem()));
            }
            if (!this.LJIILL) {
                if (5Fn.LIZ(list)) {
                    LJIJJLI();
                } else {
                    this.LJIILL = true;
                    if (LJIILLIIL2 != null) {
                        LJIILLIIL2.LIZLLL();
                    }
                }
            } else if (LJIILLIIL2 != null) {
                LJIILLIIL2.LIZLLL();
            }
            if (this.LLILIL > 0) {
                LJIIJ(this.LLILIL + 1);
            }
            if (this.LLII != null) {
                this.LLII.LIZ((String) null, System.currentTimeMillis(), true);
            }
            if (!C31683dI.LIZ()) {
                this.LJJLIIIJL = 0;
                if (this.LJJJLIIL != null) {
                    this.LJJJLIIL.setCurrentItem(this.LJJLIIIJL);
                }
            }
            if (!this.LLIIIILZ && !z2) {
                this.LLIIIILZ = true;
            }
            if (TextUtils.equals(this.LLIFFJFJJ.getEventType(), "homepage_hot")) {
                if (AdShowTimeGapManager.LJJI.LIZ()) {
                    AdShowTimeGapManager.LJIILJJIL = false;
                    if (AdShowTimeGapManager.LJIILL) {
                        AdShowTimeGapManager.LJFF.clear();
                        AdShowTimeGapManager.LJIIIIZZ = -1;
                        AdShowTimeGapManager.LJIIIZ = -1;
                        AdShowTimeGapManager.LJIIL = -1;
                        AdShowTimeGapManager.LIZLLL = -1;
                    }
                    if (!AdShowTimeGapManager.LJIILL) {
                        AdShowTimeGapManager.LJIILL = true;
                    }
                }
                LLJJJJLIIL().LIZIZ((List<? extends Aweme>) list);
            }
            this.LJJLIIIJJI.LIZJ = z;
            C11722mC r7 = this.LJJLIIIJJI;
            C59694hN LJFF2 = r7.LJFF();
            for (Map.Entry value : new HashMap(LJFF2.LIZ).entrySet()) {
                value.getValue();
            }
            LJFF2.LIZ.clear();
            r7.LIZ((List<? extends Aweme>) list);
            if (C31683dI.LIZ()) {
                this.LJJLIIIJL = 0;
                if (this.LJJJLIIL != null) {
                    this.LJJJLIIL.setCurrentItem(this.LJJLIIIJL);
                }
            }
            if (this.LLJZIJLIL) {
                LLJJJJJIL();
            }
            C31923dg.LIZ.LIZ(list);
            LIZ("", true);
            CqM.LIZ(new F9f());
            LJJJJLI();
            if (!z2) {
                UgAllServiceImpl.LIZJ().LIZIZ(this.LLL);
            }
            if (9Y3.LIZ(9Y3.LIZ(), true, "is_preload_process_data", false)) {
                LLFZ().LIZ(list);
            }
            this.LLIIZ = false;
            if (LJII()) {
                this.LLJLLL.LJ();
            } else if (LJJJ()) {
                this.LLJLLL.LJ();
            }
            this.LJIILLIIL = -1;
            LIZJ(true);
            if (AnonymousClass2JO.LIZ.LIZ() && !AnonymousClass2HX.LIZ.LIZIZ && !this.LJJIII) {
                C01272Iz.LIZ.LIZ.postAtFrontOfQueue(new C00822Hg(this));
                this.LJJIII = true;
            }
            if (Spm.LJI("system_launch_startup_end_to_feed") && Spm.LJFF("system_launch_feed_to_first_frame")) {
                Spm.LIZ("system_launch_startup_end_to_feed", (Map) null);
                Spm.LJ("system_launch_feed_to_first_frame");
            }
        }
    }

    public final /* synthetic */ void LIZ(Aweme aweme) {
        String aid = aweme.getAid();
        if (!TextUtils.isEmpty(aid)) {
            if (this.LLJL != null) {
                8Bc r1 = this.LLJL;
                if (r1.LIZ != null) {
                    r1.LIZ.clearFlag();
                }
            }
            LJIIJ(aid);
        }
    }

    public final /* synthetic */ void LIZ(boolean z, int i) {
        if (this.LJLJJI != null) {
            SmartFeedLoadMoreService.getDebug();
            if (z) {
                LIZ((Runnable) new C31613dB(this), (long) i);
            }
        }
    }

    public final void LIZ(Exception exc) {
        if (LLJJIJIL()) {
            this.LLFFF.setRefreshing(false);
            if (this.LJJLIIIJJI.LIZIZ() == 0) {
                OQZ LJIILLIIL2 = LJIILLIIL(true);
                if (LJIILLIIL2 != null) {
                    LJIILLIIL2.setVisibility(0);
                    LJIILLIIL2.LJII();
                    return;
                }
                LJIIJ();
                return;
            }
            AnonymousClass3BB r1 = new AnonymousClass3BB(this.LLL);
            r1.LIZIZ(2131826710);
            r1.LIZIZ();
        }
    }

    public final void LIZ(List<? extends Aweme> list, int i, int i2, C31883dc r6) {
        C31553d5 bt_ = bt_();
        if (bt_ instanceof C31553d5) {
            bt_.LIZ(list, i, i2, new C31673dH(this, r6));
        } else {
            r6.LIZ("unsupported", (Exception) null);
        }
    }

    private boolean LJII() {
        if (this.LJIILLIIL == 0) {
            return true;
        }
        return false;
    }

    public final void LJIILLIIL() {
        this.LJJLIIIJ.setViewPager(this.LJJJLIIL);
    }

    public final /* synthetic */ boolean LJJIZ() {
        LJIL();
        LJJ();
        return false;
    }

    public final void LLJJJ() {
        boolean LLILIL = LLILIL();
    }

    static {
        Covode.recordClassIndex(79176);
    }

    private boolean LJJJ() {
        int i = this.LJIILLIIL;
        if (i == 1 || i == 2 || i == 3) {
            return true;
        }
        return false;
    }

    private void LJJJJLI() {
        if (LL()) {
            AnonymousClass2N2.LIZ(this.LLIL).LIZJ();
        }
    }

    public final void LJIJJLI() {
        OQZ LJIILLIIL2 = LJIILLIIL(true);
        if (LJIILLIIL2 != null) {
            LJIILLIIL2.LJI();
        } else {
            LJIIJ();
        }
    }

    public final 1hK LJJIFFI() {
        if (this.LLL instanceof 1hK) {
            return this.LLL;
        }
        return null;
    }

    public final void LJJII() {
        LIZ(new Etp(37));
    }

    public final void LJJIIJZLJL() {
        LIZ(new Etp(28));
    }

    public final void LJJIIZ() {
        if (!LJIIIIZZ()) {
            super.LJJIIZ();
        }
    }

    public final void LJJIIZI() {
        if (this.LLII != null) {
            this.LLII.LJJIJIIJI();
        }
    }

    public final /* synthetic */ void LJJIJIL() {
        LIZ(this.LLL, LJLLLL(), 0, 1200);
    }

    public final void bw_() {
        if (LLJJIJIL()) {
            this.LJJJJZI.LIZ();
        }
    }

    public final void cn_() {
        if (LLJJIJIL()) {
            boolean z = this.LIZLLL;
        }
    }

    private int LJJJJLL() {
        int i;
        int i2 = C31783dS.LIZ;
        if (i2 > 0) {
            i = i2;
        } else {
            i = 3;
            i2 = 3;
        }
        if ("homepage_hot".equals(this.LLIFFJFJJ.getEventType())) {
            return i2;
        }
        return i;
    }

    public void LJFF() {
        if (LLJJIJIL()) {
            LJJJLIIL();
            this.LLFFF.setRefreshing(false);
            if (!this.LJIILL) {
                LJIJJLI();
            }
        }
    }

    public final void LLILZLL() {
        if (this.LLL == null || !LLLIIII()) {
            return;
        }
        if (LIZJ() || LIZLLL()) {
            super.LLILZLL();
        }
    }

    private boolean LIZLLL() {
        Activity activity = this.LLL;
        if (!(activity instanceof C481749h) || !((C481749h) activity).isUnderSecondTab() || !Ekz.LIZ.LJIIL() || Ekz.LIZ.LJIILJJIL()) {
            return false;
        }
        return true;
    }

    private void LJJJJZ() {
        if (this.LJJLIIIJJI.LIZIZ() == LJJJJLL()) {
            CqM.LIZ(new C32073dv("from_full_recommend"));
        }
        this.LJJJLIIL.post(new C31823dW(this));
    }

    private void LJJJJZI() {
        MethodCollector.i(8274);
        ViewStub viewStub = this.LIZIZ;
        if (viewStub != null) {
            viewStub.inflate();
            this.LIZIZ = null;
            ViewGroup viewGroup = (ViewGroup) this.LIZ.findViewById(2131362241);
            if (viewGroup != null) {
                this.LIZJ = new C40833s3(viewGroup);
            }
        }
        MethodCollector.o(8274);
    }

    private void LJJJLIIL() {
        this.LJIL = false;
        C40833s3 r0 = this.LIZJ;
        if (r0 != null && r0.LIZIZ && "homepage_hot".equals(this.LLIFFJFJJ.getEventType()) && this.LLIFFJFJJ.getPageType() == 0) {
            this.LIZJ.LIZIZ();
            LLJJJJJIL();
        }
    }

    public boolean LIZJ() {
        Activity activity = this.LLL;
        if (!(activity instanceof C481749h) || !((C481749h) activity).isUnderMainTab()) {
            return false;
        }
        return true;
    }

    public void LJIJ() {
        this.LJJLIIIJJI.LIZIZ(this.LJIIL);
        LDj.LJIIIZ().LIZJ();
        AdReRankServiceManager.LIZ().LIZIZ(7dO.FEED);
        super.LJIJ();
        7ZQ.LJ.LIZ().LJ(this.LJJLIIIJLLLLLLLZ);
        if (LLILIL()) {
            AnonymousClass2V7.LJJIFFI.dispose();
        }
    }

    public final void LJJ() {
        Aweme LJ2;
        if (this.LJJJLIIL != null && this.LJJLIIIJJI != null && (LJ2 = this.LJJLIIIJJI.LJ(this.LJJJLIIL.getCurrentItem())) != null && LJ2.getUserDigg() == 1) {
            LIZ(this.LLL, LJ2);
        }
    }

    public final void LJJI() {
        if (this.LLJJJ != 4) {
            this.LJIL = true;
            LJJJLIIL();
            return;
        }
        if (this.LIZJ == null) {
            LJJJJZI();
        }
        if (this.LIZJ != null) {
            LJLJL();
            LLIIJI();
            this.LIZJ.LIZ();
            this.LJIL = false;
            LLJJJJJIL();
        }
    }

    public void LJJIJL() {
        String aid;
        super.LJJIJL();
        Aweme LJLLLL = LJLLLL();
        C29173Yf r3 = this.LJIJJLI;
        if (r3 != null) {
            boolean z = true;
            if (LJLLLL == null || LJLLLL.getAuthor() == null || !(LJLLLL.getAuthor().getFollowStatus() == 1 || LJLLLL.getAuthor().getFollowStatus() == 2)) {
                z = false;
            }
            r3.LIZIZ = z;
        }
        if (LJLLLL == null) {
            aid = "";
        } else {
            aid = LJLLLL.getAid();
        }
        6zd.LIZ = aid;
        this.LJJIJIIJI = this.LJJLIIIJL;
    }

    public final void LJJIL() {
        super.LJJIL();
        C40833s3 r0 = this.LIZJ;
        if (r0 != null && r0.LIZIZ) {
            this.LIZJ.LJ();
        }
        LIZ(this.LLL, LJLLLL(), 0, 0);
        if (LLILIL()) {
            AnonymousClass2V7.LJJIIZ.LJ();
        }
    }

    public final void LIZIZ() {
        boolean z;
        if (LLJJIJIL()) {
            C11722mC r3 = this.LJJLIIIJJI;
            if (r3 == null || r3.LIZIZ() != 1 || !LFp.LJJIII(r3.LJ(0))) {
                z = false;
            } else {
                z = true;
            }
            C40833s3 r0 = this.LIZJ;
            if (r0 != null && r0.LIZIZ) {
                this.LLFFF.setRefreshing(true);
            } else if (z) {
                cn_();
            } else if (!this.LJIILL) {
                this.LLFFF.setRefreshing(false);
                if (!((Boolean) 7qE.LIZLLL.getValue()).booleanValue() || !8B3.LJIILIIL.LJIILJJIL() || !AnonymousClass2N3.LIZ("optimize_feedloading")) {
                    OQZ LJIILLIIL2 = LJIILLIIL(true);
                    if (LJIILLIIL2 != null) {
                        LJIILLIIL2.setVisibility(0);
                        LJIILLIIL2.LJFF();
                        return;
                    }
                    LJIIJJI();
                }
            } else if (this.LJJIJIIJIL) {
                this.LJJIJIIJIL = false;
            } else {
                this.LLFFF.setRefreshing(true);
            }
        }
    }

    public final boolean LJIIIIZZ() {
        C32373eP r2;
        if ((this.LLL instanceof C481749h) && ((C481749h) this.LLL).isDuoDualMode()) {
            return false;
        }
        if (this.LLL == null || LJJIFFI() == null) {
            r2 = null;
        } else {
            r2 = Dfy.LIZ.LIZ(LJJIFFI(), LJLLLL());
        }
        if (this.LLL == null) {
            return true;
        }
        if ((!LIZJ() && !LIZLLL()) || !LLLIIII()) {
            return true;
        }
        if (!ScrollSwitchStateManager.LJIILL.LIZ(this.LLL).LIZIZ("page_feed")) {
            return true;
        }
        BusinessComponentServiceUtils.getBusinessBridgeService().LIZIZ();
        if (!EjI.LIZIZ() || RecFeedShareComponentController.LJIIIIZZ) {
            return true;
        }
        if (r2 == null || !r2.LIZ()) {
            return false;
        }
        return true;
    }

    public final boolean LJJIJIIJI() {
        AnonymousClass2IR LLILZ = LLILZ();
        if (LLILZ == null || LLILZ.LJJLIIIJLLLLLLLZ() == null) {
            return false;
        }
        Aweme LJLLLL = LJLLLL();
        if (C10012jR.LIZ.LIZIZ() && C09942jK.LJFF.LIZ(LJLLLL)) {
            LLILZ.LJIIIZ();
            LJIJJ(LJLLLL);
            return true;
        } else if (!C10012jR.LIZ.LIZJ() || !C09942jK.LJFF.LIZIZ(LJLLLL)) {
            return false;
        } else {
            this.LJIIIZ = C09942jK.LJFF.LIZ(this.LLL, LLILZ.LJJLIIIJLLLLLLLZ().findViewById(2131370192), new C00652Gp(this));
            C09942jK.LJFF.LIZ((C10002jQ) new C31853dZ(this));
            C09942jK.LJFF.LIZ();
            LJIJJ(LJLLLL);
            return true;
        }
    }

    public final void LIZ() {
        String str;
        VideoUrlModel properPlayAddr;
        if (LLILIL() && this.LJJJLIIL != null && LJZ() != null && LJIIL(LJZ())) {
            if (this.LLJL == null) {
                this.LLJL = new 8Bc(LJJJJJ());
            }
            Aweme LJLLLL = LJLLLL();
            if (LJLLLL != null) {
                Video video = LJLLLL.getVideo();
                str = null;
                if (video != null) {
                    if (9Y3.LIZ(9Y3.LIZ(), true, "bytevc1_play_addr_policy_unify", true)) {
                        properPlayAddr = 8Dl.LIZ(C32573ej.LIZ.LIZ().getVideoPlayAddr(8Dl.LIZ(video), 8Fc.LIZ.getPlayerType()));
                    } else {
                        properPlayAddr = video.getProperPlayAddr();
                    }
                    if (properPlayAddr != null) {
                        str = properPlayAddr.getBitRatedRatioUri();
                    }
                }
            } else {
                str = "";
            }
            if (!TextUtils.isEmpty(str)) {
                this.LLJL.LIZ(false, str, 0, 0, this.LJJLIIIJJI, LJLLLLLL(), true);
            }
        }
    }

    public final void LJIJI() {
        if (SmartFeedLoadMoreService.instance().isSmartFeedLoadMoreScene(this.LLIFFJFJJ.getEventType()) && SmartFeedLoadMoreService.instance().needCheckLoadMore(this.LJJLIIIJL, this.LJJLIIIJJI.LIZIZ(), this.LJJLIIIJJI.LJ(this.LJJLIIIJL))) {
            C224738l LIZ2 = C224738l.LJIIL.LIZ();
            if (LIZ2.LIZJ() != 1 || LIZ2.LIZJ) {
                SmartFeedLoadMoreService.instance().startSmartFeedLoadMoreJudge(this.LJJLIIIJJI.LJ(this.LJJLIIIJL), this.LJIIZILJ);
            } else {
                return;
            }
        }
        if ((this.LJJLIIIJL >= this.LJJLIIIJJI.LIZIZ() - LJJJJLL() || (this.LJJLIIIJL == this.LJJLIIIJJI.LIZIZ() - 1 && this.LJJLIIIJJI.LIZIZ() <= 3)) && this.LJLJJI != null) {
            C224738l LIZ3 = C224738l.LJIIL.LIZ();
            if (LIZ3.LIZJ() == 1 && !LIZ3.LIZJ) {
                return;
            }
            if ((!C33843gm.LIZ.LIZIZ() && !7RI.LIZ.LIZIZ()) || this.LJJLIIIJL != 0 || this.LJJLIIIJJI.LIZIZ() != 1 || !this.LJJLIIIJJI.LJ(0).isFromSplitData()) {
                if (!C31873db.LIZ || this.LJJLIIIJL == 0) {
                    this.LJLJJI.LJIIIZ();
                } else {
                    C01272Iz.LIZ.LIZ.postDelayed(new C31623dC(this), 500);
                }
            }
        }
    }

    public final /* synthetic */ void LJJIJ() {
        if (LLJJIJIL()) {
            AnonymousClass2EE LLILZIL = LLILZIL();
            if (LLILZIL != null) {
                LLILZIL.LIZ(LLILZIL.LIZIZ());
                if ((this.LLL instanceof 1hK) && LLJJIII() && this.LLILL) {
                    CqM.LIZ(new C31893dd(LLILZIL.LIZIZ()));
                    AwemeChangeCallBack.LIZ(this.LLL, LLILZIL.LIZIZ());
                }
                CqM.LIZ(new Euv(LLILZIL.LIZIZ(), this.LLIFFJFJJ.getEventType(), this.LLIFFJFJJ.getPageType(), this));
            }
            AnonymousClass2EE LLILLIZIL = LLILLIZIL();
            if (C01082Ig.LIZ(this.LLIFFJFJJ.getEventType()) && LLILLIZIL != null && LLILLIZIL.LIZ() == 101) {
                if (this.LLII != null) {
                    this.LLII.LJJIJIIJI();
                }
                if (this.LLL instanceof 1hK) {
                    AwemeChangeCallBack.LIZ(this.LLL, LLILLIZIL.LIZIZ());
                }
            }
            if (LLILZIL == null || LLILZIL.LIZ() != 2) {
                LJLJL();
                AnonymousClass2KS.LIZ().LIZIZ();
                LLILZLL();
                if (9XD.LIZ && LLILZIL != null) {
                    LLILZIL.LJIILLIIL();
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:6:0x002d, code lost:
        r6 = r10.LJJLIIIJL + 2;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LLIFFJFJJ() {
        /*
            r10 = this;
            com.ss.android.ugc.aweme.live.ILiveOuterService r0 = com.ss.android.ugc.aweme.live.LiveOuterService.LJJI()
            com.ss.android.ugc.aweme.live.ILiveOuterService r0 = r0.LIZ()
            X.3P1 r2 = r0.LJ()
            r9 = 0
            java.lang.Boolean r1 = java.lang.Boolean.valueOf(r9)
            java.lang.String r0 = "enable_refresh_foru_avatar_live_status"
            java.lang.Object r0 = r2.LIZ(r0, r1)
            java.lang.Boolean r0 = (java.lang.Boolean) r0
            boolean r0 = r0.booleanValue()
            if (r0 != 0) goto L_0x0020
            return
        L_0x0020:
            int r1 = r10.LJJLIIIJL
            X.2mC r0 = r10.LJJLIIIJJI
            int r0 = r0.LIZIZ()
            int r0 = r0 + -2
            if (r1 <= r0) goto L_0x002d
            return
        L_0x002d:
            int r0 = r10.LJJLIIIJL
            int r6 = r0 + 2
            X.2mC r0 = r10.LJJLIIIJJI
            com.ss.android.ugc.aweme.feed.model.Aweme r5 = r0.LJ((int) r6)
            if (r5 != 0) goto L_0x003a
            return
        L_0x003a:
            com.ss.android.ugc.aweme.profile.model.User r4 = r5.getAuthor()
            if (r4 == 0) goto L_0x0048
            long r1 = r4.roomId
            r7 = 0
            int r0 = (r1 > r7 ? 1 : (r1 == r7 ? 0 : -1))
            if (r0 != 0) goto L_0x0049
        L_0x0048:
            return
        L_0x0049:
            java.util.ArrayList r3 = new java.util.ArrayList
            r3.<init>()
            int r0 = r10.LJJLIIIJL
            int r0 = r0 + -5
            int r2 = java.lang.Math.max(r0, r9)
        L_0x0056:
            int r0 = r6 + 5
            if (r2 > r0) goto L_0x0080
            int r0 = r10.LJJLIIIJL
            if (r2 == r0) goto L_0x007d
            X.2mC r0 = r10.LJJLIIIJJI
            int r0 = r0.LIZIZ()
            int r0 = r0 + -1
            if (r2 >= r0) goto L_0x0080
            X.2mC r0 = r10.LJJLIIIJJI
            com.ss.android.ugc.aweme.feed.model.Aweme r1 = r0.LJ((int) r2)
            if (r1 == 0) goto L_0x0080
            com.ss.android.ugc.aweme.profile.model.User r0 = r1.getAuthor()
            if (r0 == 0) goto L_0x007d
            com.ss.android.ugc.aweme.profile.model.User r0 = r1.getAuthor()
            r3.add(r0)
        L_0x007d:
            int r2 = r2 + 1
            goto L_0x0056
        L_0x0080:
            int r1 = r5.getAwemeType()
            r0 = 101(0x65, float:1.42E-43)
            if (r1 != r0) goto L_0x00a8
            X.TnV r0 = r10.LLIFFJFJJ
            java.lang.String r1 = r0.getEventType()
            java.lang.String r0 = "homepage_follow"
            boolean r0 = r0.equals(r1)
            if (r0 == 0) goto L_0x00a5
            java.lang.String r2 = "tiktok_follow_below"
        L_0x0098:
            X.DxH r1 = com.ss.android.ugc.aweme.services.BusinessComponentServiceUtils.getLiveStateManager()
            X.2H2 r0 = new X.2H2
            r0.<init>(r10, r5, r6, r4)
            r1.LIZ(r4, r3, r0, r2)
            goto L_0x0048
        L_0x00a5:
            java.lang.String r2 = "tiktok_video_feed"
            goto L_0x0098
        L_0x00a8:
            java.lang.String r2 = "tiktok_video_head"
            goto L_0x0098
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.feed.panel.FullFeedFragmentPanel.LLIFFJFJJ():void");
    }

    public void LLJJI() {
        super.LLJJI();
        if (this.LLJZIJLIL) {
            AnonymousClass2EE LJLLL = LJLLL();
            if (LJLLL != null) {
                LJLLL.LIZ();
                LJLLL.LJJJLIIL();
            }
            if (!(this.LJJLIIIJJI == null || this.LJJJLIIL == null)) {
                this.LJJLIIIJJI.LJIIIIZZ(this.LJJLIIIJL);
                LLFZ().LIZ(this.LLII);
                AnonymousClass2KS.LIZ();
                Aweme LJ2 = this.LJJLIIIJJI.LJ(this.LJJJLIIL.getCurrentItem());
                if ((this.LLL instanceof 1hK) && LLJJIII()) {
                    C31893dd r0 = new C31893dd(LJ2);
                    r0.LIZIZ = true;
                    CqM.LIZ(r0);
                    AwemeChangeCallBack.LIZ(this.LLL, LJ2);
                }
                AnonymousClass2EE LLILLIZIL = LLILLIZIL();
                if (9XD.LIZ && LLILLIZIL != null) {
                    LLILLIZIL.LIZJ(1);
                }
                AnonymousClass2GY r2 = AnonymousClass2GY.LIZLLL;
                if ((r2.LIZ() == AnonymousClass2GY.LIZIZ || r2.LIZ() == AnonymousClass2GY.LIZJ) && !LFp.LJIJ(LJ2) && this.LJLLL > 0) {
                    LJJIIZ();
                } else {
                    C01172Ip.LIZ(C62534lx.LJFF(LJ2), "handlePageResume");
                    C01172Ip.LIZIZ("tryPlay", LJ(LJ2));
                }
            }
            C40833s3 r02 = this.LIZJ;
            if (r02 != null && r02.LIZIZ) {
                this.LIZJ.LIZLLL();
            }
        }
    }

    public void LJIIZILJ() {
        C31933dh r0;
        Ej4 LIZ2;
        Ej4 LIZIZ2;
        super.LJIIZILJ();
        if (this.LLJZIJLIL) {
            if ((this.LLL instanceof 1hK) && LLJJIII()) {
                try {
                    1hK r1 = this.LLL;
                    if (!(r1.getSupportFragmentManager() == null || (LIZIZ2 = TabChangeManager.LJII.LIZ(r1).LIZIZ("HOME")) == null || bt_() == null || !bt_().equals(LIZIZ2.LJIIL()))) {
                        C40833s3 r02 = this.LIZJ;
                        if (r02 != null && r02.LIZIZ) {
                            if (ScrollSwitchStateManager.LJIILL.LIZ(this.LLL).LIZIZ("page_feed")) {
                                this.LIZJ.LIZLLL();
                            }
                        }
                        LLFZ().LIZ(this.LLII);
                        AnonymousClass2KS.LIZ();
                    }
                } catch (Exception e) {
                    0HH.LIZ(e);
                }
            }
            boolean LIZIZ3 = ScrollSwitchStateManager.LJIILL.LIZ(this.LLL).LIZIZ("page_feed");
            IMSAdaptionService LIZJ2 = MSAdaptionService.LIZJ();
            if (LIZJ2.LIZIZ(this.LLL) && (LIZ2 = LIZJ2.LIZ(this.LLL)) != null && (LIZ2.LJIILIIL() || LIZ2.LJIILJJIL() || LIZ2.LJIIZILJ() || LIZ2.LJIILLIIL())) {
                LIZIZ3 = true;
            }
            if (this.LJJIIJ && LIZJ() && LIZIZ3) {
                this.LJJIIJ = false;
            } else if ((!LIZLLL() || this.LJIILJJIL) && ((LIZJ() || LIZLLL()) && this.LJJLIIIJJI != null && this.LJJLIIIJJI.LIZIZ() > 0 && LIZIZ3 && ((!LJFF || Ecz.LIZ((String) null, (String) null, 3)) && !LJIIIIZZ()))) {
                super.LJIIL(false);
            }
            if (this.LJJII.get() && (r0 = this.LJJIFFI) != null) {
                r0.LIZ();
            }
        }
    }

    public final void LIZIZ(boolean z) {
        this.LIZLLL = z;
    }

    public final void LJIIL(boolean z) {
        if (!LJIIIIZZ()) {
            super.LJIIL(z);
        }
    }

    public final void LJIILJJIL(Aweme aweme) {
        if (!LJIIIIZZ()) {
            super.LJIILJJIL(aweme);
        }
    }

    private void LIZJ(boolean z) {
        FeedRefreshViewModel LIZ2;
        if (LLILIL() && (LIZ2 = FeedRefreshViewModel.LIZ(this.LLL)) != null) {
            LIZ2.LIZ().postValue(Boolean.valueOf(z));
        }
    }

    private void LJI(String str) {
        if (C09942jK.LJFF.LIZJ(LJLLLL())) {
            C55484aa.LIZJ.LIZ(str);
            AnonymousClass2IR LLILZ = LLILZ();
            if (LLILZ != null) {
                LLILZ.LJIIIIZZ();
            }
        }
    }

    public final void LIZLLL(Exception exc) {
        if (LLJJIJIL()) {
            DzH.LIZ(this.LLL, exc, 2131823715);
        }
    }

    public final String LJ(Aweme aweme) {
        if (!LIZJ() || !LLLIIII()) {
            return "23";
        }
        return super.LJ(aweme);
    }

    @ISm
    public void OnDeleteTopViewAwemeEvent(C31603dA r4) {
        Aweme LJFF2 = this.LJJLIIIJJI.LJFF(0);
        if (LJFF2 != null && TextUtils.equals(LJFF2.getAid(), r4.LIZ.getAid())) {
            LIZIZ(0);
            FLK.LJIILIIL = true;
        }
    }

    @ISm
    public void onInterceptedResumePlayOnResume(C31913df r3) {
        if (this.LLL != null && this.LLL.hashCode() == r3.LIZ) {
            this.LJJIIJ = !r3.LIZIZ;
        }
    }

    @ISm
    public void onRefreshEvent(EgP egP) {
        this.LJIILLIIL = egP.LIZ;
        C69044wS.LIZ.LIZ(this.LLL);
        if (LJII() || LJJJ()) {
            LLJZIJLIL();
        }
    }

    public final void LJFF(String str) {
        if (LLJJIJIL()) {
            if ((this.LJLJJL != null && this.LJLJJL.LIZ(str)) || LJIILL(str)) {
                LIZJ(str);
            }
            C30053af r1 = new C30053af(this.LLL);
            r1.LJ(2131823734);
            C30053af.LIZ(r1);
            super.LJFF(str);
        }
    }

    @ISm
    public void onBackupUpdateEvent(C06762eC r6) {
        Map<String, AwemeStatisticsBackup> map = r6.LIZ;
        if (LLILIL() && map != null && map.size() != 0) {
            C06772eD r4 = new C06772eD(map, r6);
            if (this.LJJJLIIL != null) {
                int childCount = this.LJJJLIIL.getChildCount();
                for (int i = 0; i < childCount; i++) {
                    Object tag = this.LJJJLIIL.getChildAt(i).getTag(2131364819);
                    if (tag != null) {
                        try {
                            r4.accept(tag);
                        } catch (Exception e) {
                            0HH.LIZ(e);
                        }
                    }
                }
            }
        }
    }

    @ISm
    public void onCommentDialogEvent(9mr r4) {
        AnonymousClass4RT LJIJ2;
        boolean z = true;
        if (r4.LIZ != 1) {
            z = false;
        }
        this.LJJIIZI = z;
        LJII(z);
        if (LLILIL()) {
            LJIIIIZZ(this.LJJIIZI);
            if (!this.LJJIIZI && this.LJIJJ) {
                AnonymousClass2EE LLILLIZIL = LLILLIZIL();
                if (!(LLILLIZIL == null || (LJIJ2 = LLILLIZIL.LJIJ()) == null)) {
                    LJIJ2.LJJJ();
                }
                LJI(this.LJJI);
                this.LJIJJ = false;
                this.LJJI = "";
            }
        }
    }

    @ISm
    public void onDislikeAwemeEvent(C34453hl r4) {
        if (r4.LJ == this.LLL.hashCode() && !this.LLI.booleanValue()) {
            if (LJJIFFI() != null) {
                Ev8.LIZLLL.LIZ(LJJIFFI()).LIZ("long_press_layer", r4.LIZ);
            }
            LIZ(r4.LIZ, r4.LIZ());
        }
    }

    @ISm
    public void onVideoPlayerEvent(7QN r3) {
        int i = r3.LIZJ;
        if (i == 2 || i == 3) {
            if (LLILIL()) {
                AnonymousClass2V7.LJJIIZ.LIZLLL();
            }
            C09942jK.LJFF.LIZIZ();
        } else if (i == 4 && LLILIL()) {
            AnonymousClass2V7.LJJIIZ.LJ();
        }
        super.onVideoPlayerEvent(r3);
    }

    private boolean LJIILL(String str) {
        if (!(str == null || this.LJJLIIIJJI == null || this.LJJLIIIJJI.LJI() == null)) {
            List<Aweme> LJI2 = this.LJJLIIIJJI.LJI();
            int i = 0;
            while (i < LJI2.size()) {
                Aweme aweme = LJI2.get(i);
                if (aweme == null || !str.equals(aweme.getAid())) {
                    if (Cl7.LIZJ(aweme)) {
                        if (str.equals(aweme.getAuthorUid())) {
                            LIZIZ(i);
                            return true;
                        }
                        LIZ(i, str);
                    }
                    i++;
                } else {
                    LIZIZ(i);
                    return true;
                }
            }
        }
        return false;
    }

    public void LIZJ(Exception exc) {
        if (LLJJIJIL()) {
            if (!"homepage_hot".equals(this.LLIFFJFJJ.getEventType()) || this.LLIFFJFJJ.getPageType() != 0 || !(exc instanceof JMC) || ((C39873qV) exc).getErrorCode() != 13315) {
                LJJJLIIL();
                this.LJJJJZI.LIZIZ();
                return;
            }
            a.LJFF().LIZ(new C31483cy(this));
        }
    }

    public final void LIZLLL(int i) {
        List<Aweme> LJI2;
        if (this.LJJLIIIJJI != null && (LJI2 = this.LJJLIIIJJI.LJI()) != null && LJI2.size() - 1 >= i) {
            Aweme aweme = LJI2.get(i);
            if (Cl7.LIZJ(aweme) && C62534lx.LIZ(aweme)) {
                LIZIZ(i);
                LIZJ(aweme.getAid());
            }
        }
    }

    public void LJIILJJIL(boolean z) {
        LLIIJLIL();
        super.LJIILJJIL(z);
        LJIIIIZZ((String) null);
        C01172Ip.LIZ("handlePageStop");
        LLJ();
        AnonymousClass2KS.LIZ().LIZIZ();
        C40833s3 r0 = this.LIZJ;
        if (r0 != null && r0.LIZIZ) {
            this.LIZJ.LJ();
        }
        LIZ(this.LLL, LJLLLL(), 0, 0);
        if (LLILIL()) {
            AnonymousClass2V7.LJJIFFI.LIZ();
            C04702We r02 = AnonymousClass2V7.LJIJ;
            if (r02 != null) {
                r02.LIZ();
            }
        }
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public void onVPAOptOutEvent(C32003do r7) {
        if (TextUtils.equals(this.LLIFFJFJJ.getEventType(), "homepage_hot")) {
            boolean z = false;
            ArrayList arrayList = new ArrayList();
            for (int i = this.LJJLIIIJL + 1; i < this.LJJLIIIJJI.LIZIZ(); i++) {
                if (this.LJJLIIIJJI.LJ(i).getUploadMiscInfoStruct().vpaInfo.getInfoBarType() != 0) {
                    arrayList.add(this.LJJLIIIJJI.LJ(i).getAid());
                }
            }
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                String str = (String) it.next();
                if (this.LJLJJL != null && this.LJLJJL.LIZ(str)) {
                    z = true;
                }
            }
            if (z) {
                this.LJJLIIIJJI.LIZJ();
            }
            arrayList.clear();
            if (this.LJJLIIIJJI.LIZIZ() > this.LJJLIIIJL + 1) {
                CqM.LIZ(new C31973dl());
            }
        }
    }

    @ISm
    public void onVideoCleanModeEvent(C31733dN r5) {
        AnonymousClass2EE LLILLIZIL;
        int i = r5.LIZJ;
        boolean z = r5.LIZ;
        if (i == 1) {
            AnonymousClass2EE LLILZIL = LLILZIL();
            if (LLILZIL != null && r5.LIZIZ != null && LLILZIL.LIZIZ() != null && r5.LIZIZ.getAid().equals(LLILZIL.LIZIZ().getAid())) {
                this.LJJLIIIJ.setCanTouch(!z);
                LLILZIL.LIZIZ(z, false);
            }
        } else if (i == 2 && !TextUtils.isEmpty(r5.LIZIZ.getAid()) && (LLILLIZIL = LLILLIZIL()) != null && r5.LIZIZ != null && LLILLIZIL.LIZIZ() != null && (LLILLIZIL instanceof AnonymousClass2EE)) {
            LLILLIZIL.LIZIZ(z, true);
        }
    }

    public final /* synthetic */ void LIZIZ(Aweme aweme) {
        Integer insertIndex = EjI.LIZ().getInsertIndex(LJLLLLLL(), aweme);
        if (insertIndex != null) {
            String str = BaseListFragmentPanel.LJJJJLI;
            C10772kf.LIZIZ(4, str, "start to insert at " + insertIndex + "thread: " + Thread.currentThread());
            try {
                LIZ(aweme, insertIndex.intValue());
            } catch (Exception e) {
                C10772kf.LIZ(e);
            }
        }
    }

    public final void LIZLLL(String str) {
        if (!878.LIZ(this.LJJLIIIJJI.LJII()) && !TextUtils.isEmpty(str) && this.LJJLIIIJJI.LIZIZ(str)) {
            LIZ(this.LLILII, true);
            LLJILJIL();
            LJJJJZ();
            LJIIIZ(this.LJJJLIIL.getCurrentItem());
        }
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public void deleteRecUserFeedAndScrollNextFeed(C32013dp r9) {
        int i;
        int i2;
        M12.LIZ("TTRecUserBigCard", "[deleteRecUserFeedAndScrollNextFeed] handle");
        if (this.LJJLIIIJJI != null && this.LJJLIIIJJI.LJI() != null) {
            List<Aweme> LJI2 = this.LJJLIIIJJI.LJI();
            if (this.LJJLIIIJJI == null || this.LJJLIIIJJI.LJI() == null) {
                i = -1;
            } else {
                List<Aweme> LJI3 = this.LJJLIIIJJI.LJI();
                i = -1;
                for (int i3 = 0; i3 < LJI3.size(); i3++) {
                    if (LJI3.get(i3).getAwemeType() == 4003) {
                        i = i3;
                    }
                }
            }
            M12.LIZ("TTRecUserBigCard", "[deleteRecUserFeedAndScrollNextFeed] big card index = ".concat(String.valueOf(i)));
            if (i == -1) {
                M12.LIZ("TTRecUserBigCard", "[deleteRecUserFeedAndScrollNextFeed] illegal index");
                return;
            }
            int LJLLLLLL = LJLLLLLL();
            if (LJLLLLLL >= 0 && LJLLLLLL < LJI2.size()) {
                if (i == LJLLLLLL && (i2 = LJLLLLLL + 1) < LJI2.size()) {
                    LIZIZ(i2, true);
                }
                LIZ(i, LJI2.get(i));
            }
        }
    }

    public void onAwesomeSplashEvent(F6U f6u) {
        Keva repo;
        super.onAwesomeSplashEvent(f6u);
        if (f6u.LIZ == 4 && (repo = Keva.getRepo("repo_auto_volume")) != null && repo.getBoolean("auto_volume_state", !ESC.LJ()) && repo.getBoolean("need_show_auto_volume_toast", true) && C55034Zr.LIZJ && "homepage_hot".equals(this.LLIFFJFJJ.getEventType()) && this.LLIFFJFJJ.getPageType() == 0 && LJLLLL() != null && !LJLLLL().isAd()) {
            C55034Zr.LJ.LIZ(false);
            if (this.LJIIJJI == null) {
                this.LJIIJJI = new C30053af(this.LLL);
            }
            C30053af r2 = this.LJIIJJI;
            r2.LJ(2131834886);
            r2.LIZ(5000);
            r2.LIZIZ(2131755636);
            r2.LIZJ(070.LIZJ(this.LLL, 2131100966));
            C30053af.LIZ(r2);
            C12422nK.onEventV3("auto_volume_adjustment_toast_show");
        }
        if (f6u.LIZ == 4 && this.LJIL && "homepage_hot".equals(this.LLIFFJFJJ.getEventType()) && this.LLIFFJFJJ.getPageType() == 0 && a.LJFF().LIZIZ() && a.LJFF().LIZ() != null) {
            LJJI();
        }
    }

    @ISm
    public void onDeleteAwemeEvent(C31543d4 r5) {
        if (TextUtils.equals(this.LLIFFJFJJ.getEventType(), r5.LIZIZ)) {
            if (r5.LIZ != null) {
                String str = BaseListFragmentPanel.LJJJJLI;
                C10772kf.LIZJ(4, str, "onDeleteAwemeEvent" + r5.LIZ.getAid());
            }
            Aweme aweme = r5.LIZ;
            if (!TextUtils.equals(r5.LIZJ, C31543d4.LJ) || !Cl7.LJ(aweme) || aweme == null) {
                if (TextUtils.equals(r5.LIZJ, C31543d4.LJFF)) {
                    LLJJJJLIIL().LIZJ(aweme);
                    if (aweme != null) {
                        LJIIIIZZ(aweme.getAid());
                    } else {
                        return;
                    }
                } else if (aweme == null) {
                    return;
                }
                if (this.LJLJJL != null && this.LJLJJL.c_(aweme)) {
                    LIZJ(aweme.getAid());
                    return;
                }
                return;
            }
            LJIILL(aweme.getAuthorUid());
            LIZJ(aweme.getAid());
        }
    }

    public final void LIZIZ(Exception exc) {
        boolean z;
        if (LLJJIJIL()) {
            C11722mC r1 = this.LJJLIIIJJI;
            if (r1 == null || r1.LIZIZ() != 1 || !LFp.LJJIII(r1.LJ(0))) {
                z = false;
            } else {
                z = true;
            }
            if (!TextUtils.isEmpty(8Qp.LJIIL)) {
                JSONObject jSONObject = new JSONObject();
                try {
                    jSONObject.put("timestamp", System.currentTimeMillis());
                    jSONObject.put("URL", 8Qp.LJIIL);
                    jSONObject.put("DNS", 8Qp.LJIILL.LJIIIZ);
                    jSONObject.put("Connect", 8Qp.LJIILL.LJIIJ);
                    jSONObject.put("SSL", 8Qp.LJIILL.LJIIJJI);
                    jSONObject.put("Request", 8Qp.LJIILL.LJIILIIL);
                    jSONObject.put("Response", 8Qp.LJIILL.LJIILJJIL);
                    jSONObject.put("ttfbMs", 8Qp.LJIILL.LJIILLIIL);
                    jSONObject.put("total", 8Qp.LJIILL.LJIIZILJ);
                    jSONObject.put("extra", 8Qp.LJIILLIIL);
                    jSONObject.put("exception", 8Qp.LJIILIIL);
                    jSONObject.put("requestInfo", 8Qp.LJIILL);
                    jSONObject.put("eTime", 8Qp.LJIILJJIL);
                    Context LIZ2 = 9EH.LJJIFFI.LIZ();
                    if (TextUtils.isEmpty(8qY.LJ) || 8qY.LIZIZ()) {
                        8qY.LJ = NetworkUtils.getNetworkAccessType(LIZ2);
                    }
                    jSONObject.put("network", 8qY.LJ);
                } catch (JSONException e) {
                    0HH.LIZ(e);
                }
                95y.LIZ("feed_retry_e", jSONObject);
            }
            if (!"homepage_hot".equals(this.LLIFFJFJJ.getEventType()) || this.LLIFFJFJJ.getPageType() != 0 || !(exc instanceof JMC) || ((C39873qV) exc).getErrorCode() != 13315) {
                this.LLFFF.setRefreshing(false);
                LJJJLIIL();
                if (this.LJIILL || z) {
                    AnonymousClass3BB r12 = new AnonymousClass3BB(this.LLL);
                    r12.LIZIZ(2131827476);
                    r12.LIZIZ();
                } else if (LJIILLIIL(false) != null) {
                    OQZ LJIILLIIL2 = LJIILLIIL(true);
                    if (LJIILLIIL2 != null) {
                        try {
                            LJIILLIIL2.LJII();
                        } catch (RuntimeException e2) {
                            C10772kf.LIZ((Exception) e2);
                            AnonymousClass3BB r13 = new AnonymousClass3BB(this.LLL);
                            r13.LIZIZ(2131827476);
                            r13.LIZIZ();
                        }
                    }
                } else if (C31643dE.LIZ.LIZ() == 0) {
                    LJIIJ();
                } else if (AnonymousClass2K7.LIZ.LIZIZ == DcP.FAKE) {
                    LJIILJJIL();
                } else {
                    LJIIJ();
                }
                if (this.LLIILZL != null) {
                    if (this.LLIILZL.LIZ("swipe_up_guide")) {
                        if (this.LLJLLL != null) {
                            this.LLJLLL.LIZJ();
                        }
                        if (this.LLJLL != null) {
                            this.LLJLL.LIZIZ();
                        }
                        this.LLIILZL.LIZ("swipe_up_guide", false);
                    } else if (this.LLIILZL.LIZ("not_interested_tutorial")) {
                        if (this.LLJLLIL != null) {
                            this.LLJLLIL.LIZIZ();
                        }
                        this.LLIILZL.LIZ("not_interested_tutorial", false);
                    }
                }
                LIZJ(false);
                return;
            }
            a.LJFF().LIZ(new C31473cx(this));
        }
    }

    public final boolean LIZJ(String str) {
        LLIIJI();
        this.LJJLIIIJJI.LIZJ();
        LJJJJZ();
        LJJIJL();
        LIZ(str, false);
        return false;
    }

    public final void LIZLLL(boolean z) {
        C40833s3 r0;
        super.LIZLLL(z);
        if (z && (r0 = this.LIZJ) != null && r0.LIZIZ) {
            this.LIZJ.LIZLLL();
        }
    }

    public final void LIZ(C31373cn r2) {
        if (this.LJJJJZI != null) {
            this.LJJJJZI.setLoadMoreListener(r2);
        }
    }

    public final void LIZIZ(String str) {
        if (LLJJIJIL()) {
            if (TextUtils.equals(this.LJIJ, str)) {
                this.LJIJI++;
                if (!C31653dF.LIZ.LIZ() || B71.LIZJ.LIZ(LJLLLL()) || !C55754b1.LIZ()) {
                    if (9YP.LIZIZ() != 0 && C55754b1.LIZ()) {
                        if (!this.LJJIJ && this.LJIJI >= 9YP.LIZ() && !C31923dg.LIZ.LIZ(str)) {
                            if (this.LJJIIZI) {
                                this.LJIJJ = true;
                                this.LJJI = "loop2";
                            } else {
                                LJI("loop2");
                            }
                            if (this.LJIJI == 2) {
                                String LIZJ2 = C55754b1.LIZJ();
                                AnonymousClass2aZ r0 = new AnonymousClass2aZ();
                                r0.LIZ("awe_share_guide_type", LIZJ2);
                                95y.LIZ("awe_share_guide_type_log", r0.LIZ());
                            }
                        } else if (this.LJIJI == 2) {
                            AnonymousClass2aZ r1 = new AnonymousClass2aZ();
                            r1.LIZ("awe_share_guide_type", "none");
                            95y.LIZ("awe_share_guide_type_log", r1.LIZ());
                        }
                    }
                } else if (!this.LJJIJ && this.LJIJI >= C31663dG.LIZIZ.LIZ() && !C31923dg.LIZ.LIZ(str)) {
                    if (this.LJJIIZI) {
                        this.LJIJJ = true;
                        this.LJJI = "loop2";
                        return;
                    }
                    LJI("loop2");
                }
            } else {
                this.LJIJI = 1;
                this.LJIJ = str;
            }
        }
    }

    public void LJIIIZ(int i) {
        C11722mC r4;
        boolean z;
        boolean z2;
        BaseListFragmentPanel baseListFragmentPanel;
        C11722mC r1;
        Aweme LJ2;
        String str;
        SmartClassifySceneConfig modelConfig;
        SmartNewClassifyConfig LIZ2;
        String str2;
        AwemeRawAd awemeRawAd;
        int i2;
        WeakReference<BaseListFragmentPanel> weakReference;
        BaseListFragmentPanel baseListFragmentPanel2;
        C11722mC r9;
        String str3;
        SmartRegressionSceneConfig modelConfig2;
        String str4;
        BaseListFragmentPanel baseListFragmentPanel3;
        super.LJIIIZ(i);
        if (TextUtils.equals(this.LLIFFJFJJ.getEventType(), "homepage_hot")) {
            Aweme LJLLLL = LJLLLL();
            LDj.LJIIIZ().LIZ(this, i);
            AdShowTimeGapManager adShowTimeGapManager = AdShowTimeGapManager.LJJI;
            M12.LIZ(this);
            if (!AdShowTimeGapManager.LIZ) {
                M12.LIZ(this);
                AdShowTimeGapManager.LIZIZ = new WeakReference<>(this);
                AdShowTimeGapManager.LIZ = true;
            }
            WeakReference<BaseListFragmentPanel> weakReference2 = AdShowTimeGapManager.LIZIZ;
            if (weakReference2 == null || (baseListFragmentPanel3 = (BaseListFragmentPanel) weakReference2.get()) == null) {
                r4 = null;
            } else {
                r4 = baseListFragmentPanel3.LJJLIIIJJI;
            }
            if (r4 instanceof C11722mC) {
                if (!AdShowTimeGapManager.LJIIZILJ) {
                    SmartNewRegressionConfig LIZ3 = C31573d7.LIZIZ.LIZ();
                    if (LIZ3 != null) {
                        SmartRegressionSceneConfig modelConfig3 = LIZ3.getModelConfig();
                        if (modelConfig3 != null) {
                            str4 = modelConfig3.getScene();
                        } else {
                            str4 = null;
                        }
                        RR4.LIZ.configSceneModel(str4, LIZ3.getModelConfig());
                    }
                    AdShowTimeGapManager.LJIIZILJ = true;
                }
                if (!AdShowTimeGapManager.LJIJ && i == AdShowTimeGapManager.LJIL - 1) {
                    ISmartRegressCalculateService iSmartRegressCalculateService = RR4.LIZ;
                    SmartNewRegressionConfig LIZ4 = C31573d7.LIZIZ.LIZ();
                    if (LIZ4 == null || (modelConfig2 = LIZ4.getModelConfig()) == null) {
                        str3 = null;
                    } else {
                        str3 = modelConfig2.getScene();
                    }
                    iSmartRegressCalculateService.ensureEnvAvailable(str3);
                    AdShowTimeGapManager.LJIJ = true;
                }
                if (i == AdShowTimeGapManager.LJIL && (weakReference = AdShowTimeGapManager.LIZIZ) != null && (baseListFragmentPanel2 = (BaseListFragmentPanel) weakReference.get()) != null && (r9 = baseListFragmentPanel2.LJJLIIIJJI) != null && RR4.LIZ.enable("tiktok_tail_slot_for_client_ai") && adShowTimeGapManager.LIZ(AdShowTimeGapManager.LJIL, r9.LIZIZ())) {
                    RQw rQw = new RQw();
                    rQw.LIZ = r9.LJ(AdShowTimeGapManager.LJIL);
                    RR4.LIZ.calculate("tiktok_tail_slot_for_client_ai", rQw, (C32043ds) null, new C31763dQ());
                }
                if (r4.LIZIZ() != AdShowTimeGapManager.LIZJ) {
                    z = true;
                    if (AdShowTimeGapManager.LIZJ == -1) {
                        i2 = 0;
                    } else {
                        i2 = AdShowTimeGapManager.LIZJ;
                    }
                    AdShowTimeGapManager.LJIL = i2;
                } else {
                    z = false;
                }
                AdShowTimeGapManager.LIZJ = r4.LIZIZ();
                if (LJLLLL == null || !LJLLLL.isAd() || ((awemeRawAd = LJLLLL.getAwemeRawAd()) != null && awemeRawAd.isReshowAd())) {
                    z2 = false;
                } else {
                    AdShowTimeGapManager.LIZLLL = AdShowTimeGapManager.LJ;
                    AdShowTimeGapManager.LJIIIIZZ = i;
                    z2 = true;
                }
                if (adShowTimeGapManager.LIZ() || LFp.LJJIII(LJLLLL)) {
                    if (!AdShowTimeGapManager.LJIJI && (LIZ2 = C31563d6.LIZIZ.LIZ()) != null) {
                        SmartClassifySceneConfig modelConfig4 = LIZ2.getModelConfig();
                        if (modelConfig4 != null) {
                            str2 = modelConfig4.getScene();
                        } else {
                            str2 = null;
                        }
                        RR2.LIZ.configSceneModel(str2, LIZ2.getModelConfig());
                        AdShowTimeGapManager.LJIJI = true;
                    }
                    if (!AdShowTimeGapManager.LJIJJ) {
                        ISmartClassifyService iSmartClassifyService = RR2.LIZ;
                        SmartNewClassifyConfig LIZ5 = C31563d6.LIZIZ.LIZ();
                        if (LIZ5 == null || (modelConfig = LIZ5.getModelConfig()) == null) {
                            str = null;
                        } else {
                            str = modelConfig.getScene();
                        }
                        iSmartClassifyService.ensureEnvAvailable(str);
                        AdShowTimeGapManager.LJIJJ = true;
                    }
                    AdShowTimeGapManager.LJII = i;
                    WeakReference<BaseListFragmentPanel> weakReference3 = AdShowTimeGapManager.LIZIZ;
                    if (weakReference3 != null && (baseListFragmentPanel = (BaseListFragmentPanel) weakReference3.get()) != null && (r1 = baseListFragmentPanel.LJJLIIIJJI) != null && RR2.LIZ.enable("tiktok_fast_browse_for_adgap_adjust") && adShowTimeGapManager.LIZ(AdShowTimeGapManager.LJII, r1.LIZIZ()) && adShowTimeGapManager.LIZ(AdShowTimeGapManager.LJII + 3, r1.LIZIZ()) && (LJ2 = r1.LJ(AdShowTimeGapManager.LJII + 3)) != null && LJ2.isAd()) {
                        RQw rQw2 = new RQw();
                        rQw2.LIZ = r1.LJ(AdShowTimeGapManager.LJII + 1);
                        Aweme LJ3 = r1.LJ(AdShowTimeGapManager.LJII + 1);
                        n.LIZIZ(LJ3, "");
                        RR2.LIZ.classify("tiktok_fast_browse_for_adgap_adjust", rQw2, (C32043ds) null, new C05532Zj(LJ3.getAid()));
                    }
                    AdShowTimeGapManager.LJ = System.currentTimeMillis();
                    if (z2 || z) {
                        AdShowTimeGapManager.LJIIIZ = adShowTimeGapManager.LIZ((List<? extends Aweme>) r4.LJI(), AdShowTimeGapManager.LJIIIIZZ, true);
                        AdShowTimeGapManager.LJIIL = adShowTimeGapManager.LIZ((List<? extends Aweme>) r4.LJI(), AdShowTimeGapManager.LJIIIZ, false);
                        if (z2) {
                            C05502Zg r12 = AdShowTimeGapManager.LJIIJ;
                            if (r12 != null) {
                                AdShowTimeGapManager.LJI.add(r12);
                            }
                            AdShowTimeGapManager.LJIIJ = null;
                            AdShowTimeGapManager.LJIIJJI = new ArrayList<>();
                        }
                    }
                    adShowTimeGapManager.LIZJ();
                }
            }
            LLJJJJLIIL().LIZ(i, LJLLLL);
        }
    }

    public final void LIZ(C31933dh r2) {
        C31933dh r0;
        this.LJJIFFI = r2;
        if (this.LJJII.get() && (r0 = this.LJJIFFI) != null) {
            r0.LIZ();
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:112:? A[ORIG_RETURN, RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x0039  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(X.Etp r14) {
        /*
            r13 = this;
            r6 = r13
            int r0 = r14.LIZ
            if (r0 != 0) goto L_0x0018
            boolean r0 = r13.LIZJ()
            if (r0 != 0) goto L_0x0011
            boolean r0 = r13.LIZLLL()
            if (r0 == 0) goto L_0x0017
        L_0x0011:
            boolean r0 = r13.LLLIIII()
            if (r0 != 0) goto L_0x0018
        L_0x0017:
            return
        L_0x0018:
            int r8 = r14.LIZ
            r5 = 7
            r4 = 6
            r3 = 5
            r2 = 3
            r1 = 0
            r0 = 1
            if (r8 == r2) goto L_0x0095
            r7 = 44
            if (r8 == r7) goto L_0x01ea
            r7 = 53
            if (r8 == r7) goto L_0x0059
            if (r8 == r3) goto L_0x017f
            if (r8 == r4) goto L_0x004a
            if (r8 == r5) goto L_0x003b
        L_0x0030:
            super.LIZ((X.Etp) r14)
        L_0x0033:
            boolean r6 = r13.LLILIL()
            if (r6 == 0) goto L_0x00b7
            r7 = 0
            goto L_0x00a4
        L_0x003b:
            android.app.Activity r7 = r6.LLL
            com.ss.android.ugc.aweme.feed.model.Aweme r8 = r13.LJLLLL()
            r9 = -1
            r11 = 0
            r6 = r13
            r6.LIZ((android.app.Activity) r7, (com.ss.android.ugc.aweme.feed.model.Aweme) r8, (long) r9, (long) r11)
            goto L_0x0030
        L_0x004a:
            android.app.Activity r7 = r6.LLL
            com.ss.android.ugc.aweme.feed.model.Aweme r8 = r13.LJLLLL()
            r9 = 1200(0x4b0, double:5.93E-321)
            r11 = 1000(0x3e8, double:4.94E-321)
            r6 = r13
            r6.LIZ((android.app.Activity) r7, (com.ss.android.ugc.aweme.feed.model.Aweme) r8, (long) r9, (long) r11)
            goto L_0x0030
        L_0x0059:
            boolean r7 = r6.LJJLIIIJJIZ
            if (r7 != 0) goto L_0x008a
            r6.LJJLIIIJJIZ = r0
            boolean r7 = X.C34483ho.LIZIZ()
            if (r7 == 0) goto L_0x008e
            android.os.Looper r8 = android.os.Looper.myLooper()
            android.os.Looper r7 = android.os.Looper.getMainLooper()
            if (r8 != r7) goto L_0x008e
            android.os.MessageQueue r8 = android.os.Looper.myQueue()
            X.3dX r7 = new X.3dX
            r7.<init>(r13)
            r8.addIdleHandler(r7)
        L_0x007b:
            java.util.concurrent.atomic.AtomicBoolean r7 = r6.LJJII
            boolean r7 = r7.compareAndSet(r1, r0)
            if (r7 == 0) goto L_0x008a
            X.3dh r6 = r6.LJJIFFI
            if (r6 == 0) goto L_0x008a
            r6.LIZ()
        L_0x008a:
            super.LIZ((X.Etp) r14)
            goto L_0x0033
        L_0x008e:
            r13.LJIL()
            r13.LJJ()
            goto L_0x007b
        L_0x0095:
            android.app.Activity r7 = r6.LLL
            com.ss.android.ugc.aweme.feed.model.Aweme r8 = r13.LJLLLL()
            r9 = 0
            r11 = 0
            r6 = r13
            r6.LIZ((android.app.Activity) r7, (com.ss.android.ugc.aweme.feed.model.Aweme) r8, (long) r9, (long) r11)
            goto L_0x0030
        L_0x00a4:
            java.lang.Object r6 = r14.LIZIZ     // Catch:{ Exception -> 0x00a9 }
            com.ss.android.ugc.aweme.feed.model.Aweme r6 = (com.ss.android.ugc.aweme.feed.model.Aweme) r6     // Catch:{ Exception -> 0x00a9 }
            r7 = r6
        L_0x00a9:
            int r6 = r14.LIZ
            if (r6 == r2) goto L_0x0156
            r2 = 35
            if (r6 == r2) goto L_0x012d
            if (r6 == r3) goto L_0x010a
            if (r6 == r4) goto L_0x00f1
            if (r6 == r5) goto L_0x00b8
        L_0x00b7:
            return
        L_0x00b8:
            if (r7 == 0) goto L_0x00b7
            X.3cz r4 = X.C31803dU.LIZ
            java.lang.String r3 = r7.getAid()
            boolean r2 = X.C31703dK.LIZ
            if (r2 == 0) goto L_0x00f0
            int r2 = r4.LIZ
            int r2 = r2 + r0
            r4.LIZ = r2
            X.3e4<java.lang.String, X.3d9> r2 = r4.LJ
            java.lang.Object r2 = r2.LIZ(r3)
            X.3d9 r2 = (X.C31593d9) r2
            if (r2 != 0) goto L_0x00dd
            X.3d9 r2 = new X.3d9
            r2.<init>(r1)
            X.3e4<java.lang.String, X.3d9> r1 = r4.LJ
            r1.LIZ(r3, r2)
        L_0x00dd:
            r2.LIZIZ = r0
            X.3d0 r1 = X.C31503d0.LIZ()
            X.FAl r0 = X.FAl.COMMENT
            X.3d2 r0 = r1.LIZ(r3, r0)
            if (r0 == 0) goto L_0x00f0
            X.3d8 r0 = r0.LIZ
            r0.LIZ()
        L_0x00f0:
            return
        L_0x00f1:
            if (r7 == 0) goto L_0x00b7
            X.3cz r3 = X.C31803dU.LIZ
            java.lang.String r2 = r7.getAid()
            boolean r0 = X.C31703dK.LIZ
            if (r0 == 0) goto L_0x0109
            X.3e4<java.lang.String, X.3d9> r0 = r3.LJ
            java.lang.Object r0 = r0.LIZ(r2)
            X.3d9 r0 = (X.C31593d9) r0
            if (r0 == 0) goto L_0x0109
            r0.LIZLLL = r1
        L_0x0109:
            return
        L_0x010a:
            if (r7 == 0) goto L_0x00b7
            X.3cz r4 = X.C31803dU.LIZ
            java.lang.String r3 = r7.getAid()
            boolean r2 = X.C31703dK.LIZ
            if (r2 == 0) goto L_0x012c
            X.3e4<java.lang.String, X.3d9> r2 = r4.LJ
            java.lang.Object r2 = r2.LIZ(r3)
            X.3d9 r2 = (X.C31593d9) r2
            if (r2 != 0) goto L_0x012a
            X.3d9 r2 = new X.3d9
            r2.<init>(r1)
            X.3e4<java.lang.String, X.3d9> r1 = r4.LJ
            r1.LIZ(r3, r2)
        L_0x012a:
            r2.LIZLLL = r0
        L_0x012c:
            return
        L_0x012d:
            if (r7 == 0) goto L_0x00b7
            X.3cz r4 = X.C31803dU.LIZ
            java.lang.String r3 = r7.getAid()
            boolean r2 = X.C31703dK.LIZ
            if (r2 == 0) goto L_0x00b7
            X.3e4<java.lang.String, X.3d9> r2 = r4.LJ
            java.lang.Object r2 = r2.LIZ(r3)
            X.3d9 r2 = (X.C31593d9) r2
            if (r2 != 0) goto L_0x014d
            X.3d9 r2 = new X.3d9
            r2.<init>(r1)
            X.3e4<java.lang.String, X.3d9> r1 = r4.LJ
            r1.LIZ(r3, r2)
        L_0x014d:
            int r1 = r4.LIZLLL
            int r1 = r1 + r0
            r4.LIZLLL = r1
            r2.LJFF = r0
            goto L_0x00b7
        L_0x0156:
            if (r7 == 0) goto L_0x00b7
            X.3cz r4 = X.C31803dU.LIZ
            java.lang.String r3 = r7.getAid()
            boolean r2 = X.C31703dK.LIZ
            if (r2 == 0) goto L_0x00b7
            int r2 = r4.LIZJ
            int r2 = r2 + r0
            r4.LIZJ = r2
            X.3e4<java.lang.String, X.3d9> r2 = r4.LJ
            java.lang.Object r2 = r2.LIZ(r3)
            X.3d9 r2 = (X.C31593d9) r2
            if (r2 != 0) goto L_0x017b
            X.3d9 r2 = new X.3d9
            r2.<init>(r1)
            X.3e4<java.lang.String, X.3d9> r1 = r4.LJ
            r1.LIZ(r3, r2)
        L_0x017b:
            r2.LJ = r0
            goto L_0x00b7
        L_0x017f:
            super.LIZ((X.Etp) r14)
            com.ss.android.ugc.aweme.feed.model.Aweme r2 = r13.LJLLLL()
            X.2jL r0 = r6.LJL
            if (r0 == 0) goto L_0x019a
            X.4lv r0 = X.C62514lv.LIZ
            boolean r0 = r0.LJ(r2)
            if (r0 != 0) goto L_0x019a
            X.4lv r0 = X.C62514lv.LIZ
            boolean r0 = r0.LJI(r2)
            if (r0 == 0) goto L_0x019b
        L_0x019a:
            return
        L_0x019b:
            X.TnV r0 = r6.LLIFFJFJJ
            boolean r0 = r0.isMyProfile()
            if (r0 == 0) goto L_0x01a9
            boolean r0 = X.C69024wQ.LJII(r2)
            if (r0 != 0) goto L_0x01b5
        L_0x01a9:
            android.app.Activity r0 = r6.LLL
            java.lang.Boolean r0 = r13.LIZ((android.app.Activity) r0, (com.ss.android.ugc.aweme.feed.model.Aweme) r2)
            boolean r0 = r0.booleanValue()
            if (r0 != 0) goto L_0x019a
        L_0x01b5:
            X.3dF r0 = X.C31653dF.LIZ
            boolean r0 = r0.LIZ()
            if (r0 == 0) goto L_0x019a
            boolean r0 = X.C55754b1.LIZ()
            if (r0 == 0) goto L_0x019a
            if (r2 == 0) goto L_0x019a
            X.3dq r1 = X.C31923dg.LIZ
            java.lang.String r0 = r2.getAid()
            boolean r0 = r1.LIZ((java.lang.String) r0)
            if (r0 != 0) goto L_0x019a
            X.B71 r0 = X.B71.LIZJ
            boolean r0 = r0.LIZ(r2)
            if (r0 != 0) goto L_0x019a
            int r1 = r2.getAwemeType()
            r0 = 40
            if (r1 == r0) goto L_0x019a
            r2.getAid()
            java.lang.String r0 = "like"
            r13.LJI(r0)
            goto L_0x019a
        L_0x01ea:
            r13.LLIZLLLIL()
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.feed.panel.FullFeedFragmentPanel.LIZ(X.Etp):void");
    }

    private void LIZLLL(List<Aweme> list, boolean z) {
        7ZQ.LJ.LIZ().LIZ(list, !z, LLD());
    }

    public final void LIZ(int i, Aweme aweme) {
        super.LIZ(i, aweme);
        if (this.LJLJJL != null && aweme != null) {
            this.LJLJJL.LIZ(aweme.getAid());
        }
    }

    public final void LIZ(long j, long j2) {
        AnonymousClass2IR LLILZ = LLILZ();
        if (!(LLILZ == null || LLILZ.LJJLIIIJLLLLLLLZ() == null || j < 0)) {
            Handler handler = this.LJJ;
            LLILZ.getClass();
            handler.postDelayed(new AnonymousClass2LD(LLILZ), j);
        }
        Otb otb = this.LJIIIZ;
        if (otb != null && otb.isShowing() && j2 >= 0) {
            this.LJJ.postDelayed(new C13282oi(this), j2);
        }
        C09942jK.LJFF.LIZJ();
    }

    public final void LIZIZ(int i, Aweme aweme) {
        if (this.LJLJJL == null || aweme == null) {
            super.LIZ(i, aweme);
        } else if (!this.LJLJJL.LIZ(aweme.getAid()) && aweme.getAid() != null) {
            LJIILL(aweme.getAid());
        }
    }

    public FullFeedFragmentPanel(String str, int i) {
        super(str, i);
        if (LLILIL()) {
            M12.LIZ(this);
            AnonymousClass2HI.LIZJ = new WeakReference<>(this);
        }
    }

    private void LIZ(Aweme aweme, int i) {
        try {
            LIZIZ(aweme, i);
            String str = BaseListFragmentPanel.LJJJJLI;
            C10772kf.LIZIZ(4, str, "insertItemAllowNextTimeOk insert success aid:" + aweme.getAid() + ",pos:" + i);
        } catch (C01492Jv unused) {
            String str2 = BaseListFragmentPanel.LJJJJLI;
            C10772kf.LIZIZ(4, str2, "insertItemAllowNextTimeOk insert fail,wait, aid:" + aweme.getAid() + ",pos:" + i);
            this.LJJIIZ.add(new 07U(aweme, Integer.valueOf(i)));
        }
    }

    public final void LIZJ(List<Aweme> list, boolean z) {
        if (LLJJIJIL()) {
            boolean z2 = false;
            this.LLFFF.setRefreshing(false);
            if (z || this.LIZLLL) {
                if (this.LIZLLL && !878.LIZ(list) && this.LJJLIIIJJI.LIZIZ() != list.size()) {
                    z2 = true;
                }
                this.LJLJLLL = z2;
                int LIZIZ2 = this.LJJLIIIJJI.LIZIZ();
                this.LJJLIIIJJI.LIZ((List<? extends Aweme>) list);
                if (!this.LIZLLL) {
                    this.LJJJLIIL.post(new AnonymousClass2LA(this));
                }
                int LIZIZ3 = this.LJJLIIIJJI.LIZIZ();
                if (LIZIZ2 < LIZIZ3 && list != null && list.size() >= LIZIZ3) {
                    LIZLLL(list.subList(LIZIZ2, LIZIZ3), true);
                }
            } else if (this.LLJZIJLIL && this.LLL != null && LIZJ()) {
                AnonymousClass3BB r1 = new AnonymousClass3BB(this.LLL);
                r1.LIZIZ(2131823637);
                r1.LIZIZ();
                if (this.LJJJLIIL.getCurrentItem() > 1) {
                    this.LJJJLIIL.LIZ(0, false);
                } else {
                    this.LJJJLIIL.setCurrentItemWithDefaultVelocity(0);
                }
            }
            LJJJJLI();
        }
    }

    public final void LIZ(AnonymousClass2EE r11, boolean z) {
        super.LIZ(r11, z);
        if (TextUtils.equals(this.LLIFFJFJJ.getEventType(), "homepage_hot")) {
            AdShowTimeGapManager adShowTimeGapManager = AdShowTimeGapManager.LJJI;
            long LJJIJIL = this.LLII.LJJIJIL();
            long LJIIIZ2 = LLFZ().LJIIIZ();
            int i = this.LLII.LJIIZILJ;
            int currentItem = this.LJJJLIIL.getCurrentItem() - 1;
            if (adShowTimeGapManager.LIZ() && currentItem >= 0 && currentItem <= AdShowTimeGapManager.LJFF.size()) {
                if (currentItem == AdShowTimeGapManager.LJFF.size()) {
                    AdShowTimeGapManager.LJFF.add(Long.valueOf(LJJIJIL + (((long) i) * LJIIIZ2)));
                    return;
                }
                ArrayList<Long> arrayList = AdShowTimeGapManager.LJFF;
                arrayList.set(currentItem, Long.valueOf(arrayList.get(currentItem).longValue() + LJJIJIL + (((long) i) * LJIIIZ2)));
            }
        }
    }

    public void LIZIZ(List<Aweme> list, boolean z) {
        if (!LLJJIJIL()) {
            C10772kf.LIZ(4, "FeedFetchModel", "FullFeedFragmentPanel receive onLoadMoreResult,but invalid");
            return;
        }
        LJJJLIIL();
        this.LLFFF.setRefreshing(false);
        this.LJJLIIIJJI.LIZJ = z;
        if (z || this.LIZLLL) {
            this.LJJJJZI.LIZLLL();
        } else {
            this.LJJJJZI.LIZJ();
        }
        Aweme LJ2 = this.LJJLIIIJJI.LJ(this.LJJJLIIL.getCurrentItem());
        if (C31723dM.LIZIZ && LJ) {
            LJ = false;
        } else if (LJ2 != null && C31713dL.LIZ) {
            8eL.LIZ().execute(new C31633dD(this, LJ2));
        }
        if (LLILIL()) {
            LLJJJJLIIL().LIZ((List<? extends Aweme>) list);
        }
        int LIZIZ2 = this.LJJLIIIJJI.LIZIZ();
        int LIZ2 = C62534lx.LIZ(list, LJ2);
        this.LJJLIIIJJI.LIZ((List<? extends Aweme>) list);
        if (!this.LJJIIZ.isEmpty()) {
            ArrayList arrayList = new ArrayList(this.LJJIIZ);
            this.LJJIIZ.clear();
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                07U r0 = (07U) it.next();
                Aweme aweme = (Aweme) r0.LIZ;
                Integer num = (Integer) r0.LIZIZ;
                String str = BaseListFragmentPanel.LJJJJLI;
                C10772kf.LIZIZ(4, str, "pendingAddAwemeList insert aid:" + aweme.getAid() + ",pos:" + num);
                LIZ(aweme, num.intValue());
            }
        }
        int LIZIZ3 = this.LJJLIIIJJI.LIZIZ();
        if (LIZIZ2 < LIZIZ3 && list != null && list.size() >= LIZIZ3) {
            LIZLLL(list.subList(LIZIZ2, LIZIZ3), true);
        }
        if (!this.LIZLLL) {
            this.LJJJLIIL.post(new AnonymousClass2HM(this, LIZ2, LJ2));
        }
        LJJJJLI();
        if (9Y3.LIZ(9Y3.LIZ(), true, "is_preload_process_data", false)) {
            LLFZ().LIZ(list);
        }
        if (LLILIL()) {
            AnonymousClass2HI r1 = AnonymousClass2HI.LIZLLL;
            if (!AnonymousClass2HI.LIZ) {
                AnonymousClass2HI.LIZ = true;
                if (AnonymousClass2HI.LIZIZ) {
                    r1.LIZ();
                }
            }
        }
    }

    public C11722mC LIZ(Context context, LayoutInflater layoutInflater, AnonymousClass2YM<Etp> r11, Fragment fragment, View.OnTouchListener onTouchListener, BaseFeedPageParams baseFeedPageParams, Cgr cgr) {
        return new C11862mQ(context, layoutInflater, r11, fragment, onTouchListener, baseFeedPageParams, cgr);
    }
}
