网页标题兼容,周星榜图片样式裁剪,推荐卡加标签

This commit is contained in:
18401019693 2022-09-22 13:30:24 +08:00
parent 6bc3019b02
commit ab2991a999
5 changed files with 83 additions and 34 deletions

View File

@ -79,6 +79,7 @@ public class RouteUtil {
public static void forwardZhuangBanActivity(String url) {
Constants.myPackageUrl = url;
ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY)
.withString("title","")
.navigation();
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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>() {

View File

@ -6,6 +6,7 @@
<ImageView
android:id="@+id/week_live"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent" />