package com.rehome.sgbaxj.activity.sbxdj;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import com.rehome.sgbaxj.DBModel.QYAQFXDATABean;
import com.rehome.sgbaxj.R;
import com.rehome.sgbaxj.adapter.GwfxListAdapter;
import com.rehome.sgbaxj.MyApplication;

import java.util.ArrayList;


public class FXFragment extends Fragment {


    ListView lv;
    private ArrayList<QYAQFXDATABean> qyddataBeanArrayList;
    GwfxListAdapter gwfxlistadapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_fx, container, false);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        qyddataBeanArrayList = new ArrayList<>();
        requestDatas();
    }

    private void requestDatas() {
        Bundle bundle = getActivity().getIntent().getExtras();
        qyddataBeanArrayList = bundle.getParcelableArrayList("QYFXTS");
        setAdapter();
    }

    private void setAdapter() {
            gwfxlistadapter = new GwfxListAdapter(MyApplication.context, qyddataBeanArrayList);
            lv.setAdapter(gwfxlistadapter);
            lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {


                }
            });


    }

}
