use of aunguyen.quanlycongviec.Object.EmployeeObject in project NienLuanChuyenNganh-Android by AuNguyenTrungNguyen.
the class SelectEmployeeToJobAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull final SelectEmployeeToJobViewHolder holder, final int position) {
EmployeeObject employeeObject = employeeObjectList.get(position);
Glide.with(context).load(employeeObject.getUrlAvatar()).into(holder.imgAvatar);
holder.tvNameEmployee.setText(employeeObject.getNameEmployee());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
boolean isCheck = listCheck.get(position);
if (isCheck) {
listCheck.set(position, false);
holder.cvSelected.setCardBackgroundColor(Color.WHITE);
} else {
listCheck.set(position, true);
holder.cvSelected.setCardBackgroundColor(Color.GREEN);
}
}
});
}
Aggregations