| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package eVVM.apk.ui.adapter;
- import android.support.annotation.Nullable;
- import com.chad.library.adapter.base.BaseQuickAdapter;
- import com.chad.library.adapter.base.BaseViewHolder;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.List;
- import eVVM.apk.R;
- import eVVM.apk.ui.bean.VnListBean;
- /**
- * Created by Android Studio.
- * User: zbb
- * Date: 2019/6/6
- * Describe: VnListAdapter
- */
- public class VnListAdapter extends BaseQuickAdapter<VnListBean.DataBean, BaseViewHolder> {
- public VnListAdapter(int layoutResId, @Nullable List<VnListBean.DataBean> data) {
- super(layoutResId, data);
- }
- @Override
- protected void convert(BaseViewHolder helper, VnListBean.DataBean item) {
- helper.setText(R.id.tv_vn_username, item.getCode());
- //helper.setText(R.id.tv_vn_vnname,item.getVaccineName());
- if(item.getDatetime() != null){
- SimpleDateFormat sdfx = new SimpleDateFormat("yyyy/MM/dd");
- SimpleDateFormat sdfh = new SimpleDateFormat("yyyy-MM-dd");
- String nowTime2 = "";
- try {
- nowTime2 = sdfx.format(sdfh.parse(item.getDatetime()));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- helper.setText(R.id.tv_vn_vnnum, "" + nowTime2);
- }else{
- helper.setText(R.id.tv_vn_vnnum,"");
- }
- }
- }
|