diff --git a/live/src/main/java/com/yunbao/live/bean/LiveBean.java b/live/src/main/java/com/yunbao/live/bean/LiveBean.java index c47c04d95..de2b4b989 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveBean.java @@ -50,6 +50,15 @@ public class LiveBean implements Parcelable { private int is_rong; //是否關注 1,關注 2,未關注 private String isattention = ""; + private String recommendCardtype = ""; + + public String getRecommendcardtype() { + return recommendCardtype; + } + + public void setRecommendcardtype(String recommendcardtype) { + this.recommendCardtype = recommendcardtype; + } public String getIsattention() { return isattention; diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java index d500b999a..1a43e9696 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java @@ -71,7 +71,7 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter { TextView mNum; ImageView mType; ImageView live_type; - + ImageView viewBg; ImageView mLiveIco; TextView mLiveState; MarqueeView mRvRankingList; @@ -98,6 +98,7 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter { live_type = (ImageView) itemView.findViewById(R.id.live_type); views = itemView.findViewById(R.id.views); bgs = itemView.findViewById(R.id.bgs); + viewBg = (ImageView) itemView.findViewById(R.id.view_bg); RxView.clicks(itemView) .throttleFirst(2, TimeUnit.SECONDS) // 才发送 2s内第1次点击按钮的事件 .subscribe(new Observer() { @@ -137,6 +138,18 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter { mRvRankingList.setVisibility(View.VISIBLE); live_info_view.setVisibility(View.VISIBLE); live_type.setImageDrawable(null); + viewBg.setVisibility(View.GONE); + //皇帝 + if(bean.getRecommendcardtype().equals("1")){ + viewBg.setImageResource(R.mipmap.emperor_recommendation); + viewBg.setVisibility(View.VISIBLE); + //超皇 + }else if(bean.getRecommendcardtype().equals("2")){ + viewBg.setImageResource(R.mipmap.superemperor_recommendation); + viewBg.setVisibility(View.VISIBLE); + }else{ + viewBg.setVisibility(View.GONE); + } if (bean.getContent_pic_size_two() != null && !bean.getContent_pic_size_two().equals("") && Height <= 1920) { Log.e("t1", position + "嗯" + Height + "111啊" + bean.getContent_pic_size_two()); diff --git a/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java index 026336a26..6d4f58960 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java @@ -54,6 +54,7 @@ public class MainListAdapter extends RefreshAdapter { private HeadVh mHeadVh; private int mType; + public MainListAdapter(Context context, int type) { super(context); mType = type; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java index 0af5096e6..5939f0ba8 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -28,7 +28,7 @@ import kotlin.Unit; * 直播页面布局 */ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { - private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar; + private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar,viewBg; private RatioRoundImageView bgs; private View views; private TextView mLiveState, mTitle, mName, mNum; @@ -51,6 +51,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { pkico = (ImageView) itemView.findViewById(R.id.pk_ico); drPkIco = (ImageView) itemView.findViewById(R.id.dr_pk_ico); pkAvatar = (ImageView) itemView.findViewById(R.id.pk_avatar); + viewBg = (ImageView) itemView.findViewById(R.id.view_bg); } /** @@ -63,6 +64,18 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { Context mContext = itemView.getContext(); itemView.setTag(position); liveType.setImageDrawable(null); + viewBg.setVisibility(View.GONE); + //皇帝 + if(bean.getRecommendcardtype().equals("1")){ + viewBg.setImageResource(R.mipmap.emperor_recommendation); + viewBg.setVisibility(View.VISIBLE); + //超皇 + }else if(bean.getRecommendcardtype().equals("2")){ + viewBg.setImageResource(R.mipmap.superemperor_recommendation); + viewBg.setVisibility(View.VISIBLE); + }else{ + viewBg.setVisibility(View.GONE); + } if (bean.getContent_pic_size_two() != null && !bean.getContent_pic_size_two().equals("") && height <= 1920) { Picasso.with(mContext) .load(bean.getContent_pic_size_two()) diff --git a/main/src/main/res/layout/item_main_home_lives.xml b/main/src/main/res/layout/item_main_home_lives.xml index cb54ba095..a9649e8ac 100644 --- a/main/src/main/res/layout/item_main_home_lives.xml +++ b/main/src/main/res/layout/item_main_home_lives.xml @@ -6,6 +6,11 @@ android:gravity="center" android:orientation="vertical"> + + + + + + - + + \ No newline at end of file diff --git a/main/src/main/res/mipmap-xxhdpi/emperor_recommendation.png b/main/src/main/res/mipmap-xxhdpi/emperor_recommendation.png new file mode 100644 index 000000000..6b4127d3d Binary files /dev/null and b/main/src/main/res/mipmap-xxhdpi/emperor_recommendation.png differ diff --git a/main/src/main/res/mipmap-xxhdpi/superemperor_recommendation.png b/main/src/main/res/mipmap-xxhdpi/superemperor_recommendation.png new file mode 100644 index 000000000..f691e9327 Binary files /dev/null and b/main/src/main/res/mipmap-xxhdpi/superemperor_recommendation.png differ