From 743f06115d554ff39b480f0e00671ca975362d1b Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 10 Aug 2022 23:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98,shouye=20ytuijian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bean/AnchorRecommendItemModel.java | 54 +++++++++---------- .../SearchRecommendBodyItemViewHolder.java | 2 +- .../fragment/SearchRecommendFragment.java | 3 ++ .../SearchRecommendBodyItemViewHolder.java | 6 +-- 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/AnchorRecommendItemModel.java b/common/src/main/java/com/yunbao/common/bean/AnchorRecommendItemModel.java index d53818f8a..c41269d80 100644 --- a/common/src/main/java/com/yunbao/common/bean/AnchorRecommendItemModel.java +++ b/common/src/main/java/com/yunbao/common/bean/AnchorRecommendItemModel.java @@ -34,9 +34,9 @@ public class AnchorRecommendItemModel extends BaseModel { */ @SerializedName("islive") - private long islive = 0; + private String islive =""; @SerializedName("uid") - private long uid = 0; + private String uid =""; @SerializedName("title") private String title = ""; @SerializedName("stream") @@ -46,21 +46,21 @@ public class AnchorRecommendItemModel extends BaseModel { @SerializedName("thumb") private String thumb = ""; @SerializedName("isvideo") - private long isvideo = 0; + private String isvideo =""; @SerializedName("type") - private int type = 0; + private String type =""; @SerializedName("type_val") private String typeVal = ""; @SerializedName("anyway") - private long anyway = 0; + private String anyway =""; @SerializedName("landscape") - private long landscape = 0; + private String landscape =""; @SerializedName("liveclassid") - private long liveclassid = 0; + private String liveclassid =""; @SerializedName("is_rong") - private long isRong = 0; + private String isRong =""; @SerializedName("hot_num") - private long hotNum = 0; + private String hotNum =""; @SerializedName("content_pic_size_one") private String contentPicSizeOne = ""; @SerializedName("content_pic_size_two") @@ -106,20 +106,20 @@ public class AnchorRecommendItemModel extends BaseModel { return this; } - public long getIslive() { + public String getIslive() { return islive; } - public AnchorRecommendItemModel setIslive(long islive) { + public AnchorRecommendItemModel setIslive(String islive) { this.islive = islive; return this; } - public long getUid() { + public String getUid() { return uid; } - public AnchorRecommendItemModel setUid(long uid) { + public AnchorRecommendItemModel setUid(String uid) { this.uid = uid; return this; } @@ -160,20 +160,20 @@ public class AnchorRecommendItemModel extends BaseModel { return this; } - public long getIsvideo() { + public String getIsvideo() { return isvideo; } - public AnchorRecommendItemModel setIsvideo(long isvideo) { + public AnchorRecommendItemModel setIsvideo(String isvideo) { this.isvideo = isvideo; return this; } - public int getType() { + public String getType() { return type; } - public AnchorRecommendItemModel setType(int type) { + public AnchorRecommendItemModel setType(String type) { this.type = type; return this; } @@ -187,47 +187,47 @@ public class AnchorRecommendItemModel extends BaseModel { return this; } - public long getAnyway() { + public String getAnyway() { return anyway; } - public AnchorRecommendItemModel setAnyway(long anyway) { + public AnchorRecommendItemModel setAnyway(String anyway) { this.anyway = anyway; return this; } - public long getLandscape() { + public String getLandscape() { return landscape; } - public AnchorRecommendItemModel setLandscape(long landscape) { + public AnchorRecommendItemModel setLandscape(String landscape) { this.landscape = landscape; return this; } - public long getLiveclassid() { + public String getLiveclassid() { return liveclassid; } - public AnchorRecommendItemModel setLiveclassid(long liveclassid) { + public AnchorRecommendItemModel setLiveclassid(String liveclassid) { this.liveclassid = liveclassid; return this; } - public long getIsRong() { + public String getIsRong() { return isRong; } - public AnchorRecommendItemModel setIsRong(long isRong) { + public AnchorRecommendItemModel setIsRong(String isRong) { this.isRong = isRong; return this; } - public long getHotNum() { + public String getHotNum() { return hotNum; } - public AnchorRecommendItemModel setHotNum(long hotNum) { + public AnchorRecommendItemModel setHotNum(String hotNum) { this.hotNum = hotNum; return this; } diff --git a/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java b/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java index f3e3c8c2f..2569f8cf4 100644 --- a/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/SearchRecommendBodyItemViewHolder.java @@ -69,7 +69,7 @@ public class SearchRecommendBodyItemViewHolder extends RecyclerView.ViewHolder { @Override public void onClick(View v) { SearchModel searchModel = new SearchModel(); - searchModel.setId(model.getUid()); + searchModel.setId(Long.parseLong(model.getUid())); Bus.get().post(new JumpUserHomeEvent(searchModel)); } }); diff --git a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java index 20e182639..295219ffa 100644 --- a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java @@ -15,6 +15,7 @@ import com.yunbao.common.fragment.BaseFragment; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.main.MainNetManager; import com.yunbao.common.manager.SearchHistoryRecordManager; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.main.R; import com.yunbao.main.adapter.SearchRecommendAdapter; @@ -84,6 +85,8 @@ public class SearchRecommendFragment extends BaseFragment { @Override public void onError(String error) { + ToastUtil.show(error); + loadData(); } }); } diff --git a/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyItemViewHolder.java index 5080bb66b..1f00e0e74 100644 --- a/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyItemViewHolder.java @@ -87,10 +87,10 @@ public class SearchRecommendBodyItemViewHolder extends RecyclerView.ViewHolder { } mNum.setText(formatBigNum.formatBigNum(String.valueOf(model.getHotNum()))); views.setVisibility(View.GONE); - if (model.getIslive() == 1) { + if (TextUtils.equals("1", model.getIslive())) { views.setVisibility(View.VISIBLE); //直播中 - mType.setImageResource(MainIconUtil.getLiveTypeIcon(model.getType())); + mType.setImageResource(MainIconUtil.getLiveTypeIcon(Integer.parseInt(model.getType()))); mType.setVisibility(View.VISIBLE); mLiveIco.setImageResource(R.mipmap.icon_main_rest_work); mNum.setVisibility(View.VISIBLE); @@ -110,7 +110,7 @@ public class SearchRecommendBodyItemViewHolder extends RecyclerView.ViewHolder { @Override public void onClick(View v) { SearchModel searchModel = new SearchModel(); - searchModel.setId(model.getUid()); + searchModel.setId(Long.parseLong(model.getUid())); Bus.get().post(new JumpUserHomeEvent(searchModel)); } });