You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
Java
45 lines
1.5 KiB
Java
package com.rehome.zhdcoa.adapter;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import com.rehome.zhdcoa.R;
|
|
import com.rehome.zhdcoa.entity.YxSbInfoDataBean;
|
|
import com.xuexiang.xui.adapter.recyclerview.BaseRecyclerAdapter;
|
|
import com.xuexiang.xui.adapter.recyclerview.RecyclerViewHolder;
|
|
|
|
public class YxsbsssjAdapter extends BaseRecyclerAdapter<YxSbInfoDataBean.DataBean> {
|
|
|
|
|
|
@Override
|
|
public int getItemLayoutId(int viewType) {
|
|
return R.layout.item_yxsbsssj;
|
|
}
|
|
|
|
@Override
|
|
protected void bindData(@NonNull RecyclerViewHolder holder, int position, YxSbInfoDataBean.DataBean model) {
|
|
if (model != null) {
|
|
holder.text(R.id.tv_sbmc, model.getSbmc());
|
|
|
|
|
|
if (model.getZx_zt().equals("1")) {
|
|
holder.text(R.id.tv_zxzt, "在线");
|
|
holder.textColorId(R.id.tv_zxzt, R.color.green);
|
|
} else if (model.getZx_zt().equals("0")) {
|
|
holder.text(R.id.tv_zxzt, "断线");
|
|
holder.textColorId(R.id.tv_zxzt, R.color.red);
|
|
} else {
|
|
holder.text(R.id.tv_zxzt, "未知");
|
|
}
|
|
|
|
if (model.getBj_zt().equals("0")) {
|
|
holder.text(R.id.tv_bjzt, "正常");
|
|
} else if (model.getZx_zt().equals("1")) {
|
|
holder.text(R.id.tv_bjzt, "预警");
|
|
} else if (model.getZx_zt().equals("2")) {
|
|
holder.text(R.id.tv_bjzt, "报警");
|
|
holder.textColorId(R.id.tv_bjzt, R.color.red);
|
|
}
|
|
}
|
|
}
|
|
}
|