1:修改mqtt链接适用域名链接
2:修改粉丝列表展示按钮错误的问题
This commit is contained in:
@@ -20,10 +20,11 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/19
|
||||
*@description: 黑名单、关注、粉丝列表适配器
|
||||
* @author qx
|
||||
* @data 2025/5/19
|
||||
* @description: 黑名单、关注、粉丝列表适配器
|
||||
*/
|
||||
public class BlackAdapter extends BaseQuickAdapter<BlackUserBean, BaseViewHolder> {
|
||||
|
||||
@@ -45,9 +46,9 @@ public class BlackAdapter extends BaseQuickAdapter<BlackUserBean, BaseViewHolder
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, BlackUserBean item) {
|
||||
MeHeadView headView = helper.getView(R.id.im_user);
|
||||
headView.setData(item.getAvatar(), "", "");
|
||||
headView.setData(item.getAvatar(), "", "");
|
||||
helper.setText(R.id.tv_nick_name, item.getNickname());
|
||||
TextView imageView= helper.getView(R.id.im_g);
|
||||
TextView imageView = helper.getView(R.id.im_g);
|
||||
helper.setText(R.id.tv_oline, item.getIs_online() == 1 ? "[在线]" : "[离线]");
|
||||
// 根据 type 设置图片资源
|
||||
// 根据 type 和 status 设置图片资源
|
||||
@@ -55,33 +56,33 @@ public class BlackAdapter extends BaseQuickAdapter<BlackUserBean, BaseViewHolder
|
||||
if (item.getType() == 0) { // 关注
|
||||
if (item.getIs_follow() == 0) {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.gz);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(imageView, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
imageView.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
imageView.setText("关注");
|
||||
} else {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.yigz);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, Color.parseColor("#EFF2F8"), 34);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(imageView, Color.parseColor("#EFF2F8"), 34);
|
||||
imageView.setTextColor(Color.BLACK);
|
||||
imageView.setText("已关注");
|
||||
}
|
||||
} else if (item.getType() == 1) { // 黑名单
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.yic);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, Color.parseColor("#333333"), 34);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(imageView, Color.parseColor("#333333"), 34);
|
||||
imageView.setTextColor(Color.WHITE);
|
||||
imageView.setText("移除");
|
||||
} else if (item.getType() == 2) { // 粉丝
|
||||
if (item.getIs_follow() == 0) {
|
||||
if (item.getIs_follow() != 1) { //只有等于1的时候,是已经关注了,等于0或者2的时候,都是需要回关别人,显示回关按钮
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.hg);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(imageView, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
imageView.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
imageView.setText("回关");
|
||||
} else {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.yigz);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, Color.parseColor("#EFF2F8"), 34);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(imageView, Color.parseColor("#EFF2F8"), 34);
|
||||
imageView.setTextColor(Color.BLACK);
|
||||
imageView.setText("已关注");
|
||||
}
|
||||
}else if (item.getType() == 3){
|
||||
} else if (item.getType() == 3) {
|
||||
imageView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -91,13 +92,13 @@ public class BlackAdapter extends BaseQuickAdapter<BlackUserBean, BaseViewHolder
|
||||
onItemClickListener.onItemClick(item);
|
||||
}
|
||||
});
|
||||
LinearLayout llContainer =helper.getView(R.id.ll_in);
|
||||
LinearLayout llContainer = helper.getView(R.id.ll_in);
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
|
||||
List<String> images = item.getIcon(); // 获取图片列表
|
||||
|
||||
for (String url : images) {
|
||||
if (url.contains("http")) {
|
||||
if (url != null && url.contains("http")) {
|
||||
ImageView imageView1 = new ImageView(getContext());
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
|
||||
@@ -117,8 +118,8 @@ public class BlackAdapter extends BaseQuickAdapter<BlackUserBean, BaseViewHolder
|
||||
headView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (item.getType() !=1){
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id()+"").navigation();
|
||||
if (item.getType() != 1) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id() + "").navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user