心愿单直播间轮播入口
This commit is contained in:
parent
c4ae047a4b
commit
849677e50e
@ -1,6 +1,7 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2019/3/30.
|
* Created by cxf on 2019/3/30.
|
||||||
@ -15,8 +16,80 @@ public class BannerBean {
|
|||||||
private String mIntoUrl;
|
private String mIntoUrl;
|
||||||
private int type;
|
private int type;
|
||||||
private String name;
|
private String name;
|
||||||
private int activityId=0;
|
private int activityId = 0;
|
||||||
private int mIconRes;
|
private int mIconRes;
|
||||||
|
//心愿单展示数据
|
||||||
|
@SerializedName("wishlist_icon")
|
||||||
|
private String wishlistIcon;
|
||||||
|
@SerializedName("wishlist_num")
|
||||||
|
private String wishlistNum;
|
||||||
|
@SerializedName("wishlist_progress")
|
||||||
|
private String wishlistProgress;
|
||||||
|
@SerializedName("wishlist_name")
|
||||||
|
private String wishlistName;
|
||||||
|
|
||||||
|
public String getmImageUrl() {
|
||||||
|
return mImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setmImageUrl(String mImageUrl) {
|
||||||
|
this.mImageUrl = mImageUrl;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getmLink() {
|
||||||
|
return mLink;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setmLink(String mLink) {
|
||||||
|
this.mLink = mLink;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getmIconRes() {
|
||||||
|
return mIconRes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setmIconRes(int mIconRes) {
|
||||||
|
this.mIconRes = mIconRes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistIcon() {
|
||||||
|
return wishlistIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setWishlistIcon(String wishlistIcon) {
|
||||||
|
this.wishlistIcon = wishlistIcon;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistNum() {
|
||||||
|
return wishlistNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setWishlistNum(String wishlistNum) {
|
||||||
|
this.wishlistNum = wishlistNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistProgress() {
|
||||||
|
return wishlistProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setWishlistProgress(String wishlistProgress) {
|
||||||
|
this.wishlistProgress = wishlistProgress;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWishlistName() {
|
||||||
|
return wishlistName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BannerBean setWishlistName(String wishlistName) {
|
||||||
|
this.wishlistName = wishlistName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
private StarChallengeStatusModel model;
|
private StarChallengeStatusModel model;
|
||||||
|
|
||||||
@ -80,22 +153,27 @@ public class BannerBean {
|
|||||||
public int getType() {
|
public int getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(name = "type")
|
@JSONField(name = "type")
|
||||||
public void setType(int type) {
|
public void setType(int type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(name = "name")
|
@JSONField(name = "name")
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(name = "name")
|
@JSONField(name = "name")
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(name = "active_id")
|
@JSONField(name = "active_id")
|
||||||
public int getActivityId() {
|
public int getActivityId() {
|
||||||
return activityId;
|
return activityId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(name = "active_id")
|
@JSONField(name = "active_id")
|
||||||
public void setActivityId(int activityId) {
|
public void setActivityId(int activityId) {
|
||||||
this.activityId = activityId;
|
this.activityId = activityId;
|
||||||
|
@ -30,6 +30,17 @@ public class EnterRoomNewModel extends BaseModel {
|
|||||||
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
private List<LiveRoomActivityModel> liveRoomActivityModels = new ArrayList<>();//活动列表
|
||||||
@SerializedName("clarityType")
|
@SerializedName("clarityType")
|
||||||
private int clarityType;
|
private int clarityType;
|
||||||
|
@SerializedName("wishListProgress")
|
||||||
|
private WishModel wishListProgress;
|
||||||
|
|
||||||
|
public WishModel getWishListProgress() {
|
||||||
|
return wishListProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnterRoomNewModel setWishListProgress(WishModel wishListProgress) {
|
||||||
|
this.wishListProgress = wishListProgress;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
|
||||||
return liveRoomActivityModels;
|
return liveRoomActivityModels;
|
||||||
|
5
common/src/main/res/drawable/bg_live_wish_top.xml
Normal file
5
common/src/main/res/drawable/bg_live_wish_top.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
<solid android:color="#50000000" />
|
||||||
|
</shape>
|
@ -1112,5 +1112,6 @@
|
|||||||
<string name="live_use_discount_content">您有一張%s,是否使用?使用後開通花費鉆石%s,返還金豆%s</string>
|
<string name="live_use_discount_content">您有一張%s,是否使用?使用後開通花費鉆石%s,返還金豆%s</string>
|
||||||
<string name="live_use_discount_no">不使用</string>
|
<string name="live_use_discount_no">不使用</string>
|
||||||
<string name="live_use_discount_yes">使用</string>
|
<string name="live_use_discount_yes">使用</string>
|
||||||
|
<string name="live_use_wish">心願</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -44,7 +44,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.SizeUtils;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.bumptech.glide.load.DataSource;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
@ -87,6 +86,7 @@ import com.yunbao.common.bean.RewardAllModel;
|
|||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
import com.yunbao.common.bean.TaskModel;
|
import com.yunbao.common.bean.TaskModel;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
|
import com.yunbao.common.bean.WishModel;
|
||||||
import com.yunbao.common.event.AnchorInfoEvent;
|
import com.yunbao.common.event.AnchorInfoEvent;
|
||||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
@ -1918,7 +1918,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
ToastUtil.show( R.string.net_error);
|
ToastUtil.show(R.string.net_error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4401,6 +4401,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
});
|
});
|
||||||
enterRoomLeave.startAnimation(animationSet1);
|
enterRoomLeave.startAnimation(animationSet1);
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveAnchorSayModel sayModel;
|
LiveAnchorSayModel sayModel;
|
||||||
|
|
||||||
public void initAnchorSayData() {
|
public void initAnchorSayData() {
|
||||||
@ -4455,7 +4456,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
initAnchorSayData();
|
initAnchorSayData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideAnchorSayAndCallAnchor(){
|
public void hideAnchorSayAndCallAnchor() {
|
||||||
mAnchorSay.setX((float) mAnchorSayImage.getTag());
|
mAnchorSay.setX((float) mAnchorSayImage.getTag());
|
||||||
mAnchorSayImage.setTag(null);
|
mAnchorSayImage.setTag(null);
|
||||||
mAnchorSayImage.setVisibility(View.VISIBLE);
|
mAnchorSayImage.setVisibility(View.VISIBLE);
|
||||||
@ -4463,7 +4464,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show);
|
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show);
|
||||||
topBanner1.setVisibility(View.GONE);
|
topBanner1.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
public void showAnchorSayAndCallAnchor(){
|
|
||||||
|
public void showAnchorSayAndCallAnchor() {
|
||||||
mAnchorSayImage.setTag(mAnchorSay.getX());
|
mAnchorSayImage.setTag(mAnchorSay.getX());
|
||||||
mAnchorSay.setX(-DpUtil.dp2px(45));
|
mAnchorSay.setX(-DpUtil.dp2px(45));
|
||||||
mAnchorSayImage.setVisibility(View.INVISIBLE);
|
mAnchorSayImage.setVisibility(View.INVISIBLE);
|
||||||
@ -4471,6 +4473,26 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide);
|
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide);
|
||||||
topBanner1.setVisibility(View.VISIBLE);
|
topBanner1.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateTopBanner(WishModel wishListProgress) {
|
||||||
|
if (mTopBannerList == null) {
|
||||||
|
mTopBannerList = new ArrayList<>();
|
||||||
|
}
|
||||||
|
topBanner1.setVisibility(View.VISIBLE);
|
||||||
|
BannerBean bannerBean = new BannerBean();
|
||||||
|
bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon())
|
||||||
|
.setWishlistName(wishListProgress.getWishlistName())
|
||||||
|
.setWishlistNum(wishListProgress.getWishlistNum())
|
||||||
|
.setWishlistProgress(wishListProgress.getWishlistProgress())
|
||||||
|
.setmLink(CommonAppConfig.HOST + "/index.php")
|
||||||
|
.setType(1)
|
||||||
|
|
||||||
|
;
|
||||||
|
bannerBean.setShow_type("2");
|
||||||
|
mTopBannerList.add(bannerBean);
|
||||||
|
topBanner1.update(mTopBannerList);
|
||||||
|
}
|
||||||
|
|
||||||
public void initTopBanner() {
|
public void initTopBanner() {
|
||||||
checkNewLetter();
|
checkNewLetter();
|
||||||
mTopBannerList = new ArrayList<>();
|
mTopBannerList = new ArrayList<>();
|
||||||
@ -4498,6 +4520,32 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
bundle.putBoolean("isContactGift", true);
|
bundle.putBoolean("isContactGift", true);
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||||
|
} else {
|
||||||
|
BannerBean bean = mTopBannerList.get(position);
|
||||||
|
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||||
|
String type = "";
|
||||||
|
StringBuffer htmlUrl = new StringBuffer();
|
||||||
|
htmlUrl.append(bean.getLink())
|
||||||
|
.append(bean.getLink().contains("?") ? "&uid=" : "?uid=")
|
||||||
|
.append(userInfo.getId())
|
||||||
|
.append("&token=")
|
||||||
|
.append(userInfo.getToken())
|
||||||
|
.append("&anchorUid=")
|
||||||
|
.append(mLiveUid)
|
||||||
|
.append("&liveUid=")
|
||||||
|
.append(mLiveUid)
|
||||||
|
.append("&t=")
|
||||||
|
.append(System.currentTimeMillis())
|
||||||
|
.append("&g=Appapi&m=Wish&a=index");
|
||||||
|
if (TextUtils.equals(type, "1")) {
|
||||||
|
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
|
||||||
|
} else {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("url", htmlUrl.toString());
|
||||||
|
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
||||||
|
fragment.setArguments(bundle);
|
||||||
|
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -479,7 +479,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLiveRoomViewHolder.initAnchorSay();
|
mLiveRoomViewHolder.initAnchorSay();
|
||||||
//初始化顶部banner
|
//初始化顶部banner
|
||||||
mLiveRoomViewHolder.initTopBanner();
|
mLiveRoomViewHolder.initTopBanner();
|
||||||
|
//心愿单顶部bannner
|
||||||
|
mLiveRoomViewHolder.updateTopBanner(data.getWishListProgress());
|
||||||
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
|
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
|
||||||
if (isattention == 0) {
|
if (isattention == 0) {
|
||||||
if (countDownTimer != null) {
|
if (countDownTimer != null) {
|
||||||
|
@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.ms.banner.holder.BannerViewHolder;
|
import com.ms.banner.holder.BannerViewHolder;
|
||||||
import com.opensource.svgaplayer.SVGADrawable;
|
import com.opensource.svgaplayer.SVGADrawable;
|
||||||
@ -24,13 +25,13 @@ public class TopBannerCustomViewHolder implements BannerViewHolder<BannerBean> {
|
|||||||
public View createView(Context context, int position, BannerBean data) {
|
public View createView(Context context, int position, BannerBean data) {
|
||||||
View view = null;
|
View view = null;
|
||||||
if (data.getType() == TYPE_IMAGE) {
|
if (data.getType() == TYPE_IMAGE) {
|
||||||
ImageView icon = new ImageView(context);
|
view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_wish, null);
|
||||||
if (data.getIconRes() != 0) {
|
ImageView wishlistIcon = view.findViewById(R.id.wishlist_icon);
|
||||||
ImgLoader.display(context, data.getIconRes(), icon);
|
TextView wishlistName = view.findViewById(R.id.wishlist_name);
|
||||||
} else {
|
TextView wishlistProgress = view.findViewById(R.id.wishlist_progress);
|
||||||
ImgLoader.display(context, data.getImageUrl(), icon);
|
ImgLoader.display(context, data.getWishlistIcon(), wishlistIcon);
|
||||||
}
|
wishlistName.setText(data.getWishlistName());
|
||||||
view = icon;
|
wishlistProgress.setText(String.format("%s/%s", data.getWishlistProgress(), data.getWishlistNum()));
|
||||||
} else {
|
} else {
|
||||||
view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me, null);
|
view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me, null);
|
||||||
SVGAImageView svga = view.findViewById(R.id.svga);
|
SVGAImageView svga = view.findViewById(R.id.svga);
|
||||||
|
48
live/src/main/res/layout/view_live_top_banner_wish.xml
Normal file
48
live/src/main/res/layout/view_live_top_banner_wish.xml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="52dp"
|
||||||
|
android:layout_height="52dp"
|
||||||
|
android:background="@mipmap/bg_xyd">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/wishlist_icon"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:text="@string/live_use_wish"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishlist_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|center_horizontal"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:text="sjhasdjkjk"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/wishlist_progress"
|
||||||
|
android:layout_width="52dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:background="@drawable/bg_live_wish_top"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="23/100"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
BIN
live/src/main/res/mipmap-xxxhdpi/bg_xyd.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/bg_xyd.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
@ -94,7 +94,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
|||||||
if (outRankHide != null) {
|
if (outRankHide != null) {
|
||||||
for (String hideId : outRankHide) {
|
for (String hideId : outRankHide) {
|
||||||
if (i < 3) {
|
if (i < 3) {
|
||||||
hv.setData(list.get(i).setHide(TextUtils.equals(list.get(i).getUid(), hideId)), i);
|
hv.setData(list.get(i).setHide(TextUtils .equals(list.get(i).getUid(), hideId)), i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user