package com.ss.android.ugc.aweme.poi.collect.detailfeed;

import X.2Pr;
import X.BE8;
import X.BFD;
import X.BFL;
import X.C3251BDb;
import X.LsC;
import X.M12;
import android.content.Context;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.fragment.app.Fragment;
import com.bytedance.assem.arch.core.Assembler;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.foundation.fragment.BaseFragment;
import java.io.Serializable;
import java.util.Objects;
import kotlin.h.b.n;

public final class PoiCollectBarFragment extends BaseFragment {
    public static final BFL LJIIIZ = new BFL((byte) 0);
    public String LJ;
    public String LJFF = "";
    public boolean LJI;
    public String LJII;
    public BE8 LJIIIIZZ;
    public SparseArray LJIIJ;

    static {
        Covode.recordClassIndex(97436);
    }

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

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

    public final /* synthetic */ void onDestroyView() {
        PoiCollectBarFragment.super.onDestroyView();
        LJI();
    }

    public final void onSaveInstanceState(Bundle bundle) {
        M12.LIZ(bundle);
        PoiCollectBarFragment.super.onSaveInstanceState(bundle);
        bundle.putString("poi_id", this.LJ);
        bundle.putString("poi_name", this.LJFF);
        bundle.putBoolean("is_collected", this.LJI);
        bundle.putString("poi_address", this.LJII);
        bundle.putSerializable("poi_collect_mo_data", this.LJIIIIZZ);
    }

    public final void onCreate(Bundle bundle) {
        PoiCollectBarFragment.super.onCreate(bundle);
        if (bundle != null) {
            String string = bundle.getString("poi_id");
            if (string != null) {
                this.LJ = string;
            }
            String string2 = bundle.getString("poi_name");
            if (string2 != null) {
                n.LIZIZ(string2, "");
                this.LJFF = string2;
            }
            this.LJI = bundle.getBoolean("is_collected");
            String string3 = bundle.getString("poi_address");
            if (string3 != null) {
                this.LJII = string3;
            }
            Serializable serializable = bundle.getSerializable("poi_collect_mo_data");
            if (serializable != null) {
                Objects.requireNonNull(serializable, "null cannot be cast to non-null type com.ss.android.ugc.aweme.poi.collect.PoiCollectMobData");
                this.LJIIIIZZ = (BE8) serializable;
            }
        }
    }

    public final void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        PoiCollectBarFragment.super.onViewCreated(view, bundle);
        C3251BDb.LIZ((Fragment) this, (LsC<? super Assembler, 2Pr>) new BFD(this, view));
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        MethodCollector.i(15055);
        M12.LIZ(layoutInflater);
        Context context = getContext();
        if (context != null) {
            FrameLayout frameLayout = new FrameLayout(context);
            MethodCollector.o(15055);
            return frameLayout;
        }
        MethodCollector.o(15055);
        return null;
    }
}
