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

import X.1hK;
import X.8AR;
import X.AnonymousClass2EE;
import X.AnonymousClass2GO;
import X.AnonymousClass2YM;
import X.C11722mC;
import X.C11952mZ;
import X.C13102oQ;
import X.C13132oT;
import X.C31353cl;
import X.C32403eS;
import X.C32413eT;
import X.C32423eU;
import X.C32433eV;
import X.C32443eW;
import X.C34383he;
import X.Cgr;
import X.EgP;
import X.Etp;
import X.ISm;
import X.KoU;
import X.LDj;
import X.LFp;
import X.M12;
import X.OQZ;
import X.Qeg;
import X.Rc9;
import X.T3s;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.hox.Hox;
import com.ss.android.ugc.aweme.ad.preload.AdLandPagePreloadServiceImpl;
import com.ss.android.ugc.aweme.ad.preload.IAdLandPagePreloadService;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.BaseFeedPageParams;
import com.ss.android.ugc.aweme.feed.panel.FullFeedFragmentPanel;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import kotlin.h.b.n;
import org.greenrobot.eventbus.ThreadMode;

public final class PopularFeedFragmentPanel extends FullFeedFragmentPanel implements C32443eW, AnonymousClass2GO {
    public int LIZ = -1;
    public Qeg LIZIZ;

    static {
        Covode.recordClassIndex(97789);
    }

    public final Map<Integer, Object> getSubscriberEventTypes() {
        Map<Integer, Object> subscriberEventTypes = super.getSubscriberEventTypes();
        subscriberEventTypes.put(1, new Rc9(PopularFeedFragmentPanel.class, "onLandPagePopupWebShowEvent", KoU.class, ThreadMode.POSTING, 0, false));
        subscriberEventTypes.put(2, new Rc9(PopularFeedFragmentPanel.class, "onCleanModeChangedEvent", C13132oT.class, ThreadMode.MAIN, 0, false));
        subscriberEventTypes.put(3, new Rc9(PopularFeedFragmentPanel.class, "onFeedRefreshEvent", EgP.class, ThreadMode.POSTING, 0, false));
        return subscriberEventTypes;
    }

    public final void LJII() {
        LLIIJI();
    }

    public final void LIZLLL() {
        C31353cl r0 = this.LJJJJZI;
        if (r0 != null) {
            r0.LIZJ();
        }
        Qeg qeg = this.LIZIZ;
        if (qeg == null) {
            C31353cl r7 = this.LJJJJZI;
            if (r7 != null) {
                int childCount = r7.getChildCount();
                for (int i = 0; i < childCount; i++) {
                    View childAt = r7.getChildAt(i);
                    n.LIZIZ(childAt, "");
                    if (childAt instanceof OQZ) {
                        ViewGroup viewGroup = (ViewGroup) childAt;
                        int childCount2 = viewGroup.getChildCount();
                        for (int i2 = 0; i2 < childCount2; i2++) {
                            Qeg childAt2 = viewGroup.getChildAt(i2);
                            n.LIZIZ(childAt2, "");
                            if (childAt2 instanceof Qeg) {
                                Qeg qeg2 = childAt2;
                                this.LIZIZ = qeg2;
                                qeg2.setText("");
                            }
                        }
                    }
                }
                return;
            }
            return;
        }
        qeg.setText("");
    }

    public final void LIZJ(boolean z) {
        C31353cl r0 = this.LJJJJZI;
        if (r0 != null) {
            r0.setSkipTouchEvent(z);
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public PopularFeedFragmentPanel(String str) {
        super(str, 33);
        M12.LIZ(str);
    }

    @ISm
    public final void onFeedRefreshEvent(EgP egP) {
        int i;
        if (egP != null) {
            i = egP.LIZ;
        } else {
            i = -1;
        }
        this.LIZ = i;
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public final void onCleanModeChangedEvent(C13132oT r5) {
        C13102oQ LIZ2 = C13102oQ.LIZ();
        n.LIZIZ(LIZ2, "");
        boolean z = LIZ2.LIZLLL;
        T3s t3s = this.LJJJLIIL;
        if (t3s != null) {
            int childCount = t3s.getChildCount();
            for (int i = 0; i < childCount; i++) {
                AnonymousClass2EE LJIIL = LJIIL(i);
                if (LJIIL != null) {
                    LJIIL.LIZIZ(z);
                }
            }
        }
    }

    @ISm
    public final void onLandPagePopupWebShowEvent(KoU koU) {
        AnonymousClass2EE LJLLL = LJLLL();
        if (this.LLL != null) {
            C34383he r2 = Hox.LJ;
            1hK r1 = this.LLL;
            Objects.requireNonNull(r1, "null cannot be cast to non-null type androidx.fragment.app.FragmentActivity");
            if (r2.LIZ(r1).LIZJ("Popular") && LJLLL != null && LJLLL.LJIJ() != null) {
                LJLLL.LJIJ().LIZ(koU);
            }
        }
    }

    public final void LIZ(List<? extends Aweme> list, boolean z) {
        8AR LIZ2;
        LFp.LIZ(list, new C32433eV());
        LDj.LJIIIIZZ().LIZ((List<Aweme>) list);
        LFp.LIZIZ(list, new C32413eT());
        IAdLandPagePreloadService LJFF = AdLandPagePreloadServiceImpl.LJFF();
        if (!(LJFF == null || (LIZ2 = LJFF.LIZ()) == null)) {
            LIZ2.LIZ(list);
        }
        super.LIZ((List<Aweme>) list, z);
        if (z) {
            this.LJJJJZI.LIZLLL();
        } else {
            LIZLLL();
        }
    }

    public final void LIZIZ(List<? extends Aweme> list, boolean z) {
        8AR LIZ2;
        LFp.LIZ(list, new C32423eU());
        LDj.LJIIIIZZ().LIZ((List<Aweme>) list);
        LFp.LIZIZ(list, new C32403eS());
        super.LIZIZ((List<Aweme>) list, z);
        IAdLandPagePreloadService LJFF = AdLandPagePreloadServiceImpl.LJFF();
        if (LJFF != null && (LIZ2 = LJFF.LIZ()) != null) {
            LIZ2.LIZ(list);
        }
    }

    public final C11722mC LIZ(Context context, LayoutInflater layoutInflater, AnonymousClass2YM<Etp> r11, Fragment fragment, View.OnTouchListener onTouchListener, BaseFeedPageParams baseFeedPageParams, Cgr cgr) {
        BaseFeedPageParams baseFeedPageParams2 = baseFeedPageParams;
        LayoutInflater layoutInflater2 = layoutInflater;
        Cgr cgr2 = cgr;
        Context context2 = context;
        AnonymousClass2YM<Etp> r3 = r11;
        Fragment fragment2 = fragment;
        View.OnTouchListener onTouchListener2 = onTouchListener;
        M12.LIZ(context2, layoutInflater2, r3, fragment2, onTouchListener2, baseFeedPageParams2, cgr2);
        return new C11952mZ(context2, layoutInflater2, r3, fragment2, onTouchListener2, baseFeedPageParams2, cgr2);
    }
}
