package com.ss.android.ugc.aweme.detail.ui.story;

import X.7he;
import X.AnonymousClass2GO;
import X.AnonymousClass2KM;
import X.AnonymousClass2KN;
import X.AnonymousClass2TN;
import X.BCs;
import X.C01292Jb;
import X.C03872Sz;
import X.C07882g0;
import X.ClS;
import X.Crj;
import X.LnI;
import X.M12;
import X.T5D;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.detail.panel.DetailFragmentPanel;
import com.ss.android.ugc.aweme.detail.ui.DetailPageFragment;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import kotlin.h.b.n;

public class StoryDetailPageFragment extends DetailPageFragment implements AnonymousClass2GO {
    public final int LJIJ;
    public int LJIJI;
    public int LJIJJ;
    public final Crj LJIJJLI = 7he.LIZ(new C07882g0(this));
    public SparseArray LJIL;

    static {
        Covode.recordClassIndex(63919);
    }

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

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

    public final C01292Jb LJIIIIZZ() {
        return (C01292Jb) this.LJIJJLI.getValue();
    }

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

    public StoryDetailPageFragment() {
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        this.LJIJ = LnI.LIZ(TypedValue.applyDimension(1, 40.0f, system.getDisplayMetrics()));
    }

    public final void LJFF() {
        String str;
        Aweme LLJLLIL;
        if (n.LIZ(this.LJIIIZ.getFrom(), "STORY_ENTRANCE_INBOX_TOP_LIST")) {
            ClS clS = ClS.LIZIZ;
            DetailFragmentPanel detailFragmentPanel = this.LJIIJ;
            if (detailFragmentPanel == null || (LLJLLIL = detailFragmentPanel.LLJLLIL()) == null || (str = LLJLLIL.getAid()) == null) {
                str = "";
            }
            clS.LIZIZ("notification_page", "click", str);
        }
        StoryDetailPageFragment.super.LJFF();
    }

    public void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        StoryDetailPageFragment.super.onViewCreated(view, bundle);
        AnonymousClass2TN r1 = (AnonymousClass2TN) view.findViewById(2131369737);
        if (r1 != null) {
            r1.setChildListCanVerticalScrollCallback(new AnonymousClass2KM(this));
        }
        T5D findViewById = view.findViewById(2131370545);
        if (findViewById != null) {
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            findViewById.setMaxOverScrollDistance(TypedValue.applyDimension(1, 200.0f, system.getDisplayMetrics()));
            findViewById.setRubberBandCoefficient(0.4f);
            findViewById.setOnScrollChangeListener(new C03872Sz(this));
            findViewById.setOnTouchListener(new AnonymousClass2KN(this));
        }
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return BCs.LIZ.LIZ(getActivity(), 2131559534, layoutInflater, viewGroup);
    }
}
