|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.unionmed.unionmedtv.adapter; |
|
|
|
package com.unionmed.unionmedtv.adapter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.text.TextUtils; |
|
|
|
import android.view.View; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.ImageView; |
|
|
|
import android.widget.ImageView; |
|
|
|
import android.widget.TextView; |
|
|
|
import android.widget.TextView; |
|
|
@ -32,64 +33,64 @@ public class ContractedDoctorAdapter extends BaseQuickAdapter<GetContractedDocto |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void convert(@NotNull BaseViewHolder vh, GetContractedDoctorApi.DoctorInfo.MemberBean memberBean) { |
|
|
|
protected void convert(@NotNull BaseViewHolder vh, GetContractedDoctorApi.DoctorInfo.MemberBean memberBean) { |
|
|
|
// TextView tv_online_status = vh.getView(R.id.tv_online_status);
|
|
|
|
TextView tv_online_status = vh.getView(R.id.tv_online_status); |
|
|
|
// int drawable;
|
|
|
|
int drawable; |
|
|
|
// if (memberBean.getOnline().equals("1")) {
|
|
|
|
if (memberBean.getOnline().equals("1")) { |
|
|
|
// tv_online_status.setText("在线");
|
|
|
|
tv_online_status.setText("在线"); |
|
|
|
// tv_online_status.setBackground(getContext().getResources().getDrawable(R.drawable.shape_corner15_color_0bbac6));
|
|
|
|
tv_online_status.setBackground(getContext().getResources().getDrawable(R.drawable.shape_corner15_color_0bbac6)); |
|
|
|
// drawable = R.mipmap.icon_default_online;
|
|
|
|
drawable = R.mipmap.icon_default_online; |
|
|
|
// } else {
|
|
|
|
} else { |
|
|
|
// tv_online_status.setText("离线");
|
|
|
|
tv_online_status.setText("离线"); |
|
|
|
// drawable = R.mipmap.icon_default_offline;
|
|
|
|
drawable = R.mipmap.icon_default_offline; |
|
|
|
// tv_online_status.setBackground(getContext().getResources().getDrawable(R.drawable.shape_corner15_color_9a9a9a));
|
|
|
|
tv_online_status.setBackground(getContext().getResources().getDrawable(R.drawable.shape_corner15_color_9a9a9a)); |
|
|
|
// }
|
|
|
|
} |
|
|
|
// ImageView iv_photo = vh.getView(R.id.iv_photo);
|
|
|
|
ImageView iv_photo = vh.getView(R.id.iv_photo); |
|
|
|
// Glide.with(getContext())
|
|
|
|
Glide.with(getContext()) |
|
|
|
// .load(memberBean.getPhoto())
|
|
|
|
.load(memberBean.getPhoto()) |
|
|
|
// .apply(new RequestOptions()
|
|
|
|
.apply(new RequestOptions() |
|
|
|
// .circleCrop()
|
|
|
|
.circleCrop() |
|
|
|
// .placeholder(drawable)
|
|
|
|
.placeholder(drawable) |
|
|
|
// .circleCrop())
|
|
|
|
.circleCrop()) |
|
|
|
// .into(iv_photo);
|
|
|
|
.into(iv_photo); |
|
|
|
// TextView tv_name = vh.getView(R.id.tv_name);
|
|
|
|
TextView tv_name = vh.getView(R.id.tv_name); |
|
|
|
// tv_name.setText(memberBean.getName());
|
|
|
|
tv_name.setText(memberBean.getName()); |
|
|
|
// TextView tv_dept = vh.getView(R.id.tv_dept);
|
|
|
|
TextView tv_dept = vh.getView(R.id.tv_dept); |
|
|
|
// if (!memberBean.getPersoninfo().isEmpty()) {
|
|
|
|
if (!memberBean.getPersoninfo().isEmpty()) { |
|
|
|
// if (!memberBean.getPersoninfo().get(0).getDepartment().isEmpty()
|
|
|
|
if (!memberBean.getPersoninfo().get(0).getDepartment().isEmpty() |
|
|
|
// && !memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门职称都不为null
|
|
|
|
&& !memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门职称都不为null
|
|
|
|
// tv_dept.setText(memberBean.getPersoninfo().get(0).getDepartment()
|
|
|
|
tv_dept.setText(memberBean.getPersoninfo().get(0).getDepartment() |
|
|
|
// + " | " + memberBean.getPersoninfo().get(0).getZc());
|
|
|
|
+ " | " + memberBean.getPersoninfo().get(0).getZc()); |
|
|
|
// } else if (memberBean.getPersoninfo().get(0).getDepartment().isEmpty()
|
|
|
|
} else if (memberBean.getPersoninfo().get(0).getDepartment().isEmpty() |
|
|
|
// && memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门职称都为null
|
|
|
|
&& memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门职称都为null
|
|
|
|
// tv_dept.setText("- -");
|
|
|
|
tv_dept.setText("- -"); |
|
|
|
// } else if (!memberBean.getPersoninfo().get(0).getDepartment().isEmpty()
|
|
|
|
} else if (!memberBean.getPersoninfo().get(0).getDepartment().isEmpty() |
|
|
|
// && memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门不为null,职称为null
|
|
|
|
&& memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门不为null,职称为null
|
|
|
|
// tv_dept.setText(memberBean.getPersoninfo().get(0).getDepartment());
|
|
|
|
tv_dept.setText(memberBean.getPersoninfo().get(0).getDepartment()); |
|
|
|
// } else if (memberBean.getPersoninfo().get(0).getDepartment().isEmpty()
|
|
|
|
} else if (memberBean.getPersoninfo().get(0).getDepartment().isEmpty() |
|
|
|
// && !memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门为null,职称不为null
|
|
|
|
&& !memberBean.getPersoninfo().get(0).getZc().isEmpty()) {//部门为null,职称不为null
|
|
|
|
// tv_dept.setText(memberBean.getPersoninfo().get(0).getZc());
|
|
|
|
tv_dept.setText(memberBean.getPersoninfo().get(0).getZc()); |
|
|
|
// }
|
|
|
|
} |
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
} else { |
|
|
|
// tv_dept.setText("- -");
|
|
|
|
tv_dept.setText("- -"); |
|
|
|
// tv_dept.setText("- -");
|
|
|
|
tv_dept.setText("- -"); |
|
|
|
// }
|
|
|
|
} |
|
|
|
// TextView tv_hospital = vh.getView(R.id.tv_hospital);
|
|
|
|
TextView tv_hospital = vh.getView(R.id.tv_hospital); |
|
|
|
// tv_hospital.setText(memberBean.getPersoninfo().get(0).getChosname());
|
|
|
|
tv_hospital.setText(memberBean.getPersoninfo().get(0).getChosname()); |
|
|
|
// ImageView iv_sex = vh.getView(R.id.iv_sex);
|
|
|
|
ImageView iv_sex = vh.getView(R.id.iv_sex); |
|
|
|
// if (memberBean.getSex().equals("男")) {
|
|
|
|
if (memberBean.getSex().equals("男")) { |
|
|
|
// iv_sex.setImageDrawable(getContext().getResources().getDrawable(R.drawable.icon_sex_boy));
|
|
|
|
iv_sex.setImageDrawable(getContext().getResources().getDrawable(R.drawable.icon_sex_boy)); |
|
|
|
// } else {
|
|
|
|
} else { |
|
|
|
// iv_sex.setImageDrawable(getContext().getResources().getDrawable(R.drawable.icon_sex_girl));
|
|
|
|
iv_sex.setImageDrawable(getContext().getResources().getDrawable(R.drawable.icon_sex_girl)); |
|
|
|
// }
|
|
|
|
} |
|
|
|
// TextView tv_distance = vh.getView(R.id.tv_distance);
|
|
|
|
TextView tv_distance = vh.getView(R.id.tv_distance); |
|
|
|
// if (memberBean.getDistance().isEmpty()) {
|
|
|
|
if (TextUtils.isEmpty(memberBean.getDistance())) { |
|
|
|
// tv_distance.setVisibility(View.GONE);
|
|
|
|
tv_distance.setVisibility(View.GONE); |
|
|
|
// } else {
|
|
|
|
} else { |
|
|
|
// tv_distance.setVisibility(View.VISIBLE);
|
|
|
|
tv_distance.setVisibility(View.VISIBLE); |
|
|
|
// tv_distance.setText(memberBean.getDistance());
|
|
|
|
tv_distance.setText(memberBean.getDistance()); |
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
vh.itemView.setOnClickListener(new View.OnClickListener() { |
|
|
|
vh.itemView.setOnClickListener(new View.OnClickListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|