From 2a8f6d99a5fcc5594df64e40fc9e3c88807b59bd Mon Sep 17 00:00:00 2001 From: hch <16607480311@163.com> Date: Fri, 15 Mar 2024 17:21:14 +0800 Subject: [PATCH] 2 --- .../common/activity/CommunityDetailsActivity.java | 5 ++++- .../com/yunbao/common/activity/UserHomeActivity.java | 12 +++++------- .../yunbao/common/adapter/UserCommunityAdapter.java | 5 ++++- .../yunbao/common/bean/HomeUserExhibitInfoBean.java | 8 ++++++++ common/src/main/res/layout/activity_user_home.xml | 7 +++---- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java b/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java index 47db79f..07e7e88 100644 --- a/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/CommunityDetailsActivity.java @@ -32,6 +32,7 @@ import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.OpenAdManager; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.NineGridLayout; import com.yunbao.common.views.TopGradual; @@ -302,7 +303,9 @@ public class CommunityDetailsActivity extends AbsActivity { name.setText(activeBean.getUser_name()); time.setText(activeBean.getCreate_time()); likeCount.setText(activeBean.getLove_num() + "人觉得很赞"); - content.setText(String.valueOf(JSONObject.parseObject(activeBean.getContent()).get("msg"))); + if (!StringUtil.isEmpty(activeBean.getContent())) { + content.setText(String.valueOf(JSONObject.parseObject(activeBean.getContent()).get("msg"))); + } if (activeBean.getIs_attention().equals("1")) {//关注 ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon); followName.setText("已关注"); diff --git a/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java b/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java index d010656..f0d0bf3 100644 --- a/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/UserHomeActivity.java @@ -20,6 +20,7 @@ import com.makeramen.roundedimageview.RoundedImageView; import com.ms.banner.Banner; import com.ms.banner.listener.OnBannerClickListener; import com.xuexiang.xui.widget.flowlayout.FlowTagLayout; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.R; import com.yunbao.common.adapter.LabelTagAdapter; @@ -144,12 +145,6 @@ public class UserHomeActivity extends AbsActivity { userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name()); } isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1; - if (isAnchor) { - authorLayout.setVisibility(View.VISIBLE); - levelLayout.setVisibility(View.VISIBLE); - } else { - authorLayout.setVisibility(View.GONE); - } ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar); userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称 fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量 @@ -158,16 +153,19 @@ public class UserHomeActivity extends AbsActivity { userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID userStatus.setText("");//认证状态 ImgLoader.display(UserHomeActivity.this, Integer.parseInt(String.valueOf(userInfo.getUserHomeTopInfo().getUser_sex())) == 0 ? R.mipmap.icon_man_new : R.mipmap.icon_wumen, user_sex); - ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon); + ImgLoader.display(UserHomeActivity.this, CommonAppConfig.HOST + userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon); ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon); if (isAnchor) {//是否是主播 + authorLayout.setVisibility(View.VISIBLE); + levelLayout.setVisibility(View.VISIBLE); authenticationLayout.setVisibility(View.VISIBLE); itemLayout01.setVisibility(View.VISIBLE); itemLayout02.setVisibility(View.VISIBLE); itemLayout03.setVisibility(View.VISIBLE); itemLayout04.setVisibility(View.VISIBLE); } else { + authorLayout.setVisibility(View.GONE); authenticationLayout.setVisibility(View.GONE); itemLayout03.setVisibility(View.VISIBLE); itemLayout04.setVisibility(View.VISIBLE); diff --git a/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java b/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java index 37b91bf..0fb6bb2 100644 --- a/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/UserCommunityAdapter.java @@ -18,6 +18,7 @@ import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.R; import com.yunbao.common.bean.ActiveOtherBean; import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.views.NineGridLayout; import java.util.ArrayList; @@ -94,7 +95,9 @@ public class UserCommunityAdapter extends RecyclerView.Adapter { ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar); userName.setText(bean.getUser_name()); time.setText(bean.getCreate_time()); - content.setText(String.valueOf(JSONObject.parseObject(bean.getContent()).get("msg"))); + if (!StringUtil.isEmpty(bean.getContent())) { + content.setText(String.valueOf(JSONObject.parseObject(bean.getContent()).get("msg"))); + } likeCount.setText(String.valueOf(bean.getLove_num())); comCount.setText(String.valueOf(bean.getComment_num())); shareCount.setText(String.valueOf(bean.getShare_num())); diff --git a/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java b/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java index 77e732c..7e526c7 100644 --- a/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java +++ b/common/src/main/java/com/yunbao/common/bean/HomeUserExhibitInfoBean.java @@ -6,6 +6,14 @@ public class HomeUserExhibitInfoBean extends BaseModel { public UserHomeTopInfo userHomeTopInfo; public List giftAlreadyWall; + public List getGiftAlreadyWall() { + return giftAlreadyWall; + } + + public void setGiftAlreadyWall(List giftAlreadyWall) { + this.giftAlreadyWall = giftAlreadyWall; + } + public UserHomeTopInfo getUserHomeTopInfo() { return userHomeTopInfo; } diff --git a/common/src/main/res/layout/activity_user_home.xml b/common/src/main/res/layout/activity_user_home.xml index 064641f..3493802 100644 --- a/common/src/main/res/layout/activity_user_home.xml +++ b/common/src/main/res/layout/activity_user_home.xml @@ -244,8 +244,7 @@ android:id="@+id/authorlIcon" android:layout_width="56dp" android:layout_height="20dp" - android:layout_marginLeft="5dp" - android:visibility="visible" /> + android:layout_marginLeft="5dp" /> @@ -271,8 +271,7 @@ android:id="@+id/levelIcon" android:layout_width="56dp" android:layout_height="20dp" - android:layout_marginLeft="5dp" - android:visibility="visible" /> + android:layout_marginLeft="5dp" />