package com.qhclh.ytzh.index.planorder;

import android.content.Intent;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseActivity;
import com.qhclh.ytzh.bean.ChickenDBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by 青花瓷 on 2017/11/29.
 */
///< 雏苗司机单
public class ChickenDriverBillActivity extends BaseActivity {
    @BindView(R.id.toolbar)
    Toolbar mToolbar;
    @BindView(R.id.lv_chickendriverbill)
    ListView lv_chickendriverbill;
    private List<ChickenDBean> chickenDBeanList;
    private ChickenDBAdapter chickenDBAdapter;

    @Override
    protected int setLayoutId() {
        return R.layout.act_chickendriverbill;
    }

    @Override
    protected void initView() {
        initToolbar(mToolbar, "雏苗司机单", new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void initData() {
        chickenDBeanList = new ArrayList<>();
        for (int i=0;i<10;i++) {
            chickenDBeanList.add(new ChickenDBean(i+5,"aaaaa"+i,i+"fffff","ssss"+i));
        }
        chickenDBAdapter = new ChickenDBAdapter(this,chickenDBeanList);
        lv_chickendriverbill.setAdapter(chickenDBAdapter);
    }

    @Override
    protected void initOper() {
        lv_chickendriverbill.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                showToast(""+l);
                startActivity(new Intent(ChickenDriverBillActivity.this,OrderOActivity.class));
            }
        });
    }
}
