网页标题兼容,周星榜图片样式裁剪,推荐卡加标签
This commit is contained in:
parent
6bc3019b02
commit
ab2991a999
@ -79,6 +79,7 @@ public class RouteUtil {
|
||||
public static void forwardZhuangBanActivity(String url) {
|
||||
Constants.myPackageUrl = url;
|
||||
ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY)
|
||||
.withString("title","")
|
||||
.navigation();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,6 +121,29 @@ 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<Unit>() {
|
||||
|
@ -6,6 +6,7 @@
|
||||
<ImageView
|
||||
android:id="@+id/week_live"
|
||||
android:layout_width="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user