package com.bjzc.zjyxdxj.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.bjzc.zjyxdxj.DBModel.QYAQFXDATABean;
import com.bjzc.zjyxdxj.R;
import com.bjzc.zjyxdxj.adapter.GwfxListAdapter;
import java.util.ArrayList;
import static com.bjzc.zjyxdxj.MyApplication.context;


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(context, qyddataBeanArrayList);
            lv.setAdapter(gwfxlistadapter);
            lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {


                }
            });


    }

}
