|
@@ -4,6 +4,7 @@ import android.graphics.Color;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
|
|
@@ -15,6 +16,7 @@ import com.cooleshow.institution.stu.bean.AlbumListBean;
|
|
|
import java.util.Date;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
+import androidx.constraintlayout.widget.Group;
|
|
|
|
|
|
/**
|
|
|
* Author by pq, Date on 2024/4/15.
|
|
@@ -38,15 +40,19 @@ public class SwitchAlbumAdapter extends BaseQuickAdapter<AlbumListBean, BaseView
|
|
|
@Override
|
|
|
protected void convert(@NonNull BaseViewHolder holder, AlbumListBean albumListBean) {
|
|
|
holder.setText(R.id.tv_name, albumListBean.getName());
|
|
|
+ TextView tv_des = holder.getView(R.id.tv_des);
|
|
|
+ Group group_lock = holder.getView(R.id.group_lock);
|
|
|
String expireTime = albumListBean.getExpireTime();
|
|
|
String tip = "";
|
|
|
if (TextUtils.isEmpty(expireTime)) {
|
|
|
tip = "暂未开通";
|
|
|
+ group_lock.setVisibility(View.VISIBLE);
|
|
|
} else {
|
|
|
+ group_lock.setVisibility(View.GONE);
|
|
|
Date date = TimeUtils.string2Date(expireTime);
|
|
|
tip = "到期时间:" + TimeUtils.date2String(date, TimeUtils.getSafeDateFormatForDay());
|
|
|
}
|
|
|
- holder.setText(R.id.tv_des, tip);
|
|
|
+ tv_des.setText(tip);
|
|
|
|
|
|
ImageView iv_cover = holder.getView(R.id.iv_cover);
|
|
|
GlideImageLoaderUtils.getInstance().loadImage(getContext(), albumListBean.getCoverImg(), iv_cover);
|
|
@@ -55,11 +61,13 @@ public class SwitchAlbumAdapter extends BaseQuickAdapter<AlbumListBean, BaseView
|
|
|
View iv_select = holder.getView(R.id.iv_select);
|
|
|
boolean isSelect = TextUtils.equals(albumListBean.getTenantGroupAlbumId(), selectId);
|
|
|
if (isSelect) {
|
|
|
+ tv_des.setTextColor(getContext().getResources().getColor(com.cooleshow.base.R.color.white));
|
|
|
iv_select.setVisibility(View.VISIBLE);
|
|
|
cs_root.setBackgroundResource(R.drawable.shape_15ffffff_10dp_border_80ffffff_1dp);
|
|
|
} else {
|
|
|
iv_select.setVisibility(View.GONE);
|
|
|
cs_root.setBackgroundColor(Color.TRANSPARENT);
|
|
|
+ tv_des.setTextColor(getContext().getResources().getColor(R.color.color_50ffffff));
|
|
|
}
|
|
|
}
|
|
|
}
|