diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index 7d97ce5f8..ee1fddaec 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -79,6 +79,7 @@ public class RouteUtil { public static void forwardZhuangBanActivity(String url) { Constants.myPackageUrl = url; ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY) + .withString("title","") .navigation(); } 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 de2b4b989..95e0e9c43 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveBean.java +++ b/live/src/main/java/com/yunbao/live/bean/LiveBean.java @@ -51,6 +51,38 @@ public class LiveBean implements Parcelable { //是否關注 1,關注 2,未關注 private String isattention = ""; private String recommendCardtype = ""; + private String recommendCardIconSizeTwo = ""; + private String recommendCardIconSizeThree = ""; + + public String getRecommendCardIconSizeTwo() { + return recommendCardIconSizeTwo; + } + + public LiveBean setRecommendCardIconSizeTwo(String recommendCardIconSizeTwo) { + this.recommendCardIconSizeTwo = recommendCardIconSizeTwo; + return this; + } + + public String getRecommendCardIcon() { + if (TextUtils.isEmpty(recommendCardIconSizeTwo)) { + if (!TextUtils.isEmpty(recommendCardIconSizeThree)) { + return recommendCardIconSizeThree; + } else { + return null; + } + } else { + return recommendCardIconSizeTwo; + } + } + + public String getRecommendCardIconSizeThree() { + return recommendCardIconSizeThree; + } + + public LiveBean setRecommendCardIconSizeThree(String recommendCardIconSizeThree) { + this.recommendCardIconSizeThree = recommendCardIconSizeThree; + return this; + } public String getRecommendcardtype() { return recommendCardtype; diff --git a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java index ec898e6c4..37ec7c66d 100644 --- a/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java @@ -19,6 +19,7 @@ import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.RelativeLayout; import androidx.annotation.RequiresApi; @@ -76,14 +77,14 @@ public class ZhuangBanActivity extends AbsActivity { lt_title = (LinearLayout) findViewById(R.id.lt_title); LinearLayout rootView = (LinearLayout) findViewById(com.yunbao.live.R.id.rootView); if (getIntent().hasExtra("title")) { + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) rootView.getLayoutParams(); + params.topMargin = DpUtil.dp2px(34); + rootView.setLayoutParams(params); if (TextUtils.isEmpty(titleString)){ lt_title.setVisibility(View.GONE); }else { if (TextUtils.equals(titleString, "blank")) { lt_title.setVisibility(View.GONE); - LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) rootView.getLayoutParams(); - params.topMargin = DpUtil.dp2px(24); - rootView.setLayoutParams(params); } else { lt_title.setVisibility(View.VISIBLE); } 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 5939f0ba8..673cd154a 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -1,13 +1,14 @@ package com.yunbao.main.views; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.text.TextUtils; import android.view.View; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + import com.jakewharton.rxbinding3.view.RxView; import com.squareup.picasso.Picasso; import com.yunbao.common.Constants; @@ -28,7 +29,7 @@ import kotlin.Unit; * 直播页面布局 */ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { - private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar,viewBg; + private ImageView mCover, liveType, mLiveIco, mType, pkico, drPkIco, pkAvatar, viewBg; private RatioRoundImageView bgs; private View views; private TextView mLiveState, mTitle, mName, mNum; @@ -65,17 +66,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { 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()) @@ -130,31 +121,54 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { liveType.setVisibility(View.GONE); mNum.setVisibility(View.GONE); } + //皇帝 + if (bean.getRecommendcardtype().equals("1")) { + if (!TextUtils.isEmpty(bean.getRecommendCardIcon())) { + liveType.setVisibility(View.VISIBLE); + Picasso.with(mContext) + .load(bean.getRecommendCardIcon()) + .into(liveType); + } + viewBg.setImageResource(R.mipmap.emperor_recommendation); + viewBg.setVisibility(View.VISIBLE); + //超皇 + } else if (bean.getRecommendcardtype().equals("2")) { + if (!TextUtils.isEmpty(bean.getRecommendCardIcon())) { + liveType.setVisibility(View.VISIBLE); + Picasso.with(mContext) + .load(bean.getRecommendCardIcon()) + .into(liveType); + } + viewBg.setImageResource(R.mipmap.superemperor_recommendation); + viewBg.setVisibility(View.VISIBLE); + } else { + viewBg.setVisibility(View.GONE); + } RxView.clicks(itemView) .throttleFirst(2, TimeUnit.SECONDS) // 才发送 2s内第1次点击按钮的事件 - .subscribe(new Observer() { - @Override - public void onSubscribe(Disposable d) { + .subscribe(new Observer() { + @Override + public void onSubscribe(Disposable d) { - } + } - @Override - public void onNext(Unit unit) { - if (listener != null) { - listener.onItemClick(bean, position); - } - } + @Override + public void onNext(Unit unit) { + if (listener != null) { + listener.onItemClick(bean, position); + } + } - @Override - public void onError(Throwable e) { + @Override + public void onError(Throwable e) { - } + } - @Override - public void onComplete() { + @Override + public void onComplete() { - } - }); + } + }); } public interface OnItemClickListener { diff --git a/main/src/main/res/layout/view_live_week_item.xml b/main/src/main/res/layout/view_live_week_item.xml index c3ef633fb..eb410dab7 100644 --- a/main/src/main/res/layout/view_live_week_item.xml +++ b/main/src/main/res/layout/view_live_week_item.xml @@ -6,6 +6,7 @@