package com.ss.android.ugc.aweme;

import X.1hK;
import X.BAu;
import X.C0438Ffw;
import X.C0549Fkd;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;

public class AnchorBaseFragment extends Fragment {
    public static BAu LIZIZ = BAu.NO_TYPE;
    public static final C0549Fkd LIZJ = new C0549Fkd((byte) 0);
    public C0438Ffw LIZ;
    public SparseArray LIZLLL;

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

    public void LIZ() {
        SparseArray sparseArray = this.LIZLLL;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public /* synthetic */ void onDestroyView() {
        AnchorBaseFragment.super.onDestroyView();
        LIZ();
    }

    static {
        Covode.recordClassIndex(50291);
    }

    public void onActivityCreated(Bundle bundle) {
        AnchorBaseFragment.super.onActivityCreated(bundle);
        if (getActivity() != null) {
            1hK activity = getActivity();
            if (!(activity instanceof C0438Ffw)) {
                activity = null;
            }
            this.LIZ = (C0438Ffw) activity;
        }
    }
}
