diff --git a/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java b/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java index 21125ed50..80c69327c 100644 --- a/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java +++ b/common/src/main/java/com/yunbao/common/bean/AnchorRecommendModel.java @@ -17,6 +17,8 @@ public class AnchorRecommendModel extends BaseModel { //是否展示0=不展示1=展示 @SerializedName("list_show") private int listShow = 0; + @SerializedName("red_packet_show") + private int showRedPacket = 0;//是否显示首页红包浮窗 //是否支持换一批0=不支持 1=支持 @SerializedName("up_show") private int upShow = 0; @@ -24,6 +26,10 @@ public class AnchorRecommendModel extends BaseModel { private List list = new ArrayList<>(); @SerializedName("slide") private List slide = new ArrayList<>(); + @SerializedName("red_packet_total") + private int redPacketTotal = 100; + @SerializedName("red_packet_day_create_num") + private int redPacketNum = 0; public List getSlide() { return slide; @@ -52,6 +58,30 @@ public class AnchorRecommendModel extends BaseModel { return this; } + public int getShowRedPacket() { + return showRedPacket; + } + + public void setShowRedPacket(int showRedPacket) { + this.showRedPacket = showRedPacket; + } + + public int getRedPacketTotal() { + return redPacketTotal; + } + + public void setRedPacketTotal(int redPacketTotal) { + this.redPacketTotal = redPacketTotal; + } + + public int getRedPacketNum() { + return redPacketNum; + } + + public void setRedPacketNum(int redPacketNum) { + this.redPacketNum = redPacketNum; + } + public List getList() { return list; } diff --git a/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java b/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java new file mode 100644 index 000000000..671b61313 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/RedPacketDetailsBean.java @@ -0,0 +1,165 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.CommonAppConfig; + +import java.util.List; + +public class RedPacketDetailsBean extends BaseModel { + @SerializedName("u_nicename") + private String niceName; + @SerializedName("avatar_thumb") + private String avatarThumb; + @SerializedName("avatar") + private String avatar; + @SerializedName("red_packet_money") + private long money;// 红包金豆总数量 + @SerializedName("red_packet_quantity") + private int quantity; // 领取的红包总数量 + @SerializedName("red_packet_quantity_already") + private int already; // 领取的红包总数量 + @SerializedName("red_packet_record_details") + private List details; + + public String getNiceName() { + return niceName; + } + + public void setNiceName(String niceName) { + this.niceName=niceName; + } + + public String getAvatarThumb() { + avatarThumb=avatarThumb.replace("\\",""); + if(!avatarThumb.startsWith("http")){ + avatarThumb= CommonAppConfig.HOST+"/"+avatarThumb; + } + return avatarThumb; + } + + public void setAvatarThumb(String avatarThumb) { + this.avatarThumb = avatarThumb; + } + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public long getMoney() { + return money; + } + + public void setMoney(long money) { + this.money = money; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getAlready() { + return already; + } + + public void setAlready(int already) { + this.already = already; + } + + public List getDetails() { + return details; + } + + public void setDetails(List details) { + this.details = details; + } + + @Override + public String toString() { + return "RedPacketDetailsBean{" + + "niceName='" + niceName + '\'' + + ", avatarThumb='" + avatarThumb + '\'' + + ", avatar='" + avatar + '\'' + + ", money=" + money + + ", quantity=" + quantity + + ", already=" + already + + ", details=" + details + + '}'; + } + + public static class Detail extends BaseModel { + @SerializedName("receive_money") + private long money; + @SerializedName("user_nicename") + private String niceName; + @SerializedName("receive_time") + private String time; + @SerializedName("avatar_thumb") + private String avatarThumb; + @SerializedName("avatar") + private String avatar; + + + public long getMoney() { + return money; + } + + public void setMoney(long money) { + this.money = money; + } + + public String getNiceName() { + return niceName; + } + + public void setNiceName(String niceName) { + this.niceName=niceName; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public String getAvatarThumb() { + avatarThumb=avatarThumb.replace("\\",""); + if(!avatarThumb.startsWith("http")){ + avatarThumb= CommonAppConfig.HOST+"/"+avatarThumb; + } + return avatarThumb; + } + + public void setAvatarThumb(String avatarThumb) { + this.avatarThumb = avatarThumb; + } + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + @Override + public String toString() { + return "Detail{" + + "money=" + money + + ", niceName='" + niceName + '\'' + + ", time='" + time + '\'' + + ", avatarThumb='" + avatarThumb + '\'' + + ", avatar='" + avatar + '\'' + + '}'; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/RedPacketListBean.java b/common/src/main/java/com/yunbao/common/bean/RedPacketListBean.java new file mode 100644 index 000000000..8d37ab67f --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/RedPacketListBean.java @@ -0,0 +1,117 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class RedPacketListBean extends BaseModel { + public static final int RED_PACKET_STATUS_SUCCESS=1;//红包消费 + public static final int RED_PACKET_STATUS_BACK=2;//红包退回 + public static final int RED_PACKET_CURRENT_STATUS_SUCCESS=1;//红包已生效 + public static final int RED_PACKET_CURRENT_STATUS_TIMEOUT=2;//红包已过期 + @SerializedName("id") + private int id; + @SerializedName("live_nicename") + private String liveNicename; + @SerializedName("create_time") + private String createTime; + @SerializedName("red_packet_money") + private long redPacketMoney; + @SerializedName("red_packet_status") + private int redPacketStatus; + @SerializedName("current_status") + private int currentStatus; + @SerializedName("uid") + private long uid; + + @SerializedName("amount_diamond") + private long amountDiamond; + @SerializedName("amount_refund") + private long amountRefund; + + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getLiveNicename() { + return liveNicename; + } + + public void setLiveNicename(String liveNicename) { + this.liveNicename = liveNicename; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public long getRedPacketMoney() { + return redPacketMoney; + } + + public void setRedPacketMoney(long redPacketMoney) { + this.redPacketMoney = redPacketMoney; + } + + public int getRedPacketStatus() { + return redPacketStatus; + } + + public void setRedPacketStatus(int redPacketStatus) { + this.redPacketStatus = redPacketStatus; + } + + public long getUid() { + return uid; + } + + public void setUid(long uid) { + this.uid = uid; + } + + public int getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(int currentStatus) { + this.currentStatus = currentStatus; + } + + public long getAmountDiamond() { + return amountDiamond; + } + + public void setAmountDiamond(long amountDiamond) { + this.amountDiamond = amountDiamond; + } + + public long getAmountRefund() { + return amountRefund; + } + + public void setAmountRefund(long amountRefund) { + this.amountRefund = amountRefund; + } + + @Override + public String toString() { + return "RedPacketListBean{" + + "id=" + id + + ", liveNicename='" + liveNicename + '\'' + + ", createTime='" + createTime + '\'' + + ", redPacketMoney=" + redPacketMoney + + ", redPacketStatus=" + redPacketStatus + + ", currentStatus=" + currentStatus + + ", uid=" + uid + + ", amountDiamond=" + amountDiamond + + ", amountRefund=" + amountRefund + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 1e1fa32c3..4a4fba729 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -2,6 +2,7 @@ package com.yunbao.common.http; import com.alibaba.fastjson.JSONObject; import com.yunbao.common.bean.ActiveModel; +import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.BlindBoxInfoModel; @@ -19,6 +20,7 @@ import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveAnchorCallMeModel; import com.yunbao.common.bean.LiveAnchorSayModel; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; @@ -35,6 +37,8 @@ import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankHttpTurntableBean; import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.RankPkInfoBean; +import com.yunbao.common.bean.RedPacketDetailsBean; +import com.yunbao.common.bean.RedPacketListBean; import com.yunbao.common.bean.SearchModel; import com.yunbao.common.bean.SetAttentsModel; import com.yunbao.common.bean.SlideInBannerModel; @@ -730,4 +734,23 @@ public interface PDLiveApi { */ @GET("/api/public/?service=Live.getBlindBoxInfo") Observable>> getBlindBoxInfo(); + + /** + * 获取红包记录列表 + */ + @GET("/api/public/?service=Live.redPacketRecord") + Observable>> getRedPacketList(); + + /** + * 获取红包詳情 + */ + @GET("/api/public/?service=Live.redPacketRecordDetails") + Observable> getRedPacketDetails(@Query("red_packet_id") int id); + + /** + * 获取直播间上下滑动红包集合 + */ + @GET("/api/public/?service=Home.getRedPacket") + Observable>> getRedPacket(); + } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index e68000a1b..0d072003c 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -34,6 +34,8 @@ import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankHttpTurntableBean; import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.RankPkInfoBean; +import com.yunbao.common.bean.RedPacketDetailsBean; +import com.yunbao.common.bean.RedPacketListBean; import com.yunbao.common.bean.SetAttentsModel; import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.bean.UserAreaBean; @@ -1550,7 +1552,54 @@ public class LiveNetManager { } }).isDisposed(); } - + /** + * 获取红包记录列表 + */ + public void getRedPacketList(HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getRedPacketList() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>>() { + @Override + public void accept(ResponseModel> listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } + /** + * 获取红包记录列表 + */ + public void getRedPacketUserList(int id,HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getRedPacketDetails(id) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Consumer>() { + @Override + public void accept(ResponseModel listResponseModel) throws Exception { + if (callback != null) { + callback.onSuccess(listResponseModel.getData().getInfo()); + } + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(mContext.getString(R.string.net_error)); + } + } + }).isDisposed(); + } /** * 直播间取消网络请求 */ diff --git a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java index 0807642a7..793a3ae88 100644 --- a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java @@ -2,8 +2,8 @@ package com.yunbao.common.http.main; import android.app.Activity; +import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; -import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.MsgSwitchDetailModel; @@ -13,7 +13,6 @@ import com.yunbao.common.http.API; import com.yunbao.common.http.ResponseData; import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.base.HttpCallback; -import com.yunbao.common.utils.ToastUtil; import java.util.List; @@ -207,13 +206,14 @@ public class MainNetManager { /** * 获取推送关注的设置和关注列表 + * * @param callback */ public void getMsgSwitchDetail(HttpCallback callback) { API.get().pdLiveApi(mContext).getMsgSwitchDetail() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(msgSwitchDetailModelResponseModel -> { + .subscribe(msgSwitchDetailModelResponseModel -> { if (callback != null) { MsgSwitchDetailModel msgSwitchDetailModel = msgSwitchDetailModelResponseModel.getData().getInfo(); callback.onSuccess(msgSwitchDetailModel); @@ -227,13 +227,14 @@ public class MainNetManager { /** * 推送开关设置 + * * @param callback */ - public void setMsgMasterSwitch(String status,String type,HttpCallback callback) { - API.get().pdLiveApi(mContext).setMsgMasterSwitch(status,type) + public void setMsgMasterSwitch(String status, String type, HttpCallback callback) { + API.get().pdLiveApi(mContext).setMsgMasterSwitch(status, type) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(BaseModel -> { + .subscribe(BaseModel -> { if (callback != null) { ResponseData responseData = BaseModel.getData(); callback.onSuccess(responseData); @@ -247,13 +248,14 @@ public class MainNetManager { /** * 主播开播推送开关设置 + * * @param callback */ - public void setBeginShowMsgSwitch(String status,String isAll,String liveuid,HttpCallback callback) { - API.get().pdLiveApi(mContext).setBeginShowMsgSwitch(status,isAll,liveuid) + public void setBeginShowMsgSwitch(String status, String isAll, String liveuid, HttpCallback callback) { + API.get().pdLiveApi(mContext).setBeginShowMsgSwitch(status, isAll, liveuid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(BaseModel -> { + .subscribe(BaseModel -> { if (callback != null) { ResponseData responseData = BaseModel.getData(); callback.onSuccess(responseData); @@ -264,5 +266,22 @@ public class MainNetManager { } }).isDisposed(); } + /** + * 获取直播间上下滑动红包集合 + */ + public void getRedPacket(HttpCallback> callback) { + API.get().pdLiveApi(mContext).getRedPacket() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(msgSwitchDetailModelResponseModel -> { + if (callback != null) { + callback.onSuccess(msgSwitchDetailModelResponseModel.getData().getInfo()); + } + }, throwable -> { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + }).isDisposed(); + } } 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 9e442e132..aaae75cc4 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -10,6 +10,7 @@ import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.bean.LiveBean; +import com.yunbao.common.bean.RedPacketListBean; import com.yunbao.common.manager.IMLoginManager; import java.util.Locale; @@ -39,6 +40,9 @@ public class RouteUtil { public static final String PATH_MYWEBVIEWACTIVTITY2 = "/main/MyWebViewActivity2"; public static final String PATH_LOGIN = "/main/LoginActivity"; public static final String PATH_CS = "/main/CustomerServiceWebViewActivity"; + public static final String PATH_RED_PACKET_LIST = "/main/RedPacketListActivity"; + public static final String PATH_RED_PACKET_INFO = "/main/RedPacketInfoActivity"; + public static final String PATH_RED_PACKET_USER = "/main/RedPacketUsersActivity"; public static void forwardFansActivity(String uid) { ARouter.getInstance().build(PATH_FANSACTIVITY) @@ -80,6 +84,7 @@ public class RouteUtil { .withBoolean("forwardEntry", true) .navigation(); } + /** * 只回到登录页,不提示东西 */ @@ -188,6 +193,7 @@ public class RouteUtil { ARouter.getInstance().build(PATH_EDITPROFILE) .navigation(); } + /** * 修改个人资料 */ @@ -256,9 +262,36 @@ public class RouteUtil { /** * 客服页面 */ - public static void forwardCustomerService(String url){ + public static void forwardCustomerService(String url) { ARouter.getInstance().build(PATH_CS) - .withString(Constants.URL,url) + .withString(Constants.URL, url) + .navigation(); + } + + /** + * 红包记录列表 + */ + public static void forwardRedPacketList() { + ARouter.getInstance().build(PATH_RED_PACKET_LIST) + .navigation(); + } + + /** + * 红包详情 + */ + public static void forwardRedPacketInfo(RedPacketListBean bean) { + ARouter.getInstance().build(PATH_RED_PACKET_INFO) + .withSerializable("bean", bean) + .navigation(); + } + + /** + * 红包发放情况 + * @param id 发放者uid + */ + public static void forwardRedPacketUser(int id) { + ARouter.getInstance().build(PATH_RED_PACKET_USER) + .withInt("id", id) .navigation(); } } diff --git a/common/src/main/res/layout/item_user_red_packet.xml b/common/src/main/res/layout/item_user_red_packet.xml index 882546cd4..3a11a1cd2 100644 --- a/common/src/main/res/layout/item_user_red_packet.xml +++ b/common/src/main/res/layout/item_user_red_packet.xml @@ -10,7 +10,6 @@ android:layout_width="40dp" android:layout_height="40dp" android:scaleType="centerCrop" - android:layout_marginStart="21dp" android:layout_marginTop="10dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -27,7 +26,7 @@ app:layout_constraintEnd_toStartOf="@+id/money" android:layout_marginEnd="2dp" app:layout_constraintTop_toTopOf="@+id/money" - app:srcCompat="@mipmap/diamond" /> + app:srcCompat="@mipmap/gold_coin" /> + tools:visibility="visible" /> + + + diff --git a/common/src/main/res/layout/view_title2.xml b/common/src/main/res/layout/view_title2.xml index b4cffb8f2..d1d192362 100644 --- a/common/src/main/res/layout/view_title2.xml +++ b/common/src/main/res/layout/view_title2.xml @@ -26,7 +26,7 @@ android:layout_centerVertical="true" android:onClick="backClick" android:padding="9dp" - android:src="@mipmap/icon_dialog_charge_close" + android:src="@mipmap/icon_back" android:tint="@color/textColor" /> Over the maximum value Insufficient balance, continue to recharge Time limit gag + Red packet record + Last 30 days record (as of yesterday) + Current status + Red packet Took effect + Red packet Expired + Red Packet Details + Check + Pay Time + Mode of Pay + diamond + opened + Residual return + None + Return to account + Popularity Red packet + Red packets diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index bee2faa9f..4a8ed2ef9 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1191,4 +1191,20 @@ 超过最大值 餘額不足,繼續充值 期限禁言 + 紅包記錄 + 近30天記錄(截至到昨天) + 當前狀態 + 紅包已生效 + 紅包已過期 + 紅包詳情 + 查看 + 支付時間 + 支付方式 + 鉆石餘額 + 已打開 + 剩餘退回 + + 退回賬戶 + 攢人氣紅包 + 紅包專區 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index dc2735243..bd87f6cda 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1190,4 +1190,20 @@ 超过最大值 餘額不足,繼續充值 期限禁言 + 紅包記錄 + 近30天記錄(截至到昨天) + 當前狀態 + 紅包已生效 + 紅包已過期 + 紅包詳情 + 查看 + 支付時間 + 支付方式 + 鉆石餘額 + 已打開 + 剩餘退回 + + 退回賬戶 + 攢人氣紅包 + 紅包專區 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 0870f2363..95b56959c 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1191,4 +1191,20 @@ 超过最大值 餘額不足,繼續充值 期限禁言 + 紅包記錄 + 近30天記錄(截至到昨天) + 當前狀態 + 紅包已生效 + 紅包已過期 + 紅包詳情 + 查看 + 支付時間 + 支付方式 + 鉆石餘額 + 已打開 + 剩餘退回 + + 退回賬戶 + 攢人氣紅包 + 紅包專區 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 81850c6b9..0a3d0e170 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1197,4 +1197,20 @@ Limited ride And limited avatar frame Over the maximum value Insufficient balance, continue to recharge Time limit gag + Red packet record + Last 30 days record (as of yesterday) + Current status + Red packet Took effect + Red packet Expired + Red Packet Details + Check + Pay Time + Mode of Pay + diamond + opened + Residual return + None + Return to account + Popularity Red packet + Red packets diff --git a/config.gradle b/config.gradle index 013cf6403..1894327c6 100644 --- a/config.gradle +++ b/config.gradle @@ -5,7 +5,7 @@ ext { minSdkVersion : 21, targetSdkVersion : 31, versionCode : 430, - versionName : "6.5.2" + versionName : "6.5.3" ] manifestPlaceholders = [ //正式、 @@ -24,7 +24,7 @@ ext { baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB", baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : false, + isGooglePlay : true, //是否上报异常日志 isUploadLog : true, //是否打包成插件包模式 diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 1bbc86181..7b2ce69ef 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -159,6 +159,7 @@ public class LiveAudienceActivity extends LiveActivity { private View titleLine; private boolean liveIndex = true; private boolean isPk = false; + private boolean isRadPacetModle = false; @Override public T findViewById(@IdRes int id) { @@ -183,6 +184,7 @@ public class LiveAudienceActivity extends LiveActivity { L.e(TAG, "直播sdk----->" + (mLiveSDK == Constants.LIVE_SDK_KSY ? "金山云" : "腾讯云")); mLiveType = intent.getIntExtra(Constants.LIVE_TYPE, Constants.LIVE_TYPE_NORMAL); mLiveTypeVal = intent.getIntExtra(Constants.LIVE_TYPE_VAL, 0); + isRadPacetModle = !StringUtil.isEmpty(intent.getStringExtra("redPacket")) && intent.getStringExtra("redPacket").equals("true"); initView(); setVolumeControlStream(AudioManager.STREAM_MUSIC); manager = new PortraitLiveManager(this, intent); @@ -267,21 +269,40 @@ public class LiveAudienceActivity extends LiveActivity { manager.resetLight(); Log.e(TAG, "mCurrentItem:" + mCurrentItem); if (mCurrentItem == itemModelList.size() - 1) { - MainNetManager.get(mContext) - .anchorRecommendType("30", new com.yunbao.common.http.base.HttpCallback() { - @Override - public void onSuccess(AnchorRecommendModel data) { - if (TextUtils.equals(data.getList().get(0).getUid(), mLiveBean.getUid())) { - data.getList().remove(0); + if (isRadPacetModle) {//从红包专区进去的走红包专区列表 + MainNetManager.get(mContext) + .getRedPacket(new com.yunbao.common.http.base.HttpCallback>() { + @Override + public void onSuccess(List data) { + if (TextUtils.equals(data.get(0).getUid(), mLiveBean.getUid())) { + data.remove(0); + } + itemModelList.addAll(data); + mPagerAdapter.notifyDataSetChanged(); } - itemModelList.addAll(data.getList()); - mPagerAdapter.notifyDataSetChanged(); - } - @Override - public void onError(String error) { - } - }); + @Override + public void onError(String error) { + + } + }); + } else { + MainNetManager.get(mContext) + .anchorRecommendType("30", new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(AnchorRecommendModel data) { + if (TextUtils.equals(data.getList().get(0).getUid(), mLiveBean.getUid())) { + data.getList().remove(0); + } + itemModelList.addAll(data.getList()); + mPagerAdapter.notifyDataSetChanged(); + } + + @Override + public void onError(String error) { + } + }); + } } } @@ -861,7 +882,7 @@ public class LiveAudienceActivity extends LiveActivity { if (TextUtils.equals(htmlUrl, "recharge")) { RouteUtil.forwardMyCoin(mContext); } else if (TextUtils.equals(htmlUrl, "to_me_information")) { - RouteUtil.forwardEditProfileActivity(); + RouteUtil.forwardEditProfileActivity(); } else { if (!screen) { ZhuangBanActivity.forward(mContext, htmlUrl, false); diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index e4785c2ed..ede574312 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -26,6 +26,7 @@ import android.view.Window; import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; @@ -93,6 +94,7 @@ import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.VersionUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.APKUpdateCustomPopup; import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.floatingview.APPEasyFloat; @@ -191,6 +193,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private FloatBannerView floatBanner; private boolean isfloatBannernet = true, isFirst = true; + private View floatRedPacket; + @Override protected int getLayoutId() { @@ -236,6 +240,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene rt_main_tab = (RelativeLayout) findViewById(R.id.rt_main_tab); v_table_redpoint = findViewById(R.id.v_table_redpoint); v_table_redpoint_me = (View) findViewById(R.id.v_table_redpoint_me); + floatRedPacket = findViewById(R.id.red_packet); + initRedPacket(); Display mDisplay = getWindowManager().getDefaultDisplay(); Height = mDisplay.getHeight(); @@ -485,12 +491,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene initAnchorRecommendBanner(); } else if (index == 2) { floatBanner.setVisibility(View.GONE); + floatRedPacket.setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE); isfloatBannernet = false; if (mainMessageViewHolder != null) mainMessageViewHolder.onResume(); } else { floatBanner.setVisibility(View.GONE); + floatRedPacket.setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE); isfloatBannernet = false; } @@ -561,6 +569,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene if (!isfloatBannernet) return; MainNetManager.get(mContext) .anchorRecommend("10", new com.yunbao.common.http.base.HttpCallback() { + @SuppressLint("SetTextI18n") @Override public void onSuccess(AnchorRecommendModel data) { if (isFinishing()) return; @@ -572,6 +581,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene floatBanner.setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE); } + if (data.getShowRedPacket() == 0) { + floatRedPacket.setVisibility(View.GONE); + } else { + floatRedPacket.setVisibility(View.VISIBLE); + ((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setMax(data.getRedPacketTotal()); + ((ProgressBar) floatRedPacket.findViewById(R.id.progress)).setProgress(data.getRedPacketNum()); + ((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal()); + } } @@ -832,9 +849,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene //获取指导员引导逻辑 NoviceInstructorManager.get(mContext).getNoviceInstructor(); NoviceInstructorManager.get(mContext).checktHomeZdyPop(); - if (!isFirst) { - initAnchorRecommendBanner(); - } + initAnchorRecommendBanner(); } /** @@ -1232,6 +1247,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } else { isfloatBannernet = false; floatBanner.setVisibility(View.GONE); + floatRedPacket.setVisibility(View.GONE); findViewById(R.id.banner_click).setVisibility(View.GONE); } } @@ -1374,4 +1390,15 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } } + private void initRedPacket() { + ImageView title = floatRedPacket.findViewById(R.id.title); + if (WordUtil.isNewZh()) { + title.setImageResource(R.mipmap.icon_red_packet_float_text_zh); + } else { + title.setImageResource(R.mipmap.icon_red_packet_float_text_en); + } + floatRedPacket.setOnClickListener(v -> { + mainHomeViewHolder.setCurPosition(3); + }); + } } diff --git a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java index 2d85ea59b..f2029490b 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -65,6 +65,10 @@ public class MyWalletActivity extends AbsActivity { GoogleBillingUtilNew.getInstance().initGooglePay(mContext); vp_content = (ViewPager) findViewById(R.id.vp_content); TextView rView = (TextView) findViewById(R.id.rView); + findViewById(R.id.redPacketMain).setVisibility(View.VISIBLE); + findViewById(R.id.redPacketMain).setOnClickListener(v -> { + RouteUtil.forwardRedPacketList(); + }); rView.setOnClickListener(v -> { LoadingDialog loadingDialog = new LoadingDialog(); loadingDialog.show(getSupportFragmentManager(), "LoadingDialog"); diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java index 296212675..68271b00e 100644 --- a/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RedPacketInfoActivity.java @@ -1,29 +1,82 @@ package com.yunbao.main.activity; +import android.annotation.SuppressLint; import android.content.Intent; +import android.graphics.Color; import android.view.View; +import android.widget.ImageView; import android.widget.TextView; +import com.alibaba.android.arouter.facade.annotation.Route; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.RedPacketListBean; +import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.main.R; -public class RedPacketInfoActivity extends AbsActivity implements View.OnClickListener{ +@Route(path = RouteUtil.PATH_RED_PACKET_INFO) +public class RedPacketInfoActivity extends AbsActivity implements View.OnClickListener { + private RedPacketListBean bean; + private ImageView icon; + private ImageView gold; + private TextView title; + private TextView money; + private TextView status; + private TextView info; + private TextView time; + private TextView model; + private TextView backAccountText; + @Override protected int getLayoutId() { return R.layout.activity_red_packet_info; } + @SuppressLint("SetTextI18n") @Override protected void main() { super.main(); - findViewById(R.id.red_packet_info).setOnClickListener(this); + bean = (RedPacketListBean) getIntent().getSerializableExtra("bean"); + icon = findViewById(R.id.icon); + title = findViewById(R.id.title); + money = findViewById(R.id.money); + status = findViewById(R.id.red_packet_status); + info = findViewById(R.id.red_packet_info); + time = findViewById(R.id.red_packet_timer); + model = findViewById(R.id.red_packet_model); + gold = findViewById(R.id.gold_icon); + backAccountText = findViewById(R.id.backAccountText); + findViewById(R.id.btn_back).setOnClickListener(this); + info.setOnClickListener(this); + + title.setText(bean.getLiveNicename()); + time.setText(bean.getCreateTime()); + + money.setText("-" + bean.getAmountDiamond()); + money.setTextColor(Color.parseColor("#000000")); + icon.setImageResource(R.mipmap.diamond); + + if (bean.getCurrentStatus() == RedPacketListBean.RED_PACKET_CURRENT_STATUS_SUCCESS) { + status.setText(R.string.red_packet_info_status_success); + } else { + status.setText(R.string.red_packet_info_status_timeout); + } + if (bean.getAmountRefund() == 0) { + gold.setVisibility(View.GONE); + backAccountText.setText(R.string.red_packet_info_residue_none); + } else { + gold.setVisibility(View.VISIBLE); + backAccountText.setText(mContext.getString(R.string.red_packet_info_residue_back) + " +" + bean.getAmountRefund()); + } } @Override public void onClick(View v) { - int id=v.getId(); - if(id==R.id.red_packet_info){ - startActivity(new Intent(this, RedPacketUsersActivity.class)); + int id = v.getId(); + if (id == R.id.red_packet_info) { + RouteUtil.forwardRedPacketUser(bean.getId()); + } else if (id == R.id.btn_back) { + finish(); } } } diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java index ad98ce1c3..36338fd3e 100644 --- a/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RedPacketListActivity.java @@ -5,14 +5,18 @@ import android.widget.TextView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.alibaba.android.arouter.facade.annotation.Route; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.RedPacketListBean; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.main.R; import com.yunbao.main.adapter.RedPacketListRecyclerAdapter; -import com.yunbao.main.bean.RedPacketListBean; -import java.util.ArrayList; import java.util.List; +@Route(path = RouteUtil.PATH_RED_PACKET_LIST) public class RedPacketListActivity extends AbsActivity { private RecyclerView recyclerView; private RedPacketListRecyclerAdapter adapter; @@ -25,7 +29,7 @@ public class RedPacketListActivity extends AbsActivity { @Override public void main() { super.main(); - ((TextView) findViewById(R.id.titleView)).setText("紅包記錄"); + ((TextView) findViewById(R.id.titleView)).setText(mContext.getString(R.string.red_packet_list_title)); recyclerView = findViewById(R.id.recyclerView); adapter = new RedPacketListRecyclerAdapter(this); @@ -35,15 +39,17 @@ public class RedPacketListActivity extends AbsActivity { } private void initData() { - List list = new ArrayList<>(); - for (int i = 1; i <= 5; i++) { - RedPacketListBean bean = new RedPacketListBean(); - bean.setTitle("攢人氣紅包" + i); - bean.setTimer("X月X日 " + i); - bean.setMoney(i * 1000 + ""); - list.add(bean); - } - adapter.setList(list); + LiveNetManager.get(mContext) + .getRedPacketList(new HttpCallback>() { + @Override + public void onSuccess(List data) { + adapter.setList(data); + } + @Override + public void onError(String error) { + + } + }); } } diff --git a/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java b/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java index 61a340b79..083a4f309 100644 --- a/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RedPacketUsersActivity.java @@ -1,21 +1,36 @@ package com.yunbao.main.activity; +import android.annotation.SuppressLint; import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.alibaba.android.arouter.facade.annotation.Route; +import com.makeramen.roundedimageview.RoundedImageView; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.RedPacketDetailsBean; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.main.R; import com.yunbao.main.adapter.RedPacketUserRecyclerAdapter; -import com.yunbao.main.bean.RedPacketListBean; - -import java.util.ArrayList; -import java.util.List; +@Route(path = RouteUtil.PATH_RED_PACKET_USER) public class RedPacketUsersActivity extends AbsActivity implements View.OnClickListener{ private RecyclerView recyclerView; private RedPacketUserRecyclerAdapter adapter; + private int redPacketId; + + private RoundedImageView avatar; + private TextView title; + private TextView money; + private ImageView icon; + private TextView open; + @Override protected int getLayoutId() { @@ -25,8 +40,14 @@ public class RedPacketUsersActivity extends AbsActivity implements View.OnClickL @Override protected void main() { super.main(); + findViewById(R.id.btn_back).setOnClickListener(this); recyclerView = findViewById(R.id.recyclerView); - + avatar = findViewById(R.id.avatar); + title = findViewById(R.id.title); + money = findViewById(R.id.money); + icon = findViewById(R.id.avatar); + open = findViewById(R.id.open_packet); + redPacketId=getIntent().getIntExtra("id",0); adapter = new RedPacketUserRecyclerAdapter(this); recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); recyclerView.setAdapter(adapter); @@ -36,17 +57,32 @@ public class RedPacketUsersActivity extends AbsActivity implements View.OnClickL @Override public void onClick(View v) { int id=v.getId(); + if(id==R.id.btn_back){ + finish(); + } } private void initData() { - List list = new ArrayList<>(); - for (int i = 1; i <= 5; i++) { - RedPacketListBean bean = new RedPacketListBean(); - bean.setTitle("攢人氣紅包 - 主播昵稱的直播間" + i); - bean.setTimer("X月X日 " + i); - bean.setMoney(i * 1000 + ""); - list.add(bean); - } - adapter.setList(list); + LiveNetManager.get(mContext) + .getRedPacketUserList(redPacketId, new HttpCallback() { + @Override + public void onSuccess(RedPacketDetailsBean data) { + setData(data); + adapter.setList(data.getDetails()); + } + + @Override + public void onError(String error) { + + } + }); + + } + @SuppressLint("SetTextI18n") + private void setData(RedPacketDetailsBean bean){ + ImgLoader.display(mContext,bean.getAvatarThumb(),avatar); + title.setText(bean.getNiceName()); + money.setText(bean.getMoney()+""); + open.setText(mContext.getString(R.string.red_packet_user_tips)+" "+bean.getAlready()+"/"+bean.getQuantity()); } } diff --git a/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java b/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java index a1a64e227..3dfa1bc92 100644 --- a/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/RedPacketListRecyclerAdapter.java @@ -1,7 +1,8 @@ package com.yunbao.main.adapter; +import android.annotation.SuppressLint; import android.content.Context; -import android.content.Intent; +import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -11,10 +12,11 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.yunbao.common.bean.RedPacketListBean; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.main.R; -import com.yunbao.main.activity.RedPacketInfoActivity; -import com.yunbao.main.bean.RedPacketListBean; +import java.util.ArrayList; import java.util.List; public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter { @@ -23,6 +25,7 @@ public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter(); } public void setList(List list) { @@ -56,13 +59,18 @@ public class RedPacketListRecyclerAdapter extends RecyclerView.Adapter mContext.startActivity(new Intent(mContext, RedPacketInfoActivity.class))); + itemView.setOnClickListener(v -> { + RouteUtil.forwardRedPacketInfo((RedPacketListBean) itemView.getTag()); + }); } + @SuppressLint("SetTextI18n") private void setData(RedPacketListBean bean) { - title.setText(bean.getTitle()); - timer.setText(bean.getTimer()); - money.setText(bean.getMoney()); + title.setText(bean.getLiveNicename()+"|"+bean.getId()); + timer.setText(bean.getCreateTime()); + money.setText("-" + bean.getAmountDiamond()); + money.setTextColor(Color.parseColor("#000000")); + icon.setImageResource(R.mipmap.diamond); itemView.setTag(bean); } } diff --git a/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java b/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java index 011a95a7a..ddd7b1dbf 100644 --- a/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/RedPacketUserRecyclerAdapter.java @@ -1,32 +1,36 @@ package com.yunbao.main.adapter; +import android.annotation.SuppressLint; import android.content.Context; -import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.makeramen.roundedimageview.RoundedImageView; +import com.yunbao.common.bean.RedPacketDetailsBean; +import com.yunbao.common.glide.ImgLoader; import com.yunbao.main.R; -import com.yunbao.main.activity.RedPacketInfoActivity; -import com.yunbao.main.bean.RedPacketListBean; +import java.util.ArrayList; import java.util.List; public class RedPacketUserRecyclerAdapter extends RecyclerView.Adapter { - private List list; + private List list; private Context mContext; public RedPacketUserRecyclerAdapter(Context mContext) { this.mContext = mContext; + list = new ArrayList<>(); } - public void setList(List list) { - this.list = list; + public void setList(List list) { + if (list != null) { + this.list = list; + } notifyDataSetChanged(); } @@ -48,21 +52,22 @@ public class RedPacketUserRecyclerAdapter extends RecyclerView.Adapter mContext.startActivity(new Intent(mContext, RedPacketInfoActivity.class))); + icon = itemView.findViewById(R.id.avatar); } - private void setData(RedPacketListBean bean) { - title.setText(bean.getTitle()); - timer.setText(bean.getTimer()); - money.setText(bean.getMoney()); + @SuppressLint("SetTextI18n") + private void setData(RedPacketDetailsBean.Detail bean) { + title.setText(bean.getNiceName()); + timer.setText(bean.getTime()); + money.setText(bean.getMoney()+""); + ImgLoader.display(mContext,bean.getAvatarThumb(),icon); itemView.setTag(bean); } } diff --git a/main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java b/main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java deleted file mode 100644 index 16f3e0910..000000000 --- a/main/src/main/java/com/yunbao/main/bean/RedPacketListBean.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.yunbao.main.bean; - -import com.yunbao.common.bean.BaseModel; - -public class RedPacketListBean extends BaseModel { - private String title; - private String timer; - private String money; - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getTimer() { - return timer; - } - - public void setTimer(String timer) { - this.timer = timer; - } - - public String getMoney() { - return money; - } - - public void setMoney(String money) { - this.money = money; - } -} diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeRedPacketLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeRedPacketLiveViewHolder.java index b6d66fda7..a8bad6643 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeRedPacketLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeRedPacketLiveViewHolder.java @@ -28,7 +28,9 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 首页红包专区 @@ -134,6 +136,12 @@ public class MainHomeRedPacketLiveViewHolder extends AbsMainHomeChildViewHolder @Override public void onItemClick(LiveBean bean, int position) { if ("1".equals(bean.getIslive())) { + Map map = bean.getParams(); + if(map==null){ + map=new HashMap<>(); + } + map.put("redPacket","true"); + bean.setParams(map); watchLive(bean, Constants.LIVE_HOME, position); }else if(bean.getIs_week()!=null&&bean.getIs_week().equals("1")){ String url = CommonAppConfig.HOST + bean.getUrl()+"?a=1"; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 9c7c0ce9c..f04befa48 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -41,14 +41,11 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy); - img_trophy.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - mContext.startActivity(new Intent(mContext, RedPacketListActivity.class)); - return false; - } - }); + + } + public void setCurPosition(int position){ + mViewPager.setCurrentItem(position); } @Override @@ -73,9 +70,9 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { } else if (position == 2) { mainHomeRecomLiveViewHolder = new MainHomeRecomLiveViewHolder(mContext, parent); vh = mainHomeRecomLiveViewHolder; - }else if(position==3){ - mainHomeRedPacketLiveViewHolder=new MainHomeRedPacketLiveViewHolder(mContext,parent); - vh=mainHomeRedPacketLiveViewHolder; + } else if (position == 3) { + mainHomeRedPacketLiveViewHolder = new MainHomeRedPacketLiveViewHolder(mContext, parent); + vh = mainHomeRedPacketLiveViewHolder; } if (vh == null) { @@ -102,7 +99,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { mContext.getString(R.string.follow), mContext.getString(R.string.hot), mContext.getString(R.string.recomment), - "红包专区", + mContext.getString(R.string.main_tabs_red_packet), }; } diff --git a/main/src/main/res/drawable/bg_float_red_packet.xml b/main/src/main/res/drawable/bg_float_red_packet.xml new file mode 100644 index 000000000..5470ff1b1 --- /dev/null +++ b/main/src/main/res/drawable/bg_float_red_packet.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/activity_red_packet.xml b/main/src/main/res/layout/activity_red_packet.xml index 19ed25a3b..b2430f744 100644 --- a/main/src/main/res/layout/activity_red_packet.xml +++ b/main/src/main/res/layout/activity_red_packet.xml @@ -19,7 +19,7 @@ android:paddingStart="15dp" android:paddingEnd="0dp" android:background="#F5F5F5" - android:text="近30天記錄 (截至到昨天)" + android:text="@string/red_packet_list_tips" android:textColor="#000000" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/include3" /> diff --git a/main/src/main/res/layout/activity_red_packet_info.xml b/main/src/main/res/layout/activity_red_packet_info.xml index c2c0a9a58..8c397a9cc 100644 --- a/main/src/main/res/layout/activity_red_packet_info.xml +++ b/main/src/main/res/layout/activity_red_packet_info.xml @@ -13,7 +13,7 @@ android:layout_marginTop="24dp" android:onClick="backClick" android:padding="9dp" - android:src="@mipmap/icon_dialog_charge_close" + android:src="@mipmap/icon_back" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:tint="@color/textColor" /> @@ -54,6 +54,15 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/title" /> + + + app:layout_constraintTop_toBottomOf="@+id/Popularity" /> + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/activity_red_packet_users.xml b/main/src/main/res/layout/activity_red_packet_users.xml index 6a9f8bfae..f100b3e63 100644 --- a/main/src/main/res/layout/activity_red_packet_users.xml +++ b/main/src/main/res/layout/activity_red_packet_users.xml @@ -14,7 +14,7 @@ android:layout_marginTop="24dp" android:onClick="backClick" android:padding="9dp" - android:src="@mipmap/icon_dialog_charge_close" + android:src="@mipmap/icon_back" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:tint="@color/textColor" /> @@ -65,7 +65,7 @@ android:layout_marginEnd="6dp" app:layout_constraintEnd_toStartOf="@+id/money" app:layout_constraintTop_toTopOf="@+id/money" - app:srcCompat="@mipmap/diamond" /> + app:srcCompat="@mipmap/gold_coin" /> + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/view_homemain.xml b/main/src/main/res/layout/view_homemain.xml index 175475a58..981e0b6f7 100644 --- a/main/src/main/res/layout/view_homemain.xml +++ b/main/src/main/res/layout/view_homemain.xml @@ -1,5 +1,6 @@ + android:visibility="gone" + tools:visibility="visible" /> + android:visibility="gone" + tools:visibility="visible" /> + +