首页皇帝推荐边框
This commit is contained in:
parent
01ea24c66c
commit
3225cf5d5f
@ -50,6 +50,15 @@ public class LiveBean implements Parcelable {
|
|||||||
private int is_rong;
|
private int is_rong;
|
||||||
//是否關注 1,關注 2,未關注
|
//是否關注 1,關注 2,未關注
|
||||||
private String isattention = "";
|
private String isattention = "";
|
||||||
|
private String recommendCardtype = "";
|
||||||
|
|
||||||
|
public String getRecommendcardtype() {
|
||||||
|
return recommendCardtype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecommendcardtype(String recommendcardtype) {
|
||||||
|
this.recommendCardtype = recommendcardtype;
|
||||||
|
}
|
||||||
|
|
||||||
public String getIsattention() {
|
public String getIsattention() {
|
||||||
return isattention;
|
return isattention;
|
||||||
|
@ -71,7 +71,7 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter<LiveBean> {
|
|||||||
TextView mNum;
|
TextView mNum;
|
||||||
ImageView mType;
|
ImageView mType;
|
||||||
ImageView live_type;
|
ImageView live_type;
|
||||||
|
ImageView viewBg;
|
||||||
ImageView mLiveIco;
|
ImageView mLiveIco;
|
||||||
TextView mLiveState;
|
TextView mLiveState;
|
||||||
MarqueeView mRvRankingList;
|
MarqueeView mRvRankingList;
|
||||||
@ -98,6 +98,7 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter<LiveBean> {
|
|||||||
live_type = (ImageView) itemView.findViewById(R.id.live_type);
|
live_type = (ImageView) itemView.findViewById(R.id.live_type);
|
||||||
views = itemView.findViewById(R.id.views);
|
views = itemView.findViewById(R.id.views);
|
||||||
bgs = itemView.findViewById(R.id.bgs);
|
bgs = itemView.findViewById(R.id.bgs);
|
||||||
|
viewBg = (ImageView) itemView.findViewById(R.id.view_bg);
|
||||||
RxView.clicks(itemView)
|
RxView.clicks(itemView)
|
||||||
.throttleFirst(2, TimeUnit.SECONDS) // 才发送 2s内第1次点击按钮的事件
|
.throttleFirst(2, TimeUnit.SECONDS) // 才发送 2s内第1次点击按钮的事件
|
||||||
.subscribe(new Observer<Unit>() {
|
.subscribe(new Observer<Unit>() {
|
||||||
@ -137,6 +138,18 @@ public class MainHomeRemFollLiveAdapter extends RefreshAdapter<LiveBean> {
|
|||||||
mRvRankingList.setVisibility(View.VISIBLE);
|
mRvRankingList.setVisibility(View.VISIBLE);
|
||||||
live_info_view.setVisibility(View.VISIBLE);
|
live_info_view.setVisibility(View.VISIBLE);
|
||||||
live_type.setImageDrawable(null);
|
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) {
|
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());
|
Log.e("t1", position + "嗯" + Height + "111啊" + bean.getContent_pic_size_two());
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
|||||||
private HeadVh mHeadVh;
|
private HeadVh mHeadVh;
|
||||||
private int mType;
|
private int mType;
|
||||||
|
|
||||||
|
|
||||||
public MainListAdapter(Context context, int type) {
|
public MainListAdapter(Context context, int type) {
|
||||||
super(context);
|
super(context);
|
||||||
mType = type;
|
mType = type;
|
||||||
|
@ -28,7 +28,7 @@ import kotlin.Unit;
|
|||||||
* 直播页面布局
|
* 直播页面布局
|
||||||
*/
|
*/
|
||||||
public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder {
|
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 RatioRoundImageView bgs;
|
||||||
private View views;
|
private View views;
|
||||||
private TextView mLiveState, mTitle, mName, mNum;
|
private TextView mLiveState, mTitle, mName, mNum;
|
||||||
@ -51,6 +51,7 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder {
|
|||||||
pkico = (ImageView) itemView.findViewById(R.id.pk_ico);
|
pkico = (ImageView) itemView.findViewById(R.id.pk_ico);
|
||||||
drPkIco = (ImageView) itemView.findViewById(R.id.dr_pk_ico);
|
drPkIco = (ImageView) itemView.findViewById(R.id.dr_pk_ico);
|
||||||
pkAvatar = (ImageView) itemView.findViewById(R.id.pk_avatar);
|
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();
|
Context mContext = itemView.getContext();
|
||||||
itemView.setTag(position);
|
itemView.setTag(position);
|
||||||
liveType.setImageDrawable(null);
|
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) {
|
if (bean.getContent_pic_size_two() != null && !bean.getContent_pic_size_two().equals("") && height <= 1920) {
|
||||||
Picasso.with(mContext)
|
Picasso.with(mContext)
|
||||||
.load(bean.getContent_pic_size_two())
|
.load(bean.getContent_pic_size_two())
|
||||||
|
@ -6,6 +6,11 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/live_info_view"
|
android:id="@+id/live_info_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -19,6 +24,7 @@
|
|||||||
android:layout_marginBottom="9dp"
|
android:layout_marginBottom="9dp"
|
||||||
android:paddingLeft="5dp">
|
android:paddingLeft="5dp">
|
||||||
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/cover"
|
android:id="@+id/cover"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -35,6 +41,13 @@
|
|||||||
app:ri_ratio="0.5"
|
app:ri_ratio="0.5"
|
||||||
app:riv_corner_radius="10dp" />
|
app:riv_corner_radius="10dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/view_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/live_type"
|
android:id="@+id/live_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -43,7 +56,6 @@
|
|||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:gravity="center" />
|
android:gravity="center" />
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/views"
|
android:id="@+id/views"
|
||||||
android:layout_width="46dp"
|
android:layout_width="46dp"
|
||||||
@ -271,4 +283,6 @@
|
|||||||
app:mvDirection="bottom_to_top"
|
app:mvDirection="bottom_to_top"
|
||||||
app:mvInterval="3000" />
|
app:mvInterval="3000" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
BIN
main/src/main/res/mipmap-xxhdpi/emperor_recommendation.png
Normal file
BIN
main/src/main/res/mipmap-xxhdpi/emperor_recommendation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
BIN
main/src/main/res/mipmap-xxhdpi/superemperor_recommendation.png
Normal file
BIN
main/src/main/res/mipmap-xxhdpi/superemperor_recommendation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Loading…
Reference in New Issue
Block a user