Compare commits
23 Commits
dev_rongcl
...
dev_blind_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db165cc05d | ||
|
|
b0008405e2 | ||
|
|
9c32c6af25 | ||
| baa2ec127f | |||
|
|
c3b5f17f44 | ||
|
|
c28a91b128 | ||
|
|
f064864d76 | ||
|
|
66290323d8 | ||
| 9526a14ca2 | |||
| 27715cda2c | |||
| 65bfc77376 | |||
| 99618a2779 | |||
| 1b637b7a77 | |||
| 6ee678bd74 | |||
|
|
b4dc035a1b | ||
|
|
1f7aef91a8 | ||
|
|
3e72b4a9eb | ||
|
|
4f103dadc9 | ||
|
|
055d002a34 | ||
|
|
426f7450a2 | ||
| 73a71dabc6 | |||
| 435dc1c4fb | |||
|
|
f347d283a0 |
BIN
app/src/main/res/drawable/no_banner.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
@@ -182,6 +182,7 @@ public class Constants {
|
||||
public static final String LIVE_VOTE_CREATE="createVote";
|
||||
public static final String LIVE_VOTE_UPDATE="updateVote";
|
||||
public static final String LIVE_VOTE_END="endVote";
|
||||
public static final String LIVE_PK_END="endPK";//结束PK,以这个PK获取到的参数为准
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlindBoxInfoModel extends BaseModel {
|
||||
/**
|
||||
* "info":[{"item_name":["麒麟勛章饰品","麒麟頭像框饰品","麒麟坐騎饰品","水晶项链礼物","夢幻水晶球礼物","心動泡泡礼物","蝴蝶少女礼物","金色唱片礼物","鑽石禮盒礼物","紙花船礼物"],"threshold_value":268,"threshold_dress_name":"麒麟坐騎","dress_threshold_value":0,"blind_box_type":1,"blind_box_id":1636},{"item_name":["金鳳勛章饰品","金鳳頭像框饰品","金鳳坐騎饰品","浪漫氣球礼物","捕夢網礼物","仙女棒礼物","藍寶石鈴鐺礼物","榮耀星礼物","童話屋礼物","夢幻許願池礼物"],"threshold_value":198,"threshold_dress_name":"金鳳坐騎","dress_threshold_value":0,"blind_box_type":2,"blind_box_id":1637},{"item_name":["神龍勛章饰品","神龍頭像框饰品","神龍坐騎饰品","水晶玫瑰礼物","sweet香水礼物","甜蜜熱氣球礼物","風鈴舞動礼物","音樂噴泉礼物","星空列車礼物","漂洋過海來看你礼物"],"threshold_value":128,"threshold_dress_name":"神龍坐騎","dress_threshold_value":0,"blind_box_type":3,"blind_box_id":1638}]
|
||||
*/
|
||||
@SerializedName("item_name")
|
||||
private List<String> itemName;
|
||||
@SerializedName("threshold_value")
|
||||
private String thresholdValue = "0";
|
||||
@SerializedName("threshold_dress_name")
|
||||
private String thresholdDressName;
|
||||
@SerializedName("dress_threshold_value")
|
||||
private String dressThresholdValue;
|
||||
@SerializedName("blind_box_type")
|
||||
private String blindBoxType;
|
||||
@SerializedName("blind_box_id")
|
||||
private String blindBoxId;
|
||||
@SerializedName("blind_box_swf")
|
||||
private String blindBoxSwf;
|
||||
@SerializedName("threshold_effect_src")
|
||||
private String thresholdEffectSrc;
|
||||
|
||||
public String getThresholdEffectSrc() {
|
||||
return thresholdEffectSrc;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdEffectSrc(String thresholdEffectSrc) {
|
||||
this.thresholdEffectSrc = thresholdEffectSrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxSwf() {
|
||||
return blindBoxSwf;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxSwf(String blindBoxSwf) {
|
||||
this.blindBoxSwf = blindBoxSwf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setItemName(List<String> itemName) {
|
||||
this.itemName = itemName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThresholdValue() {
|
||||
return thresholdValue;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdValue(String thresholdValue) {
|
||||
this.thresholdValue = thresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThresholdDressName() {
|
||||
return thresholdDressName;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdDressName(String thresholdDressName) {
|
||||
this.thresholdDressName = thresholdDressName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressThresholdValue() {
|
||||
return dressThresholdValue;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setDressThresholdValue(String dressThresholdValue) {
|
||||
this.dressThresholdValue = dressThresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxType() {
|
||||
return blindBoxType;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxType(String blindBoxType) {
|
||||
this.blindBoxType = blindBoxType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxId() {
|
||||
return blindBoxId;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxId(String blindBoxId) {
|
||||
this.blindBoxId = blindBoxId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class LiveGiftBean {
|
||||
// public static final int MARK_LUCK = 3;
|
||||
|
||||
private int id;
|
||||
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团
|
||||
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团 5盲盒礼物
|
||||
private int mark;// 0 普通 1热门 2守护 3幸运
|
||||
private String name;
|
||||
private String price;
|
||||
@@ -34,6 +34,17 @@ public class LiveGiftBean {
|
||||
private String isweek;
|
||||
private String end_time;
|
||||
private String tag;
|
||||
@JSONField(name = "blind_box_type")
|
||||
private int blind_box_type = 0;
|
||||
|
||||
public int getBlind_box_type() {
|
||||
return blind_box_type;
|
||||
}
|
||||
|
||||
public LiveGiftBean setBlind_box_type(int blind_box_type) {
|
||||
this.blind_box_type = blind_box_type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class AllServerNotifyEvent extends BaseModel {
|
||||
//礼物图标
|
||||
@SerializedName("gifticon")
|
||||
private String giftIcon;
|
||||
//用户名
|
||||
@SerializedName("userNiceName")
|
||||
private String userNiceName;
|
||||
//礼物名称
|
||||
@SerializedName("giftname")
|
||||
private String giftName;
|
||||
//盲盒名称
|
||||
@SerializedName("box_type_name")
|
||||
private String boxTypeName;
|
||||
//饰品名称
|
||||
@SerializedName("dress_name")
|
||||
private String dressName;
|
||||
//区分礼物还是饰品 lw 1 sp 0
|
||||
@SerializedName("gift_notification")
|
||||
private String giftNotification;
|
||||
//盲盒礼物ID
|
||||
@SerializedName("blind_box_id")
|
||||
private String blindBoxId;
|
||||
//盲盒类型
|
||||
@SerializedName("box_type")
|
||||
private String boxType;
|
||||
//饰品图片
|
||||
@SerializedName("display_src")
|
||||
private String displaySrc;
|
||||
//主播名字
|
||||
@SerializedName("ancherName")
|
||||
private String anchorName;
|
||||
|
||||
public String getAnchorName() {
|
||||
return anchorName;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setAnchorName(String anchorName) {
|
||||
this.anchorName = anchorName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDisplaySrc() {
|
||||
return displaySrc;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setDisplaySrc(String displaySrc) {
|
||||
this.displaySrc = displaySrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBoxType() {
|
||||
return boxType;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setBoxType(String boxType) {
|
||||
this.boxType = boxType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftIcon() {
|
||||
return giftIcon;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setGiftIcon(String giftIcon) {
|
||||
this.giftIcon = giftIcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserNiceName() {
|
||||
return userNiceName;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBoxTypeName() {
|
||||
return boxTypeName;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setBoxTypeName(String boxTypeName) {
|
||||
this.boxTypeName = boxTypeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressName() {
|
||||
return dressName;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setDressName(String dressName) {
|
||||
this.dressName = dressName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftNotification() {
|
||||
return giftNotification;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setGiftNotification(String giftNotification) {
|
||||
this.giftNotification = giftNotification;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxId() {
|
||||
return blindBoxId;
|
||||
}
|
||||
|
||||
public AllServerNotifyEvent setBlindBoxId(String blindBoxId) {
|
||||
this.blindBoxId = blindBoxId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "\n" + "AllServerNotifyEvent{" + "\n" +
|
||||
"giftIcon='" + giftIcon + '\'' + "\n" +
|
||||
", userNiceName='" + userNiceName + '\'' + "\n" +
|
||||
", giftName='" + giftName + '\'' + "\n" +
|
||||
", boxTypeName='" + boxTypeName + '\'' + "\n" +
|
||||
", dressName='" + dressName + '\'' + "\n" +
|
||||
", giftNotification='" + giftNotification + '\'' + "\n" +
|
||||
", blindBoxId='" + blindBoxId + '\'' + "\n" +
|
||||
", boxType='" + boxType + '\'' + "\n" +
|
||||
", displaySrc='" + displaySrc + '\'' + "\n" +
|
||||
'}' + "\n" ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,559 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class SendBlindGiftEvent extends BaseModel {
|
||||
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
@SerializedName("giftid")
|
||||
private String giftid;
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
@SerializedName("mark")
|
||||
private String mark;
|
||||
@SerializedName("wrap_gift_num")
|
||||
private String wrapGiftNum;
|
||||
@SerializedName("giftcount")
|
||||
private String giftcount;
|
||||
@SerializedName("totalcoin")
|
||||
private String totalcoin;
|
||||
@SerializedName("giftname")
|
||||
private String giftname;
|
||||
@SerializedName("giftnameen")
|
||||
private String giftnameen;
|
||||
@SerializedName("gifticon")
|
||||
private String gifticon;
|
||||
@SerializedName("swftime")
|
||||
private String swftime;
|
||||
@SerializedName("swftype")
|
||||
private String swftype;
|
||||
@SerializedName("swf")
|
||||
private String swf;
|
||||
@SerializedName("level")
|
||||
private String level;
|
||||
@SerializedName("medal_name")
|
||||
private String medalName;
|
||||
@SerializedName("medal_level")
|
||||
private String medalLevel;
|
||||
@SerializedName("coin")
|
||||
private String coin;
|
||||
@SerializedName("gold")
|
||||
private String gold;
|
||||
@SerializedName("votestotal")
|
||||
private String votestotal;
|
||||
@SerializedName("medalRankNum")
|
||||
private String medalRankNum;
|
||||
@SerializedName("ispk")
|
||||
private String ispk;
|
||||
@SerializedName("pkuid")
|
||||
private boolean pkuid;
|
||||
@SerializedName("pkuid1")
|
||||
private String pkuid1;
|
||||
@SerializedName("pkuid2")
|
||||
private String pkuid2;
|
||||
@SerializedName("pktotal1")
|
||||
private String pktotal1;
|
||||
@SerializedName("pktotal2")
|
||||
private String pktotal2;
|
||||
@SerializedName("active_total")
|
||||
private String activeTotal;
|
||||
@SerializedName("blind_box_status")
|
||||
private boolean blindBoxStatus;
|
||||
@SerializedName("gift_id")
|
||||
private String giftId;
|
||||
@SerializedName("gift_type")
|
||||
private String giftType;
|
||||
@SerializedName("needcoin")
|
||||
private String needcoin;
|
||||
@SerializedName("gift_msg")
|
||||
private String giftMsg;
|
||||
@SerializedName("gift_colour")
|
||||
private String giftColour;
|
||||
@SerializedName("box_type")
|
||||
private String boxType;
|
||||
@SerializedName("box_type_name")
|
||||
private String boxTypeName;
|
||||
@SerializedName("action")
|
||||
private String action;
|
||||
@SerializedName("dress_notification")
|
||||
private boolean dressNotification;
|
||||
@SerializedName("dress_type")
|
||||
private Object dressType;
|
||||
@SerializedName("dress_id")
|
||||
private Object dressId;
|
||||
@SerializedName("dress_name")
|
||||
private String dressName;
|
||||
@SerializedName("display_src")
|
||||
private Object displaySrc;
|
||||
@SerializedName("effect_src")
|
||||
private Object effectSrc;
|
||||
@SerializedName("dress_description")
|
||||
private Object dressDescription;
|
||||
@SerializedName("noble_dress")
|
||||
private Object nobleDress;
|
||||
@SerializedName("dress_msg")
|
||||
private String dressMsg;
|
||||
@SerializedName("dress_colour")
|
||||
private String dressColour;
|
||||
@SerializedName("dress_threshold_value")
|
||||
private String dressThresholdValue;
|
||||
@SerializedName("threshold_value")
|
||||
private String thresholdValue;
|
||||
@SerializedName("live_gift_notify")
|
||||
private String liveGiftNotify;
|
||||
@SerializedName("userNiceName")
|
||||
private String userNiceName;
|
||||
|
||||
public String getUserNiceName() {
|
||||
return userNiceName;
|
||||
}
|
||||
|
||||
public String getThresholdValue() {
|
||||
return thresholdValue;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setThresholdValue(String thresholdValue) {
|
||||
this.thresholdValue = thresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftid() {
|
||||
return giftid;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftid(String giftid) {
|
||||
this.giftid = giftid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMark() {
|
||||
return mark;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setMark(String mark) {
|
||||
this.mark = mark;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getWrapGiftNum() {
|
||||
return wrapGiftNum;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setWrapGiftNum(String wrapGiftNum) {
|
||||
this.wrapGiftNum = wrapGiftNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftcount() {
|
||||
return giftcount;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftcount(String giftcount) {
|
||||
this.giftcount = giftcount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTotalcoin() {
|
||||
return totalcoin;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setTotalcoin(String totalcoin) {
|
||||
this.totalcoin = totalcoin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftnameen() {
|
||||
return giftnameen;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftnameen(String giftnameen) {
|
||||
this.giftnameen = giftnameen;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGifticon() {
|
||||
return gifticon;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGifticon(String gifticon) {
|
||||
this.gifticon = gifticon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSwftime() {
|
||||
return swftime;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setSwftime(String swftime) {
|
||||
this.swftime = swftime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSwftype() {
|
||||
return swftype;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setSwftype(String swftype) {
|
||||
this.swftype = swftype;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSwf() {
|
||||
return swf;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setSwf(String swf) {
|
||||
this.swf = swf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setLevel(String level) {
|
||||
this.level = level;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalName() {
|
||||
return medalName;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setMedalName(String medalName) {
|
||||
this.medalName = medalName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalLevel() {
|
||||
return medalLevel;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setMedalLevel(String medalLevel) {
|
||||
this.medalLevel = medalLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCoin() {
|
||||
return coin;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setCoin(String coin) {
|
||||
this.coin = coin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGold() {
|
||||
return gold;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGold(String gold) {
|
||||
this.gold = gold;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVotestotal() {
|
||||
return votestotal;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setVotestotal(String votestotal) {
|
||||
this.votestotal = votestotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMedalRankNum() {
|
||||
return medalRankNum;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setMedalRankNum(String medalRankNum) {
|
||||
this.medalRankNum = medalRankNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIspk() {
|
||||
return ispk;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setIspk(String ispk) {
|
||||
this.ispk = ispk;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isPkuid() {
|
||||
return pkuid;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setPkuid(boolean pkuid) {
|
||||
this.pkuid = pkuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkuid1() {
|
||||
return pkuid1;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setPkuid1(String pkuid1) {
|
||||
this.pkuid1 = pkuid1;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPkuid2() {
|
||||
return pkuid2;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setPkuid2(String pkuid2) {
|
||||
this.pkuid2 = pkuid2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPktotal1() {
|
||||
return pktotal1;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setPktotal1(String pktotal1) {
|
||||
this.pktotal1 = pktotal1;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPktotal2() {
|
||||
return pktotal2;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setPktotal2(String pktotal2) {
|
||||
this.pktotal2 = pktotal2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveTotal() {
|
||||
return activeTotal;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setActiveTotal(String activeTotal) {
|
||||
this.activeTotal = activeTotal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isBlindBoxStatus() {
|
||||
return blindBoxStatus;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setBlindBoxStatus(boolean blindBoxStatus) {
|
||||
this.blindBoxStatus = blindBoxStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftId(String giftId) {
|
||||
this.giftId = giftId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftType() {
|
||||
return giftType;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftType(String giftType) {
|
||||
this.giftType = giftType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNeedcoin() {
|
||||
return needcoin;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setNeedcoin(String needcoin) {
|
||||
this.needcoin = needcoin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftMsg() {
|
||||
return giftMsg;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftMsg(String giftMsg) {
|
||||
this.giftMsg = giftMsg;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getGiftColour() {
|
||||
return giftColour;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setGiftColour(String giftColour) {
|
||||
this.giftColour = giftColour;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBoxType() {
|
||||
return boxType;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setBoxType(String boxType) {
|
||||
this.boxType = boxType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBoxTypeName() {
|
||||
return boxTypeName;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setBoxTypeName(String boxTypeName) {
|
||||
this.boxTypeName = boxTypeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setAction(String action) {
|
||||
this.action = action;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDressNotification() {
|
||||
return dressNotification;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressNotification(boolean dressNotification) {
|
||||
this.dressNotification = dressNotification;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getDressType() {
|
||||
return dressType;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressType(Object dressType) {
|
||||
this.dressType = dressType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getDressId() {
|
||||
return dressId;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressId(Object dressId) {
|
||||
this.dressId = dressId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressName() {
|
||||
return dressName;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressName(String dressName) {
|
||||
this.dressName = dressName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getDisplaySrc() {
|
||||
return displaySrc;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDisplaySrc(Object displaySrc) {
|
||||
this.displaySrc = displaySrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getEffectSrc() {
|
||||
return effectSrc;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setEffectSrc(Object effectSrc) {
|
||||
this.effectSrc = effectSrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getDressDescription() {
|
||||
return dressDescription;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressDescription(Object dressDescription) {
|
||||
this.dressDescription = dressDescription;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getNobleDress() {
|
||||
return nobleDress;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setNobleDress(Object nobleDress) {
|
||||
this.nobleDress = nobleDress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressMsg() {
|
||||
return dressMsg;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressMsg(String dressMsg) {
|
||||
this.dressMsg = dressMsg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressColour() {
|
||||
return dressColour;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressColour(String dressColour) {
|
||||
this.dressColour = dressColour;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressThresholdValue() {
|
||||
return dressThresholdValue;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setDressThresholdValue(String dressThresholdValue) {
|
||||
this.dressThresholdValue = dressThresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLiveGiftNotify() {
|
||||
return liveGiftNotify;
|
||||
}
|
||||
|
||||
public SendBlindGiftEvent setLiveGiftNotify(String liveGiftNotify) {
|
||||
this.liveGiftNotify = liveGiftNotify;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
@@ -17,11 +18,11 @@ import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
@@ -716,10 +717,17 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.setLiveVote")
|
||||
Observable<ResponseModel<List<String>>> updateLiveVote(@Query("liveuid") String liveUid,
|
||||
@Query("option_content_key") String key);
|
||||
@Query("option_content_key") String key);
|
||||
|
||||
/**
|
||||
* 主动结束投票
|
||||
*/
|
||||
@GET("/api/public/?service=Live.endLiveVote")
|
||||
Observable<ResponseModel<List<String>>> endLiveVote(@Query("liveuid") String liveUid);
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物当前数据
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getBlindBoxInfo")
|
||||
Observable<ResponseModel<List<BlindBoxInfoModel>>> getBlindBoxInfo();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
@@ -18,11 +19,11 @@ import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
@@ -1522,6 +1523,33 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物信息
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getBlindBoxInfo(HttpCallback<List<BlindBoxInfoModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBlindBoxInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BlindBoxInfoModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BlindBoxInfoModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.lxj.xpopup.animator.PopupAnimator;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
/**
|
||||
* 输入弹窗
|
||||
@@ -54,15 +55,21 @@ public class InputCustomPopup extends CenterPopupView {
|
||||
findViewById(R.id.btn_confirm).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String textContent = content.getText().toString();
|
||||
if (TextUtils.isEmpty(textContent)) {
|
||||
ToastUtil.show("输入内容不可为空");
|
||||
return;
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onConfirm(textContent);
|
||||
}
|
||||
dismiss(); // 关闭弹窗
|
||||
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
String textContent = content.getText().toString();
|
||||
if (TextUtils.isEmpty(textContent)) {
|
||||
ToastUtil.show("输入内容不可为空");
|
||||
return;
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onConfirm(textContent);
|
||||
}
|
||||
dismiss(); // 关闭弹窗
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
23
common/src/main/res/drawable/bg_blind_progres.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#90FB712D" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#FCCCA4"
|
||||
android:startColor="#FCAB6A" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
24
common/src/main/res/drawable/bg_blind_progress.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#909FFBF6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress" >
|
||||
<scale android:scaleWidth="100%" android:scaleHeight="6dp">
|
||||
<shape >
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#10A5FB"
|
||||
android:startColor="#78E2FD" />
|
||||
</shape>
|
||||
</scale>
|
||||
|
||||
</item>
|
||||
</layer-list>
|
||||
23
common/src/main/res/drawable/bg_blind_progress1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#90F8B334" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:startColor="#FFF682"
|
||||
android:endColor="#FDF9C2" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1177,4 +1177,5 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="live_vote_hide_text">VOTE</string>
|
||||
<string name="live_room_vote_over_tip">%s <br/> box disappears after %s seconds</string>
|
||||
<string name="live_anchor_vote_tip">Please complete the form.</string>
|
||||
<string name="live_vote_create_error">Create Vote Error</string>
|
||||
</resources>
|
||||
|
||||
@@ -1172,4 +1172,5 @@
|
||||
<string name="complete_information_hint2">愛你,愛你</string>
|
||||
<string name="you_guide_me">指導下我好嗎</string>
|
||||
<string name="complete_information">完整填寫領大禮</string>
|
||||
<string name="live_vote_create_error">投票創建失敗</string>
|
||||
</resources>
|
||||
|
||||
@@ -1171,4 +1171,5 @@
|
||||
<string name="complete_information_hint2">愛你,愛你</string>
|
||||
<string name="you_guide_me">指導下我好嗎</string>
|
||||
<string name="complete_information">完整填寫領大禮</string>
|
||||
<string name="live_vote_create_error">投票創建失敗</string>
|
||||
</resources>
|
||||
|
||||
@@ -1160,7 +1160,7 @@
|
||||
<string name="live_vote_close_yes">是</string>
|
||||
<string name="live_vote_close_no">否</string>
|
||||
<string name="live_vote_hide_text">投票中</string>
|
||||
<string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string>
|
||||
<string name="live_room_vote_over_tip">%s <br /> 問答框%s秒后消失</string>
|
||||
<string name="live_anchor_vote_tip">請完整填寫</string>
|
||||
<string name="complete_information_consumable">填寫“*”的選項可完成</string>
|
||||
<string name="love_powder">真愛粉\n頭像框(7天)</string>
|
||||
@@ -1172,4 +1172,10 @@
|
||||
<string name="complete_information_hint3">離開會讓您失去獎勵,您確認離開嗎?</string>
|
||||
<string name="complete_information_hint2">愛你,愛你</string>
|
||||
<string name="you_guide_me">指導下我好嗎</string>
|
||||
<string name="resend_win">再送%s个必得%s</string>
|
||||
<string name="have_already_win">已将%s发送至您的个性装扮</string>
|
||||
<string name="mini_blind_box">迷你盲盒</string>
|
||||
<string name="collection_blind_box">典藏盲盒</string>
|
||||
<string name="pd_blind_box">PD盲盒</string>
|
||||
<string name="live_vote_create_error">投票創建失敗</string>
|
||||
</resources>
|
||||
|
||||
@@ -1165,7 +1165,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="live_vote_close_yes">Yes</string>
|
||||
<string name="live_vote_close_no">No</string>
|
||||
<string name="live_vote_hide_text">VOTE</string>
|
||||
<string name="live_room_vote_over_tip">%s <br/> box disappears after %s seconds</string>
|
||||
<string name="live_room_vote_over_tip">%s <br /> box disappears after %s seconds</string>
|
||||
<string name="live_anchor_vote_tip">Please complete the form.</string>
|
||||
<string name="complete_information">Fill And gift</string>
|
||||
<string name="complete_information_consumable">Fill in the \'*\' option to complete</string>
|
||||
@@ -1178,4 +1178,19 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="complete_information_hint3">Leave without a gift</string>
|
||||
<string name="complete_information_hint2">Love you</string>
|
||||
<string name="you_guide_me">Can you guide me</string>
|
||||
<string name="resend_win">再送%s个必得%s</string>
|
||||
<string name="have_already_win">已将%s发送至您的个性装扮</string>
|
||||
<string name="mini_blind_box">迷你盲盒</string>
|
||||
<string name="collection_blind_box">典藏盲盒</string>
|
||||
<string name="pd_blind_box">PD盲盒</string>
|
||||
<string name="individual_dressing">个性装扮</string>
|
||||
<string name="random_availability">可随机获得,%s</string>
|
||||
<string name="random_availability2">已获得,%s,%s</string>
|
||||
<string name="random_availability3">已获得,%s</string>
|
||||
<string name="get_it_done">完成必得</string>
|
||||
<string name="blind_box_list">盲盒榜</string>
|
||||
<string name="participate_in">參與</string>
|
||||
<string name="extract_to">%s在%s中抽取到了</string>
|
||||
<string name="extract_to2">%S送给了%s</string>
|
||||
<string name="live_vote_create_error">Create Vote Error</string>
|
||||
</resources>
|
||||
|
||||
BIN
live/src/main/assets/hdsn.svga
Normal file
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
@@ -31,6 +33,7 @@ import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.event.CoinChangeEvent;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
|
||||
@@ -40,7 +43,6 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.utils.formatBigNum;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.GuardUserBean;
|
||||
@@ -317,25 +319,27 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
* 收到礼物消息
|
||||
*/
|
||||
@Override
|
||||
public void onSendGift(LiveReceiveGiftBean bean) {
|
||||
|
||||
//购买守护
|
||||
if (bean.ismTypeBuyGuard()) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (!mIsAnchor) {
|
||||
mLiveRoomViewHolder.showGuardGifMessage(bean);
|
||||
public void onSendGift(LiveReceiveGiftBean bean, SendBlindGiftEvent event) {
|
||||
if (event == null) {
|
||||
//购买守护
|
||||
if (bean.ismTypeBuyGuard()) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (!mIsAnchor) {
|
||||
mLiveRoomViewHolder.showGuardGifMessage(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
|
||||
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
|
||||
}
|
||||
mLiveRoomViewHolder.showGiftMessage(bean, mIsAnchor);
|
||||
} else {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
|
||||
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
|
||||
}
|
||||
mLiveRoomViewHolder.showGiftMessage(bean, mIsAnchor);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -388,6 +392,17 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndPk(long leftUid, long rightUid, long left, long right, LivePKUserListBean bean) {
|
||||
if (mLiveRyLinkMicPkPresenter != null) {
|
||||
if (mLiveUid.equals(leftUid + "")) {
|
||||
mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right, bean);
|
||||
} else {
|
||||
mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left, bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到弹幕消息
|
||||
*/
|
||||
@@ -1362,6 +1377,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开购买守护的弹窗
|
||||
*/
|
||||
|
||||
@@ -81,7 +81,6 @@ import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.CustomDrawerPopupView;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.weight.VerticalViewPager;
|
||||
@@ -861,10 +860,10 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
public void showerHtml(String htmlUrl, boolean screen) {
|
||||
if (TextUtils.equals(htmlUrl, "recharge")) {
|
||||
RouteUtil.forwardMyCoin(mContext);
|
||||
} else if (TextUtils.equals(htmlUrl, "to_me_information")){
|
||||
onBackPressed();
|
||||
} else if (TextUtils.equals(htmlUrl, "to_me_information")) {
|
||||
onBackPressed();
|
||||
Constants.isShowPage = 3;
|
||||
}else {
|
||||
} else {
|
||||
if (!screen) {
|
||||
ZhuangBanActivity.forward(mContext, htmlUrl, false);
|
||||
} else {
|
||||
@@ -1377,7 +1376,11 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
break;
|
||||
case BLIND_BOX:
|
||||
if (manager != null) {
|
||||
manager.blindBoxAllServerNotify(event.getAllServerNotifyEvent());
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.NotCancelableDialog;
|
||||
import com.yunbao.common.event.LoginInvalidEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@@ -73,6 +74,7 @@ import com.yunbao.common.views.LiveNewWishListPopup;
|
||||
import com.yunbao.common.views.LiveRobotSettingCustomPopup;
|
||||
import com.yunbao.faceunity.FaceManager;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveChatBean;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
@@ -1464,14 +1466,13 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendGift(LiveReceiveGiftBean bean) {
|
||||
//购买守护
|
||||
if (bean.ismTypeBuyGuard()) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showGuardGifMessage(bean);
|
||||
}
|
||||
} else {
|
||||
|
||||
public void onSendGift(LiveReceiveGiftBean bean, SendBlindGiftEvent event) {
|
||||
if (event!=null){
|
||||
//插入盲盒礼物消息
|
||||
bean.getLiveChatBean().setType(LiveChatBean.BLIND_BOX);
|
||||
bean.getLiveChatBean().setContent(event.getGiftMsg());
|
||||
bean.getLiveChatBean().setGiftName(event.getGiftname());
|
||||
bean.getLiveChatBean().setUserNiceName(event.getUserNiceName());
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
|
||||
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
|
||||
@@ -1479,8 +1480,25 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
mLiveRoomViewHolder.showGiftMessage(bean, false);
|
||||
mLiveRoomViewHolder.updataWishList(bean.getGiftId(), bean.getGiftCount());
|
||||
}
|
||||
}else {
|
||||
//购买守护
|
||||
if (bean.ismTypeBuyGuard()) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showGuardGifMessage(bean);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
|
||||
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
|
||||
}
|
||||
mLiveRoomViewHolder.showGiftMessage(bean, false);
|
||||
mLiveRoomViewHolder.updataWishList(bean.getGiftId(), bean.getGiftCount());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void printLog(String content) {
|
||||
|
||||
@@ -27,11 +27,9 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -49,7 +47,6 @@ import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
@@ -360,6 +357,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
mTextView.setText(builder);
|
||||
} else if (bean.getType() == -10) {
|
||||
mBg.setBackground(null);
|
||||
} else if (bean.getType() == LiveChatBean.BLIND_BOX) {
|
||||
Log.e("BLIND_BOX", bean.toString());
|
||||
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
|
||||
new LiveTextRender().blindBox(mContext, mTextView, bean);
|
||||
} else if (bean.getType() == LiveChatBean.SYSTEM) {
|
||||
boolean isContains = false;
|
||||
for (LiveChatBean model : mList) {
|
||||
|
||||
@@ -26,7 +26,7 @@ public class LiveChatBean {
|
||||
public static final int SYSTEM3_COLOR = 108;//带颜色的系统消息,格式 XXXX<font color='#FF8E43'>YYY</font>
|
||||
public static final int XYD_COMPLETE = 207;//心愿单完成通知
|
||||
public static final int WISH_LIST_PROGRESS = 307;//心愿单进度通知
|
||||
|
||||
public static final int BLIND_BOX = 409;//盲盒礼物消息
|
||||
|
||||
|
||||
private String id;
|
||||
@@ -52,6 +52,17 @@ public class LiveChatBean {
|
||||
private String prankIcon;
|
||||
private String hot_card;
|
||||
private MsgModel msgModel = new MsgModel();//自定义消息体
|
||||
private String giftName;
|
||||
|
||||
public String getGiftName() {
|
||||
return giftName;
|
||||
}
|
||||
|
||||
public LiveChatBean setGiftName(String giftName) {
|
||||
this.giftName = giftName;
|
||||
return this;
|
||||
}
|
||||
|
||||
private AiAutomaticSpeechModel aiAutomaticSpeechModel = new AiAutomaticSpeechModel();//机器人消息体
|
||||
|
||||
public AiAutomaticSpeechModel getAiAutomaticSpeechModel() {
|
||||
@@ -369,4 +380,45 @@ public class LiveChatBean {
|
||||
public void setMedalLevelImageUrl(String medalLevelImageUrl) {
|
||||
this.medalLevelImageUrl = medalLevelImageUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveChatBean{" +
|
||||
"NORMAL=" + NORMAL +
|
||||
", id='" + id + '\'' +
|
||||
", userNiceName='" + userNiceName + '\'' +
|
||||
", level=" + level +
|
||||
", content='" + content + '\'' +
|
||||
", heart=" + heart +
|
||||
", type=" + type +
|
||||
", liangName='" + liangName + '\'' +
|
||||
", vipType=" + vipType +
|
||||
", guardType=" + guardType +
|
||||
", anchor=" + anchor +
|
||||
", manager=" + manager +
|
||||
", medalNmae='" + medalNmae + '\'' +
|
||||
", medalLevelImageUrl='" + medalLevelImageUrl + '\'' +
|
||||
", bubble='" + bubble + '\'' +
|
||||
", medal='" + medal + '\'' +
|
||||
", medal_new='" + medal_new + '\'' +
|
||||
", medal_honor='" + medal_honor + '\'' +
|
||||
", hot_num='" + hot_num + '\'' +
|
||||
", good_nub='" + good_nub + '\'' +
|
||||
", anchorName='" + anchorName + '\'' +
|
||||
", prankIcon='" + prankIcon + '\'' +
|
||||
", hot_card='" + hot_card + '\'' +
|
||||
", msgModel=" + msgModel +
|
||||
", giftName='" + giftName + '\'' +
|
||||
", aiAutomaticSpeechModel=" + aiAutomaticSpeechModel +
|
||||
", nobleId='" + nobleId + '\'' +
|
||||
", nobleIcon='" + nobleIcon + '\'' +
|
||||
", bubbleSrc='" + bubbleSrc + '\'' +
|
||||
", startColor='" + startColor + '\'' +
|
||||
", endColor='" + endColor + '\'' +
|
||||
", contentColor='" + contentColor + '\'' +
|
||||
", atUserName='" + atUserName + '\'' +
|
||||
", atUserID='" + atUserID + '\'' +
|
||||
", isAttention=" + isAttention +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,15 @@ package com.yunbao.live.bean;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/22.
|
||||
* 收到送礼物消息的实体类
|
||||
*/
|
||||
|
||||
public class LiveReceiveGiftBean {
|
||||
public class LiveReceiveGiftBean extends BaseModel {
|
||||
|
||||
private String uid;
|
||||
private String avatar;
|
||||
@@ -51,6 +53,26 @@ public class LiveReceiveGiftBean {
|
||||
private String nobilityname;
|
||||
private String opentype;
|
||||
private String anchorUid;
|
||||
private boolean isBlindBox = false;
|
||||
private AllServerNotifyEvent event = new AllServerNotifyEvent();
|
||||
|
||||
public AllServerNotifyEvent getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setEvent(AllServerNotifyEvent event) {
|
||||
this.event = event;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isBlindBox() {
|
||||
return isBlindBox;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setBlindBox(boolean blindBox) {
|
||||
isBlindBox = blindBox;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnchorUid() {
|
||||
return anchorUid;
|
||||
|
||||
@@ -11,7 +11,10 @@ import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -19,9 +22,11 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
@@ -35,14 +40,23 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean2;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
@@ -51,10 +65,13 @@ import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.NobleUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.adapter.GiftTopAdapter;
|
||||
import com.yunbao.live.adapter.LiveGiftCountAdapter;
|
||||
import com.yunbao.live.adapter.LiveGiftPagerAdapter;
|
||||
@@ -70,6 +87,8 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -88,7 +107,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
private ViewPager mVPWrapList;
|
||||
private RadioGroup mRadioGroup, mRGroupWrap;
|
||||
private View mLoading;
|
||||
private View mArrow;
|
||||
private View mArrow, iconMasking;
|
||||
private View mBtnSend;
|
||||
private View mBtnSendGroup;
|
||||
private View mBtnSendLian;
|
||||
@@ -120,19 +139,21 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
|
||||
private RecyclerView items;
|
||||
private LinearLayout mVipGold;
|
||||
private FrameLayout blindBox, frameBlindTop;
|
||||
private ProgressBar progressBlind, progressBlind1, progressBlind2;
|
||||
private GiftTopAdapter giftTopAdapter;
|
||||
public int type = 0;
|
||||
private static String type_name = "熱門";
|
||||
JSONArray list;
|
||||
private ImageView mVipGoldIcon;
|
||||
private ImageView mVipGoldIcon, description;
|
||||
private TextView mVipGoldTitle;
|
||||
private TextView mVipGoldDesc;
|
||||
private TextView mGiftPackage;
|
||||
private TextView mGiftPackage, blindNumber, textBlindProgress, textBlindGiftName;
|
||||
private boolean isPk;
|
||||
private int isContactGift = 0;
|
||||
DialogInterface.OnDismissListener onDismissListener;
|
||||
DialogInterface.OnShowListener onShowListener;
|
||||
|
||||
private SVGAImageView blindSvga, blindBoxOpen;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -152,9 +173,10 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
window.setDimAmount(0f);//去掉遮罩层(全透明)
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = DpUtil.dp2px(355);
|
||||
params.height = DpUtil.dp2px(433);
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
@@ -166,6 +188,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
Bus.getOff(this);
|
||||
if (onDismissListener != null) {
|
||||
onDismissListener.onDismiss(dialog);
|
||||
}
|
||||
@@ -186,12 +209,21 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
Bus.getOn(this);
|
||||
mCoin = (TextView) mRootView.findViewById(R.id.coin);
|
||||
mTvGoldCoin = (TextView) mRootView.findViewById(R.id.goldCoin);
|
||||
mTvGoCharge = (TextView) mRootView.findViewById(R.id.go_charge);
|
||||
items = (RecyclerView) mRootView.findViewById(R.id.items);
|
||||
mLoading = mRootView.findViewById(R.id.loading);
|
||||
blindBox = mRootView.findViewById(R.id.blind_box);
|
||||
frameBlindTop = mRootView.findViewById(R.id.frame_blind_top);
|
||||
progressBlind = mRootView.findViewById(R.id.progress_blind1);
|
||||
progressBlind1 = mRootView.findViewById(R.id.progress_blind2);
|
||||
progressBlind2 = mRootView.findViewById(R.id.progress_blind3);
|
||||
mArrow = mRootView.findViewById(R.id.arrow);
|
||||
iconMasking = mRootView.findViewById(R.id.icon_masking);
|
||||
blindSvga = mRootView.findViewById(R.id.blind_svga);
|
||||
blindBoxOpen = mRootView.findViewById(R.id.blind_box_open);
|
||||
mBtnSend = mRootView.findViewById(R.id.btn_send);
|
||||
mBtnSendGroup = mRootView.findViewById(R.id.btn_send_group);
|
||||
mBtnSendLian = mRootView.findViewById(R.id.btn_send_lian);
|
||||
@@ -281,10 +313,14 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
mTvGoldCoin.setOnClickListener(this);
|
||||
mVipGold = mRootView.findViewById(R.id.btn_luck_gift_tip);
|
||||
mVipGoldIcon = mRootView.findViewById(R.id.vipGoldIcon);
|
||||
description = mRootView.findViewById(R.id.description);
|
||||
mVipGoldTitle = mRootView.findViewById(R.id.vipGoldTitle);
|
||||
mVipGoldDesc = mRootView.findViewById(R.id.vipGoldDesc);
|
||||
mVipGold.setOnClickListener(this);
|
||||
mGiftPackage = mRootView.findViewById(R.id.btn_gift_package);
|
||||
blindNumber = mRootView.findViewById(R.id.blind_number);
|
||||
textBlindProgress = mRootView.findViewById(R.id.text_blind_progress);
|
||||
textBlindGiftName = mRootView.findViewById(R.id.text_blind_gift_name);
|
||||
mGiftPackage.setOnClickListener(this);
|
||||
mRootView.findViewById(R.id.live_gift_download_all).setOnClickListener(this);
|
||||
mHandler = new Handler() {
|
||||
@@ -319,6 +355,41 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
if (isPk) {
|
||||
mVipGold.setVisibility(View.GONE);
|
||||
}
|
||||
getBlindBoxInfo();
|
||||
ViewClicksAntiShake.clicksAntiShake(description, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/h5/info/index.html?uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken());
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", htmlUrl.toString());
|
||||
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public List<BlindBoxInfoModel> blindBoxInfoModels = new ArrayList<>();
|
||||
|
||||
private void getBlindBoxInfo() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getBlindBoxInfo(new com.yunbao.common.http.base.HttpCallback<List<BlindBoxInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<BlindBoxInfoModel> data) {
|
||||
blindBoxInfoModels = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -373,7 +444,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
upData();
|
||||
mCoin.setText(obj.getString("coin"));
|
||||
mTvGoldCoin.setText(obj.getString("gold"));
|
||||
Bus.getOn(LiveGiftDialogFragment.this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,6 +724,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
|
||||
private void itemCheckOp(LiveGiftBean bean) {
|
||||
stringBuilders.clear();
|
||||
mLiveGiftBean = bean;
|
||||
hideLianBtn();
|
||||
mBtnSend.setEnabled(true);
|
||||
@@ -665,7 +736,146 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
mBtnChooseCount.setVisibility(View.VISIBLE);
|
||||
mArrow.setVisibility(View.VISIBLE);
|
||||
mBtnSend.setBackground(mDrawable1);
|
||||
mBtnChooseCount.setEnabled(true);
|
||||
}
|
||||
if (bean.getType() == 5) {
|
||||
|
||||
showBlindProgress(bean.getBlind_box_type());
|
||||
} else {
|
||||
if (isPk) {
|
||||
mVipGold.setVisibility(View.GONE);
|
||||
} else {
|
||||
mVipGold.setVisibility(View.VISIBLE);
|
||||
}
|
||||
blindBox.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示当前盲盒礼物进度
|
||||
*
|
||||
* @param blindBoxType
|
||||
*/
|
||||
private StringBuffer blindGiftNamesBuffer = null;
|
||||
private int blindBoxType;
|
||||
|
||||
private void showBlindProgress(int blindBoxType) {
|
||||
this.blindBoxType = blindBoxType;
|
||||
blindGiftNamesBuffer = new StringBuffer();
|
||||
BlindBoxInfoModel model = null;
|
||||
for (BlindBoxInfoModel boxInfoModel : blindBoxInfoModels) {
|
||||
if (TextUtils.equals(String.valueOf(blindBoxType), boxInfoModel.getBlindBoxType())) {
|
||||
model = boxInfoModel;
|
||||
}
|
||||
}
|
||||
if (model == null) return;
|
||||
blindBoxOpen.clear();
|
||||
blindBoxOpen.setVisibility(View.GONE);
|
||||
try {
|
||||
blindSvga.clear();
|
||||
new SVGAParser(mContext).parse(new URL(model.getThresholdEffectSrc()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
blindSvga.setImageDrawable(drawable);
|
||||
SVGAViewUtils.playEndClear(blindSvga, false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
Log.e("errqs", "errl");
|
||||
}
|
||||
});
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mArrow.setVisibility(View.GONE);
|
||||
mBtnChooseCount.setEnabled(false);
|
||||
mVipGold.setVisibility(View.GONE);
|
||||
blindBox.setVisibility(View.VISIBLE);
|
||||
String boxBlindName = "";
|
||||
switch (blindBoxType) {
|
||||
case 1:
|
||||
boxBlindName = mContext.getString(R.string.mini_blind_box);
|
||||
progressBlind.setVisibility(View.VISIBLE);
|
||||
progressBlind1.setVisibility(View.GONE);
|
||||
progressBlind2.setVisibility(View.GONE);
|
||||
frameBlindTop.setBackgroundResource(R.mipmap.bg_kirin);
|
||||
progressBlind.setMax(Integer.parseInt(model.getThresholdValue()));
|
||||
progressBlind.setProgress(Integer.parseInt(model.getDressThresholdValue()));
|
||||
textBlindProgress.setTextColor(Color.parseColor("#047771"));
|
||||
break;
|
||||
case 2:
|
||||
boxBlindName = mContext.getString(R.string.collection_blind_box);
|
||||
progressBlind.setVisibility(View.GONE);
|
||||
progressBlind1.setVisibility(View.VISIBLE);
|
||||
progressBlind2.setVisibility(View.GONE);
|
||||
frameBlindTop.setBackgroundResource(R.mipmap.bg_phoenix);
|
||||
progressBlind1.setMax(Integer.parseInt(model.getThresholdValue()));
|
||||
progressBlind1.setProgress(Integer.parseInt(model.getDressThresholdValue()));
|
||||
textBlindProgress.setTextColor(Color.parseColor("#6D2E0F"));
|
||||
|
||||
break;
|
||||
default:
|
||||
boxBlindName = mContext.getString(R.string.pd_blind_box);
|
||||
progressBlind.setVisibility(View.GONE);
|
||||
progressBlind1.setVisibility(View.GONE);
|
||||
progressBlind2.setVisibility(View.VISIBLE);
|
||||
frameBlindTop.setBackgroundResource(R.mipmap.bg_dragon);
|
||||
progressBlind2.setMax(Integer.parseInt(model.getThresholdValue()));
|
||||
progressBlind2.setProgress(Integer.parseInt(model.getDressThresholdValue()));
|
||||
textBlindProgress.setTextColor(Color.parseColor("#905E01"));
|
||||
break;
|
||||
}
|
||||
|
||||
//进度下方提示语
|
||||
if (TextUtils.equals(model.getThresholdValue(), model.getDressThresholdValue())) {
|
||||
String individualDressing = mContext.getString(R.string.individual_dressing);
|
||||
String msg = mContext.getString(R.string.have_already_win);
|
||||
msg = String.format(msg, model.getThresholdDressName());
|
||||
int dressNameIndexOf = msg.indexOf(model.getThresholdDressName());
|
||||
int individualDressingIndexOf = msg.indexOf(String.valueOf(individualDressing));
|
||||
int dressNameSize = model.getThresholdDressName().length();
|
||||
int individualDressingSize = String.valueOf(individualDressing).length();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(msg);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), individualDressingIndexOf, individualDressingIndexOf + individualDressingSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
blindNumber.setText(builder);
|
||||
iconMasking.setAlpha(0.f);
|
||||
} else {
|
||||
int progress = Integer.parseInt(model.getThresholdValue()) - Integer.parseInt(model.getDressThresholdValue());
|
||||
String msg = mContext.getString(R.string.resend_win);
|
||||
msg = String.format(msg, String.valueOf(progress), model.getThresholdDressName());
|
||||
int dressNameIndexOf = msg.indexOf(model.getThresholdDressName());
|
||||
int progressIndexOf = msg.indexOf(String.valueOf(progress));
|
||||
int dressNameSize = model.getThresholdDressName().length();
|
||||
int progressSize = String.valueOf(progress).length();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(msg);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), progressIndexOf, progressIndexOf + progressSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
blindNumber.setText(builder);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(model.getDressThresholdValue())
|
||||
.append("/")
|
||||
.append(model.getThresholdValue());
|
||||
textBlindProgress.setText(stringBuffer.toString());
|
||||
float maskingAlpha = (float) progress / Float.parseFloat(model.getThresholdValue());
|
||||
iconMasking.setAlpha(maskingAlpha);
|
||||
}
|
||||
//盲盒礼物文字跑马灯
|
||||
for (int i = 0; i < model.getItemName().size(); i++) {
|
||||
blindGiftNamesBuffer
|
||||
.append(model.getItemName().get(i));
|
||||
|
||||
if (i != model.getItemName().size() - 1) {
|
||||
blindGiftNamesBuffer.append(",");
|
||||
}
|
||||
}
|
||||
textBlindGiftName.setText(String.format(mContext.getString(R.string.random_availability), blindGiftNamesBuffer.toString()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -864,4 +1074,175 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSendBlindGiftEvent(SendBlindGiftEvent event) {
|
||||
BlindBoxInfoModel model = null;
|
||||
for (int i = 0; i < blindBoxInfoModels.size(); i++) {
|
||||
if (TextUtils.equals(blindBoxInfoModels.get(i).getBlindBoxType(), event.getBoxType())) {
|
||||
blindBoxInfoModels.get(i).setDressThresholdValue(event.getDressThresholdValue());
|
||||
blindBoxInfoModels.get(i).setThresholdValue(event.getThresholdValue());
|
||||
model = blindBoxInfoModels.get(i);
|
||||
}
|
||||
}
|
||||
|
||||
long userID = IMLoginManager.get(mContext).getUserInfo().getId();
|
||||
String boxBlindName;
|
||||
try {
|
||||
if (!blindBoxOpen.isAnimating()) {
|
||||
new SVGAParser(mContext).parse(new URL(model.getBlindBoxSwf()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
blindBoxOpen.setVisibility(View.VISIBLE);
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
blindBoxOpen.setImageDrawable(drawable);
|
||||
blindBoxOpen.setLoops(1);
|
||||
blindBoxOpen.startAnimation();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
}
|
||||
});
|
||||
|
||||
blindBoxOpen.setCallback(new SVGACallback() {
|
||||
@Override
|
||||
public void onPause() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinished() {
|
||||
blindBoxOpen.clear();
|
||||
blindBoxOpen.setVisibility(View.GONE);
|
||||
Log.e("礼物盲盒", "结束播放");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRepeat() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStep(int i, double v) {
|
||||
Log.e("礼物盲盒", "onStep: frame " + i + " percentage " + v);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//判断送礼用户更新送礼用户进度
|
||||
if (TextUtils.equals(String.valueOf(userID), event.getUid()) && blindBoxType == Integer.parseInt(event.getBoxType())) {
|
||||
switch (blindBoxType) {
|
||||
case 1:
|
||||
boxBlindName = mContext.getString(R.string.mini_blind_box);
|
||||
|
||||
progressBlind.setMax(Integer.parseInt(model.getThresholdValue()));
|
||||
progressBlind.setProgress(Integer.parseInt(model.getDressThresholdValue()));
|
||||
break;
|
||||
case 2:
|
||||
boxBlindName = mContext.getString(R.string.collection_blind_box);
|
||||
|
||||
progressBlind1.setMax(Integer.parseInt(model.getThresholdValue()));
|
||||
progressBlind1.setProgress(Integer.parseInt(model.getDressThresholdValue()));
|
||||
|
||||
break;
|
||||
default:
|
||||
boxBlindName = mContext.getString(R.string.pd_blind_box);
|
||||
progressBlind2.setMax(Integer.parseInt(model.getThresholdValue()));
|
||||
progressBlind2.setProgress(Integer.parseInt(model.getDressThresholdValue()));
|
||||
break;
|
||||
}
|
||||
//进度下方提示语
|
||||
if (TextUtils.equals(model.getThresholdValue(), model.getDressThresholdValue())) {
|
||||
String individualDressing = mContext.getString(R.string.individual_dressing);
|
||||
String msg = mContext.getString(R.string.have_already_win);
|
||||
msg = String.format(msg, model.getThresholdDressName());
|
||||
int dressNameIndexOf = msg.indexOf(model.getThresholdDressName());
|
||||
int individualDressingIndexOf = msg.indexOf(String.valueOf(individualDressing));
|
||||
int dressNameSize = model.getThresholdDressName().length();
|
||||
int individualDressingSize = String.valueOf(individualDressing).length();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(msg);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), individualDressingIndexOf, individualDressingIndexOf + individualDressingSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
blindNumber.setText(builder);
|
||||
textBlindProgress.setText(R.string.get_it_done);
|
||||
} else {
|
||||
int progress = Integer.parseInt(model.getThresholdValue()) - Integer.parseInt(model.getDressThresholdValue());
|
||||
String msg = mContext.getString(R.string.resend_win);
|
||||
msg = String.format(msg, String.valueOf(progress), model.getThresholdDressName());
|
||||
int dressNameIndexOf = msg.indexOf(model.getThresholdDressName());
|
||||
int progressIndexOf = msg.indexOf(String.valueOf(progress));
|
||||
int dressNameSize = model.getThresholdDressName().length();
|
||||
int progressSize = String.valueOf(progress).length();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(msg);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), dressNameIndexOf, dressNameIndexOf + dressNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF682")), progressIndexOf, progressIndexOf + progressSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
blindNumber.setText(builder);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(model.getDressThresholdValue())
|
||||
.append("/")
|
||||
.append(model.getThresholdValue());
|
||||
textBlindProgress.setText(stringBuffer.toString());
|
||||
float maskingAlpha = (float) progress / Float.parseFloat(model.getThresholdValue());
|
||||
iconMasking.setAlpha(maskingAlpha);
|
||||
}
|
||||
if (stringBuilders.size() == 0) {
|
||||
boxBlindHandler.postDelayed(boxBlindRunnable, 1500);
|
||||
}
|
||||
if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) {
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
|
||||
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability2), event.getGiftname(), event.getDressName());
|
||||
stringBuilder.append(boxBlindMsg);
|
||||
int dressNameIndex = boxBlindMsg.indexOf(event.getDressName());
|
||||
int dressNameSize = event.getDressName().length();
|
||||
int giftNameIndex = boxBlindMsg.indexOf(event.getGiftname());
|
||||
int giftNameSize = event.getGiftname().length();
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getDressColour())),
|
||||
dressNameIndex,
|
||||
dressNameIndex + dressNameSize,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getGiftColour())),
|
||||
giftNameIndex,
|
||||
giftNameIndex + giftNameSize,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
stringBuilders.add(stringBuilder);
|
||||
} else {
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
|
||||
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability3), event.getGiftname());
|
||||
stringBuilder.append(boxBlindMsg);
|
||||
int giftNameIndex = boxBlindMsg.indexOf(event.getGiftname());
|
||||
int giftNameSize = event.getGiftname().length();
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getGiftColour())),
|
||||
giftNameIndex,
|
||||
giftNameIndex + giftNameSize,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
stringBuilders.add(stringBuilder);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private List<SpannableStringBuilder> stringBuilders = new ArrayList<>();
|
||||
private Handler boxBlindHandler = new Handler();
|
||||
private Runnable boxBlindRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (stringBuilders != null && stringBuilders.size() > 0) {
|
||||
SpannableStringBuilder stringBuilder = stringBuilders.get(0);
|
||||
textBlindGiftName.setText(stringBuilder);
|
||||
boxBlindHandler.postDelayed(boxBlindRunnable, 1500);
|
||||
stringBuilders.remove(0);
|
||||
} else {
|
||||
textBlindGiftName.setText(String.format(mContext.getString(R.string.random_availability), blindGiftNamesBuffer.toString()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
dismiss();
|
||||
((LiveAudienceActivity) mContext).openGiftWindow();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidGoBack")) {
|
||||
// dismiss();
|
||||
dismiss();
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) {
|
||||
if (mContext instanceof LiveRyAnchorActivity) {
|
||||
return;
|
||||
|
||||
@@ -64,7 +64,13 @@ public class LiveNewRoomClassDialogFragment extends AbsDialogFragment implements
|
||||
if (configBean != null) {
|
||||
List<LiveClassBean> list1 = configBean.getLiveClass();
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
if (!list1.get(i).getName().equals("New") && !list1.get(i).getName().equals("Hot") && !list1.get(i).getName().equals("熱門") && !list1.get(i).getName().equals("新秀")) {
|
||||
if (!list1.get(i).getName().equals("New") &&
|
||||
!list1.get(i).getName().equals("新秀") &&
|
||||
!list1.get(i).getName().equals("熱門") &&
|
||||
!list1.get(i).getName().equals("Hot") &&
|
||||
!list1.get(i).getName().equals("男神") &&
|
||||
!list1.get(i).getName().equals("Mr.Right")
|
||||
) {
|
||||
list.add(list1.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
@@ -41,6 +42,16 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
private WishModel wishListProgress;
|
||||
private XydCompleteModel xydCompleteModel;
|
||||
private LiveReceiveGiftBean liveReceiveGiftBean;
|
||||
private AllServerNotifyEvent allServerNotifyEvent;
|
||||
|
||||
public AllServerNotifyEvent getAllServerNotifyEvent() {
|
||||
return allServerNotifyEvent;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setAllServerNotifyEvent(AllServerNotifyEvent allServerNotifyEvent) {
|
||||
this.allServerNotifyEvent = allServerNotifyEvent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean getLiveReceiveGiftBean() {
|
||||
return liveReceiveGiftBean;
|
||||
@@ -344,7 +355,8 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
LIVE_FONT_SIZE(64, "字号设置"),
|
||||
VOTE_CREATE(65, "创建投票"),
|
||||
VOTE_UPDATE(66, "更新投票"),
|
||||
VOTE_END(67, "投票结束");
|
||||
VOTE_END(67, "投票结束"),
|
||||
BLIND_BOX(68, "盲盒全服通知");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -23,6 +24,7 @@ import android.view.animation.ScaleAnimation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -37,6 +39,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -48,14 +51,14 @@ import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.HtmlTagHandler;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.custom.FrameImageView;
|
||||
import com.yunbao.live.dialog.LiveGiftDialogFragment;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.AllMsgTextRender;
|
||||
@@ -86,7 +89,9 @@ import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
public class LiveGiftAnimPresenter {
|
||||
|
||||
private final View mIvLook;
|
||||
private final TextView mIvLook;
|
||||
private View superNotice;
|
||||
private LinearLayout bgAllServer;
|
||||
private final View mGifGiftTipGroupBuyGuard;
|
||||
private final View mIvLookBuyGuard;
|
||||
private final View mGifGiftTipGroupBuyZuoji;
|
||||
@@ -162,6 +167,8 @@ public class LiveGiftAnimPresenter {
|
||||
private boolean mShowBuyLiangName;
|
||||
private boolean mShowBuyVip;
|
||||
|
||||
private boolean mShowBlindBox;
|
||||
|
||||
|
||||
private CommonCallback<File> mDownloadGifCallback;
|
||||
private CommonCallback<File> mDownloadIconCallback;
|
||||
@@ -216,6 +223,8 @@ public class LiveGiftAnimPresenter {
|
||||
mTitleContainer = v.findViewById(R.id.title_container);
|
||||
mSVGAImageViewFront = v.findViewById(R.id.svga_iv_all_server);
|
||||
mIvLook = v.findViewById(R.id.iv_look);
|
||||
superNotice = v.findViewById(R.id.super_notice);
|
||||
bgAllServer = v.findViewById(R.id.bg_all_server);
|
||||
mIvLookBuyGuard = v.findViewById(R.id.iv_look_buy_guard);
|
||||
|
||||
svgaImageViewCallback();
|
||||
@@ -325,7 +334,25 @@ public class LiveGiftAnimPresenter {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
//切换直播间
|
||||
changeLiveRoom();
|
||||
|
||||
if (TextUtils.equals(mIvLook.getText().toString(),mContext.getString(R.string.participate_in))) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_WISH_GIFTID, blindBox.getEvent().getBlindBoxId() + "");
|
||||
bundle.putBoolean("isContactGift", true);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
changeLiveRoom();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mGifGiftTipGroupAllServer.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -336,6 +363,14 @@ public class LiveGiftAnimPresenter {
|
||||
});
|
||||
}
|
||||
|
||||
public String mLiveUid;
|
||||
public String mStream;
|
||||
|
||||
public void setLiveUidStream(String liveUid, String stream) {
|
||||
mLiveUid = liveUid;
|
||||
mStream = stream;
|
||||
}
|
||||
|
||||
private void mIvLookBuyZuojiClick() {
|
||||
mGifGiftTipGroupBuyZuoji.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -410,7 +445,7 @@ public class LiveGiftAnimPresenter {
|
||||
private void setGitTipAnimatorAllServer() {
|
||||
mDp500 = DpUtil.dp2px(500);
|
||||
mGifGiftTipShowAnimatorAllServer = ObjectAnimator.ofFloat(mGifGiftTipGroupAllServer, "translationX", mDp500, 0);
|
||||
mGifGiftTipShowAnimatorAllServer.setDuration(2000);
|
||||
mGifGiftTipShowAnimatorAllServer.setDuration(2500);
|
||||
mGifGiftTipShowAnimatorAllServer.setInterpolator(new LinearInterpolator());
|
||||
mGifGiftTipShowAnimatorAllServer.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
@@ -422,7 +457,7 @@ public class LiveGiftAnimPresenter {
|
||||
});
|
||||
mDp10 = DpUtil.dp2px(10);
|
||||
mGifGiftTipHideAnimatorAllServer = ObjectAnimator.ofFloat(mGifGiftTipGroupAllServer, "translationX", 0);
|
||||
mGifGiftTipHideAnimatorAllServer.setDuration(3000);
|
||||
mGifGiftTipHideAnimatorAllServer.setDuration(3500);
|
||||
mGifGiftTipHideAnimatorAllServer.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
mGifGiftTipHideAnimatorAllServer.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
@@ -673,10 +708,16 @@ public class LiveGiftAnimPresenter {
|
||||
mGifGiftTipHideAnimatorAllServer.start();
|
||||
} else if (msg.what == WHAT_ALL_SERVER_2) {
|
||||
mShowAllServer = false;
|
||||
mShowBlindBox = false;
|
||||
heightOffsetArr[index4OtherGift] = 0;
|
||||
LiveReceiveGiftBean bean = mGifAll.poll();
|
||||
if (bean != null) {
|
||||
chooseInto(bean);
|
||||
if (bean.isBlindBox()) {
|
||||
showSendGiftAnimAllServer2(bean);
|
||||
} else {
|
||||
chooseInto(bean);
|
||||
}
|
||||
|
||||
}
|
||||
} else if (msg.what == WHAT_BUY_GUARD_1) {
|
||||
mGifGiftTipHideAnimatorBuyGuard.setFloatValues(0, -mDp10 - mGifGiftTipGroupBuyGuard.getWidth());
|
||||
@@ -832,8 +873,6 @@ public class LiveGiftAnimPresenter {
|
||||
}
|
||||
} else {
|
||||
mShowAllServer = true;
|
||||
|
||||
|
||||
index4OtherGift = getFirstIndexOfValue(heightOffsetArr, 0);
|
||||
if (index4OtherGift >= 0) {
|
||||
heightOffsetArr[index4OtherGift] = 1;
|
||||
@@ -843,16 +882,57 @@ public class LiveGiftAnimPresenter {
|
||||
params.topMargin = DpUtil.dp2px(y);
|
||||
mGifGiftTipGroupAllServer.setLayoutParams(params);
|
||||
}
|
||||
|
||||
mAncherName = mTempGifGiftBean.getAncherName();
|
||||
mGifGiftTipAllServer.setSelected(false);
|
||||
|
||||
mIvLook.setVisibility(View.VISIBLE);
|
||||
mGifGiftTipGroupAllServer.setAlpha(1f);
|
||||
mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE);
|
||||
textRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, "");
|
||||
mIvLook.setVisibility(View.VISIBLE);
|
||||
mGifGiftTipShowAnimatorAllServer.start();
|
||||
|
||||
textRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, "");
|
||||
}
|
||||
} //送礼物 全服通知
|
||||
|
||||
private LiveReceiveGiftBean blindBox = null;
|
||||
|
||||
public void showSendGiftAnimAllServer2(LiveReceiveGiftBean bean) {
|
||||
blindBox = bean;
|
||||
if (mShowBlindBox) {
|
||||
if (mGifAll != null) {
|
||||
mGifAll.offer(bean);
|
||||
}
|
||||
} else {
|
||||
mShowBlindBox = true;
|
||||
mAncherName = bean.getAncherName();
|
||||
mGifGiftTipAllServer.setSelected(false);
|
||||
mGifGiftTipGroupAllServer.setAlpha(1f);
|
||||
mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE);
|
||||
|
||||
AllServerNotifyEvent serverNotifyEvent = bean.getEvent();
|
||||
switch (Integer.parseInt(serverNotifyEvent.getBoxType())) {
|
||||
case 1:
|
||||
bgAllServer.setBackgroundResource(R.mipmap.bg_kirin_notify);
|
||||
mIvLook.setBackgroundResource(R.drawable.bg_all_server_336cf7);
|
||||
break;
|
||||
case 2:
|
||||
bgAllServer.setBackgroundResource(R.mipmap.bg_phoenix_notify);
|
||||
mIvLook.setBackgroundResource(R.drawable.bg_all_server_fd5a9d);
|
||||
break;
|
||||
default:
|
||||
bgAllServer.setBackgroundResource(R.mipmap.bg_dragon_notify);
|
||||
mIvLook.setBackgroundResource(R.drawable.bg_all_server_fcb50e);
|
||||
break;
|
||||
}
|
||||
mIvLook.setText(R.string.participate_in);
|
||||
superNotice.setBackgroundResource(R.mipmap.icon_blind_box_headlines);
|
||||
mIvLook.setVisibility(View.VISIBLE);
|
||||
textRender.blindBoxText(mContext, mGifGiftTipAllServer, serverNotifyEvent);
|
||||
mGifGiftTipShowAnimatorAllServer.start();
|
||||
mGifGiftTipAllServer.postDelayed(() -> {
|
||||
if (mGifGiftTipAllServer != null) {
|
||||
mGifGiftTipAllServer.setSelected(true);
|
||||
}
|
||||
}, delayMarqueen + 600);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -934,7 +1014,7 @@ public class LiveGiftAnimPresenter {
|
||||
}
|
||||
|
||||
String text = mTempGifGiftBean.getUserNiceName() + " <myfont size='24px'>"
|
||||
+mContext.getString(R.string.live_send_buy_zuoji_1)
|
||||
+ mContext.getString(R.string.live_send_buy_zuoji_1)
|
||||
+ "</myfont> " + (mTempGifGiftBean.getCarName());
|
||||
Spanned spanned = Html.fromHtml(text, null, new HtmlTagHandler("myfont"));
|
||||
mGifGiftTipBuyZuoji.setText(spanned);
|
||||
@@ -975,7 +1055,7 @@ public class LiveGiftAnimPresenter {
|
||||
}
|
||||
|
||||
String text = mTempGifGiftBean.getUserNiceName() + " <myfont size='24px'>"
|
||||
+mContext.getString(R.string.live_send_buy_liang_name_1)
|
||||
+ mContext.getString(R.string.live_send_buy_liang_name_1)
|
||||
+ "</myfont> " + mTempGifGiftBean.getLiangName();
|
||||
Spanned spanned = Html.fromHtml(text, null, new HtmlTagHandler("myfont"));
|
||||
mGifGiftTipBuyLiangName.setText(spanned);
|
||||
@@ -1124,7 +1204,7 @@ public class LiveGiftAnimPresenter {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
GiftCacheUtil.getFile(mContext,Constants.GIF_GIFT_PREFIX + bean.getGiftId(), url, "1", mDownloadGifCallback);
|
||||
GiftCacheUtil.getFile(mContext, Constants.GIF_GIFT_PREFIX + bean.getGiftId(), url, "1", mDownloadGifCallback);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,13 +206,14 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
Log.d("RYM_DG", "Other onLeaveRoom: room = " + room.getRoomId());
|
||||
}
|
||||
};
|
||||
|
||||
public LiveRyLinkMicPkPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, View root) {
|
||||
mContext = context;
|
||||
mIsAnchor = isAnchor;
|
||||
mRoot = root;
|
||||
mPkContainer = linkMicViewHolder.getPkContainer();
|
||||
mPkTimeString1 = "";
|
||||
mPkTimeString2 =mContext.getString(R.string.live_pk_time_2);
|
||||
mPkTimeString2 = mContext.getString(R.string.live_pk_time_2);
|
||||
//从本地取数据
|
||||
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
|
||||
if (!pkTime.isEmpty()) {
|
||||
@@ -253,7 +254,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
mPkContainer = linkMicViewHolder.getPkContainer();
|
||||
livePushRyViewHolder = linkMicViewHolder;
|
||||
mPkTimeString1 = "";
|
||||
mPkTimeString2 =mContext.getString(R.string.live_pk_time_2);
|
||||
mPkTimeString2 = mContext.getString(R.string.live_pk_time_2);
|
||||
//从本地取数据
|
||||
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
|
||||
if (!pkTime.isEmpty()) {
|
||||
@@ -2184,6 +2185,18 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
nextPkTimeCountDown(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改最终PK数据
|
||||
* @param leftGift 左边数据
|
||||
* @param rightGift 右边数据
|
||||
* @param bean 排位数据
|
||||
*/
|
||||
public void onPkProgressEnd(long leftGift, long rightGift,LivePKUserListBean bean) {
|
||||
if (mLiveLinkMicPkViewHolder != null) {
|
||||
mLiveLinkMicPkViewHolder.onProgressChanged(leftGift, rightGift, bean, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 进房间的时候懲罰开始
|
||||
@@ -2312,7 +2325,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
|
||||
// //恢复播放画面
|
||||
if (i == 1) {
|
||||
if(btn_close!=null){
|
||||
if (btn_close != null) {
|
||||
btn_close.setVisibility(View.GONE);
|
||||
}
|
||||
if (rtcRoom != null) {
|
||||
|
||||
@@ -334,7 +334,7 @@ public class SocketClient {
|
||||
receiveGiftBean.setUid(uid);
|
||||
receiveGiftBean.setGuardType(map.getString("guard_type"));
|
||||
receiveGiftBean.setSendtype(map.getIntValue("action"));
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
}
|
||||
} else {
|
||||
LiveReceiveGiftBean receiveGiftBean = new LiveReceiveGiftBean();
|
||||
@@ -346,7 +346,7 @@ public class SocketClient {
|
||||
receiveGiftBean.setUid(map.getString("uid"));
|
||||
receiveGiftBean.setGuardType(map.getString("guard_type"));
|
||||
receiveGiftBean.setSendtype(map.getIntValue("action"));
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,13 +557,13 @@ public class SocketClient {
|
||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(receiveGiftBean.getPkTopUsers(), LivePKUserListBean.class);
|
||||
if (mLiveUid.equals(map.getString("roomnum"))) {
|
||||
if (!mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
}
|
||||
//同一个直播间时才刷新pk
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal1"), map.getLongValue("pktotal2"), livePKUserListBean);
|
||||
} else {
|
||||
if (!mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
}
|
||||
//同一个直播间时才刷新pk
|
||||
if (mLiveUid.equals(map.getString("pkuid1")) ||
|
||||
@@ -574,7 +574,7 @@ public class SocketClient {
|
||||
}
|
||||
} else {
|
||||
if (!mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,7 @@ public class SocketClient {
|
||||
try {
|
||||
if (!TextUtils.isEmpty(mLiveUid)) {
|
||||
if (mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal1"), map.getLongValue("pktotal2"), livePKUserListBean);
|
||||
} else {
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal2"), map.getLongValue("pktotal1"), livePKUserListBean);
|
||||
@@ -640,7 +640,7 @@ public class SocketClient {
|
||||
|
||||
} else {
|
||||
Log.i("tvvs", receiveGiftBean.getLiveChatBean().getContent());
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean,null);
|
||||
}
|
||||
if (map.getIntValue("drpk_status") == 1) {
|
||||
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, 0);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.yunbao.live.socket;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.live.bean.LiveBuyGuardMsgBean;
|
||||
import com.yunbao.live.bean.LiveChatBean;
|
||||
import com.yunbao.live.bean.LiveDanMuBean;
|
||||
@@ -57,7 +58,7 @@ public interface SocketMessageListener {
|
||||
*
|
||||
* @param bean 礼物信息
|
||||
*/
|
||||
void onSendGift(LiveReceiveGiftBean bean);
|
||||
void onSendGift(LiveReceiveGiftBean bean, SendBlindGiftEvent event);
|
||||
|
||||
void onBuyZuoji(LiveReceiveGiftBean bean);
|
||||
|
||||
@@ -290,6 +291,16 @@ public interface SocketMessageListener {
|
||||
*/
|
||||
void onPrizePoolUp(String level);
|
||||
|
||||
/**
|
||||
* 最终PK数据
|
||||
* @param leftUid 左边uid
|
||||
* @param rightUid 右边uid
|
||||
* @param left 左边分数
|
||||
* @param right 右边分数
|
||||
* @param bean 排位顺序
|
||||
*/
|
||||
void onEndPk(long leftUid,long rightUid,long left,long right,LivePKUserListBean bean);
|
||||
|
||||
/***********************以下是游戏*********************************/
|
||||
/**
|
||||
* 游戏 智勇三张 游戏的回调
|
||||
|
||||
@@ -7,8 +7,10 @@ import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -32,12 +34,15 @@ import com.yunbao.common.bean.SocketModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMRTCManager;
|
||||
import com.yunbao.common.manager.RandomPkManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
@@ -64,6 +69,8 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||
@@ -362,6 +369,24 @@ public class SocketRyClient {
|
||||
buyZuoJiByNotify(map);
|
||||
} else if (action2 == 66) {//购买贵族
|
||||
buyVipByNotify(map);
|
||||
} else if (action2 == 88) {
|
||||
|
||||
AllServerNotifyEvent allServerNotifyEvent
|
||||
= new AllServerNotifyEvent()
|
||||
.setBlindBoxId(map.getString("blind_box_id"))
|
||||
.setBoxType(map.getString("box_type"))
|
||||
.setBoxTypeName(map.getString("box_type_name"))
|
||||
.setDressName(map.getString("dress_name"))
|
||||
.setGiftNotification(map.getString("gift_notification"))
|
||||
.setGiftName(map.getString("giftname"))
|
||||
.setUserNiceName(map.getString("uname"))
|
||||
.setGiftIcon(map.getString("gifticon"))
|
||||
.setAnchorName(map.getString("ancherName"))
|
||||
.setDisplaySrc(map.getString("display_src"));
|
||||
Log.e("AllServerNotifyEvent", allServerNotifyEvent.toString());
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.BLIND_BOX)
|
||||
.setAllServerNotifyEvent(allServerNotifyEvent));
|
||||
}
|
||||
break;
|
||||
case Constants.SOCKET_SEND_BARRAGE://发弹幕
|
||||
@@ -650,6 +675,14 @@ public class SocketRyClient {
|
||||
.setObject(map)
|
||||
);
|
||||
break;
|
||||
case Constants.LIVE_PK_END:
|
||||
mListener.onEndPk(map.getLong("uid"),
|
||||
map.getLong("pkuid"),
|
||||
map.getLong("uid_score"),
|
||||
map.getLong("pkuid_score"),
|
||||
JSONObject.parseObject(map.getJSONObject("ct").getJSONObject("pk_top_users").toJSONString(), LivePKUserListBean.class)
|
||||
);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -680,7 +713,7 @@ public class SocketRyClient {
|
||||
receiveGiftBean.setUid(uid);
|
||||
receiveGiftBean.setGuardType(map.getString("guard_type"));
|
||||
receiveGiftBean.setSendtype(map.getIntValue("action"));
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
} else {
|
||||
LiveReceiveGiftBean receiveGiftBean = new LiveReceiveGiftBean();
|
||||
@@ -692,7 +725,7 @@ public class SocketRyClient {
|
||||
receiveGiftBean.setUid(map.getString("uid"));
|
||||
receiveGiftBean.setGuardType(map.getString("guard_type"));
|
||||
receiveGiftBean.setSendtype(map.getIntValue("action"));
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,13 +940,13 @@ public class SocketRyClient {
|
||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(receiveGiftBean.getPkTopUsers(), LivePKUserListBean.class);
|
||||
if (mLiveUid.equals(map.getString("roomnum"))) {
|
||||
if (!mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
//同一个直播间时才刷新pk
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal1"), map.getLongValue("pktotal2"), livePKUserListBean);
|
||||
} else {
|
||||
if (!mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
//同一个直播间时才刷新pk
|
||||
if (mLiveUid.equals(map.getString("pkuid1")) ||
|
||||
@@ -924,7 +957,7 @@ public class SocketRyClient {
|
||||
}
|
||||
} else {
|
||||
if (!mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -963,12 +996,15 @@ public class SocketRyClient {
|
||||
chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen());
|
||||
|
||||
}
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
|
||||
// 玩家自己送礼物
|
||||
private void sendGiftInSameRoom(JSONObject map) {
|
||||
String ctJson = map.getString("ct");
|
||||
SendBlindGiftEvent sendBlindGiftEvent = GsonUtils.fromJson(ctJson, SendBlindGiftEvent.class);
|
||||
LiveReceiveGiftBean receiveGiftBean = JSON.parseObject(map.getString("ct"), LiveReceiveGiftBean.class);
|
||||
sendBlindGiftEvent.setUserNiceName(map.getString("uname"));
|
||||
receiveGiftBean.setAvatar(map.getString("uhead") + "");
|
||||
receiveGiftBean.setUserNiceName(map.getString("uname"));
|
||||
receiveGiftBean.setRoomnum(map.getString("roomnum"));
|
||||
@@ -997,11 +1033,11 @@ public class SocketRyClient {
|
||||
if (map.get("guard_type") != null && !"".equals(map.get("guard_type")) && !"null".equals(map.get("guard_type"))) {
|
||||
chatBean.setGuardType(map.getInteger("guard_type"));
|
||||
}
|
||||
|
||||
if (CommonAppContext.lang.equals("chinese")) {
|
||||
chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + receiveGiftBean.getGiftCount() + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftName());
|
||||
} else {
|
||||
chatBean.setContent(mContext.getString(R.string.live_send_gift_1) + " " + +receiveGiftBean.getGiftCount() + " " + mContext.getString(R.string.live_send_gift_2) + receiveGiftBean.getGiftnameen());
|
||||
|
||||
}
|
||||
//增加粉丝徽章信息
|
||||
chatBean.setMedalNmae(map.getString("medal_name"));
|
||||
@@ -1010,12 +1046,12 @@ public class SocketRyClient {
|
||||
chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
|
||||
receiveGiftBean.setLiveChatBean(chatBean);
|
||||
Log.e("tag", "ifpk" + map.getIntValue("ifpk") + "");
|
||||
|
||||
if (map.getIntValue("ifpk") == 1) {
|
||||
try {
|
||||
if (!TextUtils.isEmpty(mLiveUid)) {
|
||||
if (mLiveUid.equals(map.getString("roomnum"))) {
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal1"), map.getLongValue("pktotal2"), livePKUserListBean);
|
||||
} else {
|
||||
mListener.onSendGiftPk(map.getLongValue("pktotal2"), map.getLongValue("pktotal1"), livePKUserListBean);
|
||||
@@ -1027,7 +1063,12 @@ public class SocketRyClient {
|
||||
|
||||
} else {
|
||||
Log.i("tvvs", receiveGiftBean.getLiveChatBean().getContent());
|
||||
mListener.onSendGift(receiveGiftBean);
|
||||
if (!TextUtils.isEmpty(sendBlindGiftEvent.getAction()) && TextUtils.equals("blind_box", sendBlindGiftEvent.getAction())) {
|
||||
mListener.onSendGift(receiveGiftBean, sendBlindGiftEvent);
|
||||
} else {
|
||||
mListener.onSendGift(receiveGiftBean, null);
|
||||
}
|
||||
|
||||
}
|
||||
if (map.getIntValue("drpk_status") == 1) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.yunbao.live.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.custom.VerticalImageSpan;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.live.R;
|
||||
@@ -68,7 +72,7 @@ public class AllMsgTextRender {
|
||||
ImgLoader.displayDrawable(context, url, new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
if (builder!=null&&!builder.toString().contains(text)){
|
||||
if (builder != null && !builder.toString().contains(text)) {
|
||||
builder = createPrefix(drawable, builder);
|
||||
builder = renderMsg(color2, builder, text);
|
||||
textView.setText(builder);
|
||||
@@ -124,6 +128,95 @@ public class AllMsgTextRender {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 盲盒字体组装
|
||||
*
|
||||
* @param context
|
||||
* @param textView
|
||||
* @param serverNotifyEvent
|
||||
*/
|
||||
public void blindBoxText(Context context, TextView textView, AllServerNotifyEvent serverNotifyEvent) {
|
||||
String space = " ";
|
||||
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
|
||||
String extractTo = context.getString(R.string.extract_to);
|
||||
extractTo = String.format(extractTo, serverNotifyEvent.getUserNiceName(), serverNotifyEvent.getBoxTypeName());
|
||||
spannableStringBuilder.append(extractTo);
|
||||
int indexImage = spannableStringBuilder.length();
|
||||
int endImage = indexImage + space.length();
|
||||
spannableStringBuilder.append(space);
|
||||
String giftName;
|
||||
int giftNameIndex;
|
||||
int endName;
|
||||
if (!TextUtils.isEmpty(serverNotifyEvent.getGiftNotification())
|
||||
&& TextUtils.equals(serverNotifyEvent.getGiftNotification(), "1")) {
|
||||
giftName = context.getString(R.string.extract_to2);
|
||||
giftName = String.format(giftName, serverNotifyEvent.getGiftName(), serverNotifyEvent.getAnchorName());
|
||||
spannableStringBuilder.append(giftName);
|
||||
giftNameIndex = spannableStringBuilder.toString().indexOf(serverNotifyEvent.getGiftName());
|
||||
endName = giftNameIndex + serverNotifyEvent.getGiftName().length();
|
||||
ImgLoader.displayDrawable(context, serverNotifyEvent.getGiftIcon(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(21), DpUtil.dp2px(21));
|
||||
//用这个drawable对象代替字符串easy
|
||||
ImageSpan span = new ImageSpan(drawable, ImageSpan.ALIGN_BASELINE);
|
||||
spannableStringBuilder.setSpan(span, indexImage, endImage, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
||||
blind(spannableStringBuilder,textView,serverNotifyEvent,giftNameIndex,endName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
blind(spannableStringBuilder,textView,serverNotifyEvent,giftNameIndex,endName);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
giftName = serverNotifyEvent.getDressName();
|
||||
spannableStringBuilder.append(giftName);
|
||||
giftNameIndex = spannableStringBuilder.toString().indexOf(giftName);
|
||||
endName = giftNameIndex + giftName.length();
|
||||
ImgLoader.displayDrawable(context, serverNotifyEvent.getDisplaySrc(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(21), DpUtil.dp2px(21));
|
||||
//用这个drawable对象代替字符串easy
|
||||
ImageSpan span = new ImageSpan(drawable, ImageSpan.ALIGN_BASELINE);
|
||||
spannableStringBuilder.setSpan(span, indexImage, endImage, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
||||
blind(spannableStringBuilder,textView,serverNotifyEvent,giftNameIndex,endName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
blind(spannableStringBuilder,textView,serverNotifyEvent,giftNameIndex,endName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void blind( SpannableStringBuilder spannableStringBuilder, TextView textView, AllServerNotifyEvent serverNotifyEvent, int giftNameIndex,int endName) {
|
||||
switch (Integer.parseInt(serverNotifyEvent.getBoxType())) {
|
||||
case 1:
|
||||
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#336DF7")),
|
||||
giftNameIndex,
|
||||
endName,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
break;
|
||||
case 2:
|
||||
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FD5A9D")),
|
||||
giftNameIndex,
|
||||
endName,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
break;
|
||||
default:
|
||||
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FCB514")),
|
||||
giftNameIndex,
|
||||
endName,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
break;
|
||||
}
|
||||
textView.setText(spannableStringBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染消息
|
||||
*/
|
||||
|
||||
@@ -64,9 +64,8 @@ public class LiveAnchorVoteManager {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
LiveRoomVoteModel voteModel = new LiveRoomVoteModel();
|
||||
voteModel.setContent(error);
|
||||
voteModel.setContent(CommonAppContext.getTopActivity().getString(com.yunbao.common.R.string.live_vote_create_error));
|
||||
listener.onItemClick(voteModel, -1);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -339,6 +339,9 @@ public class LiveExoPlayerManager {
|
||||
if (getNowPlayer() != null) {
|
||||
getNowPlayer().stop();
|
||||
}
|
||||
if (getNextPlayer() != null && getNextPlayer().isPlaying()) {
|
||||
getNextPlayer().stop();
|
||||
}
|
||||
clearUrl();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ public class LiveRoomVoteManager {
|
||||
mCancel.setText(R.string.live_vote_close_no);
|
||||
mCancel.setOnClickListener(v -> {
|
||||
mTitle.setText(createVoteModel.getContent());
|
||||
mSubmit.setText(createVoteModel.getAnswer1());
|
||||
mCancel.setText(createVoteModel.getAnswer2());
|
||||
mSubmit.setText(getAnswerText(createVoteModel.getAnswer1()));
|
||||
mCancel.setText(getAnswerText(createVoteModel.getAnswer2()));
|
||||
initClick();
|
||||
});
|
||||
mSubmit.setOnClickListener(v -> endAnchorVote());
|
||||
@@ -92,6 +92,12 @@ public class LiveRoomVoteManager {
|
||||
mSubmit.setOnClickListener(v -> updateVote(true));
|
||||
mCancel.setOnClickListener(v -> updateVote(false));
|
||||
}
|
||||
private String getAnswerText(String answer){
|
||||
if(answer.length()>4){
|
||||
return answer.substring(0,4)+"\n"+answer.substring(4);
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
private void updateVote(boolean isSubmit) {
|
||||
LiveNetManager.get(mContext)
|
||||
@@ -136,8 +142,8 @@ public class LiveRoomVoteManager {
|
||||
mCancel.setOnClickListener(null);
|
||||
mSubmit.setOnClickListener(null);
|
||||
|
||||
mSubmit.setText(createVoteModel.getAnswer1());
|
||||
mCancel.setText(createVoteModel.getAnswer2());
|
||||
mSubmit.setText(getAnswerText(createVoteModel.getAnswer1()));
|
||||
mCancel.setText(getAnswerText(createVoteModel.getAnswer2()));
|
||||
|
||||
new Timer().schedule(new TimerTask() {
|
||||
int time = 6;
|
||||
@@ -169,8 +175,8 @@ public class LiveRoomVoteManager {
|
||||
expansion();
|
||||
}
|
||||
mTitle.setText(createVoteModel.getContent());
|
||||
mSubmit.setText(createVoteModel.getAnswer1());
|
||||
mCancel.setText(createVoteModel.getAnswer2());
|
||||
mSubmit.setText(getAnswerText(createVoteModel.getAnswer1()));
|
||||
mCancel.setText(getAnswerText(createVoteModel.getAnswer2()));
|
||||
mCancel.setOnClickListener(null);
|
||||
mSubmit.setOnClickListener(null);
|
||||
if (mSubmit.getTag() == null || !mSubmit.getTag().equals(createVoteModel.getLiveUid())) {
|
||||
|
||||
@@ -86,6 +86,19 @@ public class LiveTextRender {
|
||||
sFontSizeSpan3 = new AbsoluteSizeSpan(14, true);
|
||||
}
|
||||
|
||||
public void blindBox(Context context, TextView textView, LiveChatBean bean) {
|
||||
String chatMsg = bean.getContent();
|
||||
int userNiceNameIndex = chatMsg.indexOf(bean.getUserNiceName());
|
||||
int userNiceNameSize = bean.getUserNiceName().length();
|
||||
int giftNameIndex = chatMsg.indexOf(bean.getGiftName());
|
||||
int giftNameSize = bean.getGiftName().length();
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(chatMsg);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#78FEFF")), userNiceNameIndex, userNiceNameIndex + userNiceNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF86C")), giftNameIndex, giftNameIndex + giftNameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
textView.setText(builder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间推荐卡
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.PathMeasure;
|
||||
import android.graphics.RectF;
|
||||
@@ -84,8 +85,8 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
|
||||
public void init() {
|
||||
|
||||
mHalfScreenWidth = ScreenDimenUtil.getInstance().getScreenWdith() / 2;
|
||||
mLeftString =mContext.getString(R.string.live_link_mic_pk_1);
|
||||
mRightString =mContext.getString(R.string.live_link_mic_pk_2);
|
||||
mLeftString = mContext.getString(R.string.live_link_mic_pk_1);
|
||||
mRightString = mContext.getString(R.string.live_link_mic_pk_2);
|
||||
mFrameImageView = (FrameImageView) findViewById(R.id.frame_img);
|
||||
mFrameImageView.setImageList(LiveIconUtil.getLinkMicPkAnim());//PK开始动画
|
||||
frame_img_pk = (ImageView) findViewById(R.id.frame_img_pk);
|
||||
@@ -155,7 +156,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
Log.i("女神说", "倒计时状态:"+s);
|
||||
Log.i("女神说", "倒计时状态:" + s);
|
||||
if (mTime.getVisibility() == View.VISIBLE) {
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING));
|
||||
@@ -198,6 +199,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
|
||||
animationDrawable = (AnimationDrawable) frame_img_pk.getBackground();
|
||||
animationDrawable.start();
|
||||
}
|
||||
mLeft.setTag(null);
|
||||
}
|
||||
|
||||
public void showTime() {
|
||||
@@ -233,6 +235,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
|
||||
}
|
||||
if (mLeft != null) {
|
||||
mLeft.setTranslationX(0);
|
||||
mLeft.setTag(null);
|
||||
mLeft2.setTranslationX(0);
|
||||
}
|
||||
if (mRight != null) {
|
||||
@@ -241,7 +244,27 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改PK进度条进度
|
||||
* @param leftGift 左边进度
|
||||
* @param rightGift 右边进度
|
||||
* @param bean 排位信息
|
||||
*/
|
||||
public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean) {
|
||||
onProgressChanged(leftGift, rightGift, bean, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改PK进度条进度
|
||||
* @param leftGift 左边进度
|
||||
* @param rightGift 右边进度
|
||||
* @param bean 排位信息
|
||||
* @param isEnd 是否为最终数据,是的话就不再接收后续修改数据,默认false
|
||||
*/
|
||||
public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean, boolean isEnd) {
|
||||
if (mLeft.getTag() != null && ((boolean) mLeft.getTag())) {
|
||||
return;
|
||||
}
|
||||
mLeft.setText(mLeftString + " " + leftGift);
|
||||
mRight.setText(rightGift + " " + mRightString);
|
||||
if (leftGift == rightGift) {
|
||||
@@ -262,8 +285,10 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
|
||||
animationDrawable = (AnimationDrawable) frame_img_pk.getBackground();
|
||||
animationDrawable.start();
|
||||
}
|
||||
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean));
|
||||
mLeft.setTag(isEnd);
|
||||
if (bean != null) {
|
||||
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean));
|
||||
}
|
||||
}
|
||||
|
||||
private void changeLine(float nowIndex, long leftGift, long rightGift) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
@@ -71,11 +72,11 @@ import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
@@ -88,6 +89,7 @@ import com.yunbao.common.bean.TaskModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.AnchorInfoEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -1097,7 +1099,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
|
||||
mChatRecyclerView.getLayoutParams();
|
||||
params1.topMargin = 180;
|
||||
params1.topMargin = DpUtil.dp2px(65);
|
||||
mChatRecyclerView.setLayoutParams(params1);
|
||||
|
||||
mChatRecyclerView.setHasFixedSize(true);
|
||||
@@ -4394,6 +4396,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
// mLiveChatAdapter.insertItem(bean);
|
||||
if (mTopBannerList.size() == 0) {
|
||||
topBanner1.setVisibility(View.GONE);
|
||||
topBanner2.setVisibility(View.GONE);
|
||||
} else {
|
||||
topBanner1.update(mTopBannerList);
|
||||
topBanner2.update(mTopBannerList);
|
||||
@@ -4895,7 +4898,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
||||
@Override
|
||||
public void onBannerClick(List datas, int position) {
|
||||
if (datas.size() > 0) {
|
||||
if (datas.size() > 0 && mTopBannerList != null && mTopBannerList.size() > 0) {
|
||||
if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) {
|
||||
Dialog loading = DialogUitl.loadingDialog(mContext);
|
||||
loading.show();
|
||||
@@ -5092,4 +5095,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void blindBoxAllServerNotify(AllServerNotifyEvent event) {
|
||||
LiveReceiveGiftBean receiveGiftBean = new LiveReceiveGiftBean();
|
||||
receiveGiftBean.setBlindBox(true);
|
||||
receiveGiftBean.setEvent(event);
|
||||
if (mLiveGiftAnimPresenter == null) {
|
||||
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
|
||||
}
|
||||
mLiveGiftAnimPresenter.showSendGiftAnimAllServer2(receiveGiftBean);
|
||||
mLiveGiftAnimPresenter.setLiveUidStream(mLiveUid, mStream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive;
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
@@ -9,6 +10,7 @@ import android.content.res.Configuration;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -43,8 +45,10 @@ import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.custom.MyViewPager;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.event.LiveFloatEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -95,6 +99,8 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||
@@ -269,105 +275,105 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
try {
|
||||
|
||||
Log.e("ImgLoader1", data.getAvatar());
|
||||
if (mLiveRyLinkMicPkPresenter != null) {
|
||||
mLiveRyLinkMicPkPresenter.clearData();
|
||||
mLiveRyLinkMicPkPresenter.release();
|
||||
mLiveRyLinkMicPkPresenter = null;
|
||||
}
|
||||
Log.e("ImgLoader1", data.getAvatar());
|
||||
if (mLiveRyLinkMicPkPresenter != null) {
|
||||
mLiveRyLinkMicPkPresenter.clearData();
|
||||
mLiveRyLinkMicPkPresenter.release();
|
||||
mLiveRyLinkMicPkPresenter = null;
|
||||
}
|
||||
|
||||
mLiveBean = data;
|
||||
mLiveSDK = liveSdk;
|
||||
mLiveType = liveType;
|
||||
mLiveTypeVal = liveTypeVal;
|
||||
liveID = data.getUid();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||
.setParametersModel(openParametersModel
|
||||
.setmLiveType(mLiveType)
|
||||
.setmLiveTypeVal(mLiveTypeVal)));
|
||||
loading.setVisibility(View.VISIBLE);
|
||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg);
|
||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||
frameAnimation.start();
|
||||
liveHandler.removeCallbacks(loadRunnableGone);
|
||||
if (mLivePlayViewHolder == null) {
|
||||
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1);
|
||||
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
|
||||
mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer);
|
||||
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView());
|
||||
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
|
||||
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
||||
mLivePlayViewHolder.addToParent();
|
||||
mLivePlayViewHolder.subscribeActivityLifeCycle();
|
||||
mLivePlayViewHolder.setLoadViewListener(new LiveRoomPlayViewHolder.LoadingListener() {
|
||||
mLiveBean = data;
|
||||
mLiveSDK = liveSdk;
|
||||
mLiveType = liveType;
|
||||
mLiveTypeVal = liveTypeVal;
|
||||
liveID = data.getUid();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||
.setParametersModel(openParametersModel
|
||||
.setmLiveType(mLiveType)
|
||||
.setmLiveTypeVal(mLiveTypeVal)));
|
||||
loading.setVisibility(View.VISIBLE);
|
||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg);
|
||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||
frameAnimation.start();
|
||||
liveHandler.removeCallbacks(loadRunnableGone);
|
||||
if (mLivePlayViewHolder == null) {
|
||||
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1);
|
||||
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
|
||||
mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer);
|
||||
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView());
|
||||
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
|
||||
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
||||
mLivePlayViewHolder.addToParent();
|
||||
mLivePlayViewHolder.subscribeActivityLifeCycle();
|
||||
mLivePlayViewHolder.setLoadViewListener(new LiveRoomPlayViewHolder.LoadingListener() {
|
||||
@Override
|
||||
public void onPlayer() {
|
||||
liveHandler.postDelayed(loadRunnableGone, 350);
|
||||
}
|
||||
});
|
||||
mLiveRoomViewHolder.subscribeActivityLifeCycle();
|
||||
mLiveAudienceViewHolder.addToParent();
|
||||
mLiveRoomViewHolder.addToParent();
|
||||
mLiveAudienceViewHolder.subscribeActivityLifeCycle();
|
||||
} else {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(1);
|
||||
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK);
|
||||
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK);
|
||||
}
|
||||
|
||||
if (mLiveRyLinkMicPkPresenter == null) {
|
||||
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
||||
}
|
||||
//去除主播离开画面
|
||||
if (LivePlayKsyViewHolder.leave != null) {
|
||||
LivePlayKsyViewHolder.leave.setVisibility(View.GONE);
|
||||
}
|
||||
if (LivePlayRyViewHolder.leave != null) {
|
||||
LivePlayRyViewHolder.leave.setVisibility(View.GONE);
|
||||
}
|
||||
//直播间背景
|
||||
|
||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
|
||||
|
||||
mask.setVisibility(View.VISIBLE);
|
||||
mLivePlayViewHolder.clearFrame();
|
||||
mLivePlayViewHolder.setLiveBean(mLiveBean);
|
||||
mLivePlayViewHolder.removeDetailView();
|
||||
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
|
||||
mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape());
|
||||
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
|
||||
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
|
||||
@Override
|
||||
public void onPlayer() {
|
||||
liveHandler.postDelayed(loadRunnableGone, 350);
|
||||
public void onMikUpdate() {
|
||||
if (mContext instanceof LiveActivity) {
|
||||
((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder);
|
||||
}
|
||||
}
|
||||
});
|
||||
mLiveRoomViewHolder.subscribeActivityLifeCycle();
|
||||
mLiveAudienceViewHolder.addToParent();
|
||||
mLiveRoomViewHolder.addToParent();
|
||||
mLiveAudienceViewHolder.subscribeActivityLifeCycle();
|
||||
} else {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(1);
|
||||
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK);
|
||||
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK);
|
||||
}
|
||||
|
||||
if (mLiveRyLinkMicPkPresenter == null) {
|
||||
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
|
||||
}
|
||||
//去除主播离开画面
|
||||
if (LivePlayKsyViewHolder.leave != null) {
|
||||
LivePlayKsyViewHolder.leave.setVisibility(View.GONE);
|
||||
}
|
||||
if (LivePlayRyViewHolder.leave != null) {
|
||||
LivePlayRyViewHolder.leave.setVisibility(View.GONE);
|
||||
}
|
||||
//直播间背景
|
||||
|
||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
|
||||
|
||||
mask.setVisibility(View.VISIBLE);
|
||||
mLivePlayViewHolder.clearFrame();
|
||||
mLivePlayViewHolder.setLiveBean(mLiveBean);
|
||||
mLivePlayViewHolder.removeDetailView();
|
||||
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
|
||||
mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape());
|
||||
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
|
||||
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
|
||||
@Override
|
||||
public void onMikUpdate() {
|
||||
if (mContext instanceof LiveActivity) {
|
||||
((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder);
|
||||
}
|
||||
mLiveRoomViewHolder.resetView();
|
||||
enterRoomModel.clear();
|
||||
enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
|
||||
mLiveRoomViewHolder.setAvatar(data.getAvatar());
|
||||
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
|
||||
mLiveRoomViewHolder.setName(data.getUserNiceName());
|
||||
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
|
||||
mLiveRoomViewHolder.setTitle(data.getTitle());
|
||||
mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum());
|
||||
mLiveRoomViewHolder.clearGuardIcon();
|
||||
mLiveRoomViewHolder.clearChat();
|
||||
mLiveRoomViewHolder.releaseGift();
|
||||
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
|
||||
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this, mContext);
|
||||
if (mLiveLinkMicPresenter != null) {
|
||||
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
|
||||
}
|
||||
});
|
||||
mLiveRoomViewHolder.resetView();
|
||||
enterRoomModel.clear();
|
||||
enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
|
||||
mLiveRoomViewHolder.setAvatar(data.getAvatar());
|
||||
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
|
||||
mLiveRoomViewHolder.setName(data.getUserNiceName());
|
||||
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
|
||||
mLiveRoomViewHolder.setTitle(data.getTitle());
|
||||
mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum());
|
||||
mLiveRoomViewHolder.clearGuardIcon();
|
||||
mLiveRoomViewHolder.clearChat();
|
||||
mLiveRoomViewHolder.releaseGift();
|
||||
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
|
||||
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this, mContext);
|
||||
if (mLiveLinkMicPresenter != null) {
|
||||
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
|
||||
}
|
||||
enterRoomNew();
|
||||
enterRoomNew();
|
||||
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -1119,21 +1125,50 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendGift(LiveReceiveGiftBean bean) {
|
||||
//购买守护
|
||||
if (bean.ismTypeBuyGuard()) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showGuardGifMessage(bean);
|
||||
public void onSendGift(LiveReceiveGiftBean bean, SendBlindGiftEvent event) {
|
||||
if (event != null) {
|
||||
LiveChatBean liveChatBean = null;
|
||||
if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) {
|
||||
liveChatBean = new LiveChatBean();
|
||||
liveChatBean.setUserNiceName(event.getUserNiceName());
|
||||
liveChatBean.setType(LiveChatBean.BLIND_BOX);
|
||||
liveChatBean.setGiftName(event.getDressName());
|
||||
liveChatBean.setContent(event.getDressMsg());
|
||||
}
|
||||
} else {
|
||||
//插入盲盒礼物消息
|
||||
bean.getLiveChatBean().setType(LiveChatBean.BLIND_BOX);
|
||||
bean.getLiveChatBean().setContent(event.getGiftMsg());
|
||||
bean.getLiveChatBean().setGiftName(event.getGiftname());
|
||||
bean.getLiveChatBean().setUserNiceName(event.getUserNiceName());
|
||||
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
|
||||
if (liveChatBean != null) {
|
||||
mLiveRoomViewHolder.insertChat(liveChatBean, 1);
|
||||
}
|
||||
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
|
||||
}
|
||||
mLiveRoomViewHolder.showGiftMessage(bean, false);
|
||||
mLiveRoomViewHolder.updataWishList(bean.getGiftId(), bean.getGiftCount());
|
||||
}
|
||||
Bus.get().post(event);
|
||||
} else {
|
||||
//购买守护
|
||||
if (bean.ismTypeBuyGuard()) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showGuardGifMessage(bean);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
|
||||
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
|
||||
}
|
||||
mLiveRoomViewHolder.showGiftMessage(bean, false);
|
||||
mLiveRoomViewHolder.updataWishList(bean.getGiftId(), bean.getGiftCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1173,6 +1208,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndPk(long leftUid, long rightUid, long left, long right,LivePKUserListBean bean) {
|
||||
if (mLiveRyLinkMicPkPresenter != null) {
|
||||
if (mLiveUid.equals(leftUid + "")) {
|
||||
mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right,bean);
|
||||
} else {
|
||||
mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left,bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendDanMu(LiveDanMuBean bean) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
@@ -1969,4 +2015,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.showXydComplete(model, false, liveReceiveGiftBean);
|
||||
}
|
||||
}
|
||||
|
||||
public void blindBoxAllServerNotify(AllServerNotifyEvent event) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.blindBoxAllServerNotify(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
5
live/src/main/res/drawable/bg_all_server_336cf7.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="13dp" />
|
||||
<solid android:color="#336CF7" />
|
||||
</shape>
|
||||
5
live/src/main/res/drawable/bg_all_server_fcb50e.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="13dp" />
|
||||
<solid android:color="#FCB50E" />
|
||||
</shape>
|
||||
6
live/src/main/res/drawable/bg_all_server_fd5a9d.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="13dp" />
|
||||
<solid android:color="#FD5A9D" />
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -8,7 +8,7 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
@@ -23,11 +23,11 @@
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:visibility="gone"
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@mipmap/icon_small_download" />
|
||||
android:src="@mipmap/icon_small_download"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -41,21 +41,22 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_luck_gift_tip"
|
||||
android:layout_width="105.27dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="102dp"
|
||||
android:layout_height="31dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/bg_live_vip_blue"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/vipGoldIcon"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginEnd="3.5dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_vip_gold" />
|
||||
android:src="@mipmap/icon_vip_gold_new" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -69,8 +70,9 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:text="@string/live_gift_buy_gold"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="11.52sp" />
|
||||
android:textColor="#F5C600"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vipGoldDesc"
|
||||
@@ -78,12 +80,24 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/live_gift_buy_gold_desc"
|
||||
android:textColor="#999999"
|
||||
android:textSize="7.68sp" />
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="8sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/blind_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:visibility="invisible">
|
||||
|
||||
<include
|
||||
|
||||
layout="@layout/view_blind_box" />
|
||||
</FrameLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@@ -22,23 +22,23 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="8"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeMaxTextSize="16sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
tools:text="各位粉絲團的親親親想聽什麽歌曲聽什麽都可以只要你想聽哈哈哈哈哈?"
|
||||
android:layout_weight="8"
|
||||
android:gravity="center"
|
||||
android:textColor="#FFFFFF"
|
||||
/>
|
||||
app:autoSizeMaxTextSize="16sp"
|
||||
app:autoSizeMinTextSize="10sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
tools:text="各位粉絲團的親親親想聽什麽歌曲聽什麽都可以只要你想聽哈哈哈哈哈" />
|
||||
|
||||
<ProgressBar
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/vote_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:max="20"
|
||||
android:progress="10"
|
||||
@@ -46,9 +46,9 @@
|
||||
android:rotationY="180" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_weight="5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="5"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
@@ -57,16 +57,17 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
android:gravity="center"
|
||||
android:minLines="2"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
tools:text="喜欢喜欢喜欢喜欢"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
tools:text="喜欢喜欢喜欢喜欢" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
@@ -80,15 +81,16 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
android:minLines="2"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
tools:text="不喜欢不喜欢不喜"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeMinTextSize="5sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
tools:text="不喜欢不喜欢不喜" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
144
live/src/main/res/layout/view_blind_box.xml
Normal file
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="110dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_gravity="end"
|
||||
android:layout_width="159dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<!--凤凰,龙,麒麟-->
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_blind_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="86.5dp"
|
||||
android:background="@mipmap/bg_kirin">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="29dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="51dp">
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/blind_svga"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_masking"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/icon_masking" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="51dp"
|
||||
android:layout_marginTop="59dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_blind3"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:max="100"
|
||||
android:progress="30"
|
||||
android:progressDrawable="@drawable/bg_blind_progres"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_blind1"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/bg_blind_progress"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_blind2"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/bg_blind_progress1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_blind_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="6sp" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blind_number"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="47dp"
|
||||
android:layout_marginTop="71dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="8sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@mipmap/icon_what" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="149dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/bg_blind_bottom">
|
||||
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/text_blind_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="5dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/blind_box_open"
|
||||
android:layout_width="61dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_marginStart="7dp" />
|
||||
</FrameLayout>
|
||||
@@ -399,7 +399,6 @@
|
||||
android:id="@+id/live_duration_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
|
||||
@@ -32,12 +32,11 @@
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:padding="5dp"
|
||||
android:src="@mipmap/icon_live_ready_close"
|
||||
android:tint="@color/white"
|
||||
/>
|
||||
android:tint="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -970,6 +970,7 @@
|
||||
android:visibility="invisible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bg_all_server"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
@@ -978,8 +979,9 @@
|
||||
android:background="@drawable/bg_live_gift_tip"
|
||||
android:gravity="center|left"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!--盲盒头条-->
|
||||
<View
|
||||
android:id="@+id/super_notice"
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="18sp"
|
||||
android:layout_marginLeft="18dp"
|
||||
|
||||
BIN
live/src/main/res/mipmap-mdpi/bg_dragon_notify.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
live/src/main/res/mipmap-mdpi/bg_kirin_notify.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
live/src/main/res/mipmap-mdpi/bg_phoenix_notify.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
live/src/main/res/mipmap-mdpi/icon_blind_box_headlines.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/bg_blind_bottom.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/bg_dragon.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/bg_kirin.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/bg_phoenix.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_masking.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_vip_gold_new.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_what.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
@@ -35,7 +35,6 @@ import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LoginData;
|
||||
import com.yunbao.common.bean.UserAreaBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.fragment.LoadingDialog;
|
||||
@@ -51,7 +50,7 @@ import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
@@ -168,18 +167,24 @@ public class LoginActivity extends AbsActivity {
|
||||
|
||||
|
||||
public void loginClick(View v) {
|
||||
int i = v.getId();
|
||||
if (i == R.id.btn_login) {
|
||||
login();
|
||||
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
int i = v.getId();
|
||||
if (i == R.id.btn_login) {
|
||||
login();
|
||||
|
||||
} else if (i == R.id.btn_register) {
|
||||
register();
|
||||
} else if (i == R.id.btn_forget_pwd) {
|
||||
forgetPwd();
|
||||
} else if (i == R.id.btn_register) {
|
||||
register();
|
||||
} else if (i == R.id.btn_forget_pwd) {
|
||||
forgetPwd();
|
||||
|
||||
} else if (i == R.id.btn_tip) {
|
||||
forwardTip();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else if (i == R.id.btn_tip) {
|
||||
forwardTip();
|
||||
}
|
||||
}
|
||||
|
||||
//注册
|
||||
@@ -192,6 +197,7 @@ public class LoginActivity extends AbsActivity {
|
||||
startActivity(new Intent(mContext, FindPwdActivity.class));
|
||||
}
|
||||
|
||||
private LoadingDialog loadingDialog;
|
||||
|
||||
//手机号密码登录
|
||||
private void login() {
|
||||
@@ -209,14 +215,13 @@ public class LoginActivity extends AbsActivity {
|
||||
}
|
||||
mLoginType = Constants.MOB_PHONE;
|
||||
String uuid = DeviceUtils.getUniqueDeviceId();
|
||||
LoadingDialog loadingDialog = new LoadingDialog();
|
||||
loadingDialog = new LoadingDialog();
|
||||
loadingDialog.show(getSupportFragmentManager(), "LoadingDialog");
|
||||
loadingDialog.setShowText(getString(R.string.login_ing));
|
||||
MainHttpUtil.login(phoneNum, pwd, uuid, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
onLoginSuccess(code, msg, info);
|
||||
loadingDialog.dismiss();
|
||||
}
|
||||
});
|
||||
hideKeyboard(mEditPwd);
|
||||
@@ -282,6 +287,7 @@ public class LoginActivity extends AbsActivity {
|
||||
getBaseUserInfo();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
loadingDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,6 +320,7 @@ public class LoginActivity extends AbsActivity {
|
||||
} else {
|
||||
MainActivity.forward(LoginActivity.this, false);
|
||||
}
|
||||
loadingDialog.dismiss();
|
||||
finish();
|
||||
|
||||
}
|
||||
@@ -371,11 +378,11 @@ public class LoginActivity extends AbsActivity {
|
||||
mUuidDevice = DeviceUtils.getUniqueDeviceId();
|
||||
}
|
||||
|
||||
private void initUserArea(){
|
||||
private void initUserArea() {
|
||||
LiveNetManager.get(mContext).getUserArea(new com.yunbao.common.http.base.HttpCallback<UserAreaBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserAreaBean data) {
|
||||
IMLoginManager.get(mContext).put("sys_user_area",data.getArea());
|
||||
IMLoginManager.get(mContext).put("sys_user_area", data.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.yunbao.main.adapter.MainListAdapter;
|
||||
import com.yunbao.main.bean.ListBean;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
import com.yunbao.main.views.AbsMainListChildViewHolder;
|
||||
import com.yunbao.main.views.MainListBoxBlindViewHolder;
|
||||
import com.yunbao.main.views.MainListContributeViewHolder;
|
||||
import com.yunbao.main.views.MainListProfitViewHolder;
|
||||
import com.yunbao.main.views.MyClipPagerTitleView;
|
||||
@@ -72,7 +73,7 @@ import java.util.List;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
public class MainListActivity extends AbsActivity implements OnItemClickListener<ListBean> {
|
||||
private static final int PAGE_COUNT = 2;
|
||||
private static final int PAGE_COUNT = 3;
|
||||
public static final String DAY = "day";
|
||||
public static final String WEEK = "week";
|
||||
public static final String MONTH = "month";
|
||||
@@ -121,7 +122,8 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
mIndicator = (MagicIndicator) findViewById(R.id.indicator);
|
||||
final String[] titles = new String[]{
|
||||
(mContext.getString(R.string.glamour_list)),
|
||||
(mContext.getString(R.string.magnificent_list))
|
||||
(mContext.getString(R.string.magnificent_list)),
|
||||
(mContext.getString(R.string.blind_box_list))
|
||||
};
|
||||
CommonNavigator commonNavigator = new CommonNavigator(mContext);
|
||||
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
||||
@@ -231,9 +233,12 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
if (position == 0) {
|
||||
select.setTextColor(Color.parseColor("#FF82C1"));
|
||||
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else {
|
||||
} else if (position == 1){
|
||||
select.setTextColor(Color.parseColor("#7BBAFF"));
|
||||
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}else if (position == 2){
|
||||
select.setTextColor(Color.parseColor("#ff9072"));
|
||||
unSelect.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,6 +261,11 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
mContributeViewHolder.setHide(outRankHide);
|
||||
vh = mContributeViewHolder;
|
||||
vh.setAppbarColor(Color.parseColor("#73B2FF"));
|
||||
}else if (position == 2) {
|
||||
MainListBoxBlindViewHolder mainListBoxBlindViewHolder = new MainListBoxBlindViewHolder(mContext,parent);
|
||||
mainListBoxBlindViewHolder.setHide(outRankHide);
|
||||
vh = mainListBoxBlindViewHolder;
|
||||
vh.setAppbarColor(Color.parseColor("#ff9072"));
|
||||
}
|
||||
if (vh == null) {
|
||||
return;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
private List<ListBean> mTopList;
|
||||
private int mType;
|
||||
private List<String> outRankHide = new ArrayList<>();
|
||||
protected boolean isRankOne;//是否为魅力榜 (第一个tab)
|
||||
protected int isRankOne;//是否为魅力榜 (第一个tab)
|
||||
|
||||
|
||||
public MainListAdapter(Context context, int type) {
|
||||
@@ -93,7 +93,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
|
||||
}
|
||||
|
||||
public void setRankOne(boolean rankOne) {
|
||||
public void setRankOne(int rankOne) {
|
||||
isRankOne = rankOne;
|
||||
}
|
||||
|
||||
@@ -267,12 +267,15 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
} else {
|
||||
mBtnFollow.doChecked(false);
|
||||
mBtnFollow.setText(mFollow);
|
||||
if(isRankOne){
|
||||
if(isRankOne==0){
|
||||
mBtnFollow.setBackgroundResource(R.drawable.background_ff82c1);
|
||||
mBtnFollow.setTextColor(Color.parseColor("#FF82C1"));
|
||||
}else {
|
||||
}else if(isRankOne==1){
|
||||
mBtnFollow.setBackgroundResource(R.drawable.background_ff7bbaff);
|
||||
mBtnFollow.setTextColor(Color.parseColor("#7BBAFF"));
|
||||
}else if(isRankOne==2){
|
||||
mBtnFollow.setBackgroundResource(R.drawable.background_ffff9072);
|
||||
mBtnFollow.setTextColor(Color.parseColor("#ff9072"));
|
||||
}
|
||||
}
|
||||
mSex.setVisibility(View.INVISIBLE);
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.yunbao.common.manager.APKManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.LogUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.bean.SettingBean;
|
||||
|
||||
@@ -46,18 +47,23 @@ public class SettingAdapter extends RecyclerView.Adapter {
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Object tag = v.getTag();
|
||||
if (tag != null) {
|
||||
int position = (int) tag;
|
||||
SettingBean bean = mList.get(position);
|
||||
if (bean.getId() == 19) {
|
||||
LogUtil.shareFile(context);
|
||||
}
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(bean, position);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Object tag = v.getTag();
|
||||
if (tag != null) {
|
||||
int position = (int) tag;
|
||||
SettingBean bean = mList.get(position);
|
||||
if (bean.getId() == 19) {
|
||||
LogUtil.shareFile(context);
|
||||
}
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(bean, position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MainHttpConsts {
|
||||
public static final String GET_NEAR = "getNear";
|
||||
public static final String PROFIT_LIST = "profitList";
|
||||
public static final String CONSUME_LIST = "consumeList";
|
||||
public static final String BLIND_BOX_LIST = "blindBoxList";
|
||||
public static final String GET_BASE_INFO = "getBaseInfo";
|
||||
public static final String SET_BLACK = "setBlack";
|
||||
public static final String GET_SETTING_LIST = "getSettingList";
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("Login.userLoginByThird", MainHttpConsts.LOGIN_BY_THIRD)
|
||||
.params("openid", openid)
|
||||
.params("nicename", nicename)
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3")
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY == true ? "1" : "3")
|
||||
.params("avatar", avatar)
|
||||
.params("type", type)
|
||||
.params("source", DEVICE)
|
||||
@@ -77,11 +77,11 @@ public class MainHttpUtil {
|
||||
* 第三方登录---增加参数:推广码,手机唯一标识
|
||||
*/
|
||||
|
||||
public static void loginByThird(String UserID,String openid, String promoCode, String uuidDevice, String nicename, String avatar, String type, HttpCallback callback) {
|
||||
public static void loginByThird(String UserID, String openid, String promoCode, String uuidDevice, String nicename, String avatar, String type, HttpCallback callback) {
|
||||
String sign = MD5Util.getMD5("openid=" + openid + "&" + SALT);
|
||||
HttpClient.getInstance().get("Login.userLoginByThird", MainHttpConsts.LOGIN_BY_THIRD)
|
||||
.params("openid", openid)
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3")
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY == true ? "1" : "3")
|
||||
.params("admin_id", promoCode)
|
||||
.params("uuid_Device", uuidDevice)
|
||||
.params("nicename", nicename)
|
||||
@@ -198,6 +198,14 @@ public class MainHttpUtil {
|
||||
|
||||
}
|
||||
|
||||
//排行榜 盲盒榜
|
||||
public static void blindBoxList(String type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Home.blindBoxList", MainHttpConsts.BLIND_BOX_LIST)
|
||||
.params("type", type)
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取谷歌
|
||||
@@ -324,10 +332,11 @@ public class MainHttpUtil {
|
||||
.params("p", p)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
public static void searchnew(String fan_key, String jian_key,int type, int p, HttpCallback callback) {
|
||||
public static void searchnew(String fan_key, String jian_key, int type, int p, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("", MainHttpConsts.SEARCH)
|
||||
.params("jian_key", jian_key)
|
||||
.params("fan_key", fan_key)
|
||||
@@ -553,10 +562,10 @@ public class MainHttpUtil {
|
||||
/**
|
||||
* 手机注册接口---增加参数:推广码,手机唯一标识,国家代码
|
||||
*/
|
||||
public static void register(String UserID,String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) {
|
||||
public static void register(String UserID, String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Login.userReg", MainHttpConsts.REGISTER)
|
||||
.params("user_login", user_login)
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3")
|
||||
.params("app_source", CommonAppConfig.IS_GOOGLE_PLAY == true ? "1" : "3")
|
||||
//增加参数:推广码
|
||||
.params("user_activation_key", promo_code)
|
||||
.params("admin_id", promo_code)
|
||||
@@ -696,9 +705,10 @@ public class MainHttpUtil {
|
||||
HttpClient.getInstance().get("User.isInstructor", MainHttpConsts.ISINSTRUCTOR)
|
||||
.execute(callback);
|
||||
}
|
||||
//
|
||||
public static void setMessageReadAll(){
|
||||
HttpClient.getInstance().get("User.getUserInstructor","")
|
||||
|
||||
//
|
||||
public static void setMessageReadAll() {
|
||||
HttpClient.getInstance().get("User.getUserInstructor", "")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -706,10 +716,11 @@ public class MainHttpUtil {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备号有没有注册过
|
||||
*/
|
||||
public static void getDeviceLoginType( HttpCallback callback) {
|
||||
public static void getDeviceLoginType(HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Login.getDeviceLoginType", "Login.getDeviceLoginType")
|
||||
.params("uuid_Device", DeviceUtils.getUniqueDeviceId())
|
||||
.execute(callback);
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -57,7 +56,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
public static final String MONTH = "month";
|
||||
public static final String TOTAL = "total";
|
||||
protected String mType;
|
||||
protected boolean isRankOne;//是否为魅力榜 (第一个tab)
|
||||
protected int isRankOne;//是否为魅力榜 (第一个tab)
|
||||
protected CommonRefreshView mRefreshView;
|
||||
public MainListAdapter mAdapter;
|
||||
protected OnLoadData loadData;
|
||||
@@ -92,11 +91,14 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
public void onData(List<ListBean> list, List<String> outRankHide) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (outRankHide != null) {
|
||||
for (String hideId : outRankHide) {
|
||||
if (i < 3) {
|
||||
hv.setData(list.get(i).setHide(TextUtils .equals(list.get(i).getUid(), hideId)), i);
|
||||
}
|
||||
|
||||
|
||||
if (i < 3 && outRankHide.contains(list.get(i).getUid())) {
|
||||
hv.setData(list.get(i).setHide(true), i);
|
||||
} else if (i < 3) {
|
||||
hv.setData(list.get(i).setHide(false), i);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (i < 3) {
|
||||
hv.setData(list.get(i), i);
|
||||
@@ -216,8 +218,10 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
}
|
||||
if (position == 0) {
|
||||
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour_top);
|
||||
} else {
|
||||
} else if (position == 1) {
|
||||
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour2_top);
|
||||
} else if (position == 2) {
|
||||
mBackgroundLayout.setBackgroundResource(R.mipmap.bg_glamour3_top);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +308,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
setVisibility(View.GONE, -1, svga1, svga2, svga3);
|
||||
if (bean.getDress_head() != null) {
|
||||
if (bean.getDress_head().contains("svga")) {
|
||||
setVisibility(View.VISIBLE, position, svga1, svga2, svga3);
|
||||
|
||||
try {
|
||||
new SVGAParser(mContext).parse(new URL(bean.getDress_head()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
@@ -312,6 +316,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
getItem(position, svga1, svga2, svga3).setImageDrawable(drawable);
|
||||
SVGAViewUtils.playEndClear(getItem(position, svga1, svga2, svga3), false);
|
||||
setVisibility(View.VISIBLE, position, svga1, svga2, svga3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,13 +340,16 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
setVisibility(bean.isHide() ? View.GONE : View.VISIBLE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3);
|
||||
if (bean.getAttention() != 1) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).doChecked(true);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" +mContext.getString(R.string.follow));
|
||||
if (isRankOne) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setText("+" + mContext.getString(R.string.follow));
|
||||
if (isRankOne == 0) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ffff79c2);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else {
|
||||
} else if (isRankOne == 1) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_7bbaff);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||
} else if (isRankOne == 2) {
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setBackgroundResource(R.drawable.background_ff9072);
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setTextColor(Color.parseColor("#FFFFFF"));
|
||||
}
|
||||
getItem(position, mBtnFollow1, mBtnFollow2, mBtnFollow3).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
@@ -353,7 +361,8 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
|
||||
getItem(position, mName1, mName2, mName3).setText(R.string.mystery_man);
|
||||
ImgLoader.display(mContext, R.mipmap.hide, getItem(position, mAvatar1, mAvatar2, mAvatar3));
|
||||
getItem(position, mSex1, mSex2, mSex3).setVisibility(View.GONE);
|
||||
getItem(position, mVotes1, mVotes2, mVotes3).setVisibility(View.GONE);
|
||||
setVisibility(View.GONE, position, svga1, svga2, svga3);
|
||||
setVisibility(View.GONE, position, mBtnFollow1, mBtnFollow2, mBtnFollow3);
|
||||
} else {
|
||||
ImgLoader.display(mContext, bean.getAvatarThumb(), getItem(position, mAvatar1, mAvatar2, mAvatar3));
|
||||
getItem(position, mName1, mName2, mName3).setText(bean.getUserNiceName());
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.main.adapter.MainListAdapter;
|
||||
import com.yunbao.main.bean.ListBean;
|
||||
import com.yunbao.main.http.MainHttpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排行榜,盲盒榜
|
||||
*/
|
||||
public class MainListBoxBlindViewHolder extends AbsMainListChildViewHolder {
|
||||
private List<String> outRankHide = new ArrayList<>();
|
||||
|
||||
public MainListBoxBlindViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
isRankOne = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<ListBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<ListBean> getAdapter() {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainListAdapter(mContext, MainListAdapter.TYPE_CONTRIBUTE);
|
||||
mAdapter.setRankOne(isRankOne);
|
||||
mAdapter.setOnItemClickListener(MainListBoxBlindViewHolder.this);
|
||||
}
|
||||
mAdapter.setHide(outRankHide);
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
if (!mType.isEmpty()) {
|
||||
MainHttpUtil.blindBoxList(mType, p, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ListBean> processData(String[] info) {
|
||||
list = JSON.parseArray(Arrays.toString(info), ListBean.class);
|
||||
if (mRefreshView.getPageCount() == 1) {
|
||||
if (loadData != null) {
|
||||
loadData.onData(list, outRankHide);
|
||||
}
|
||||
}
|
||||
mAdapter.setHide(outRankHide);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<ListBean> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<ListBean> loadItemList, int loadItemCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置隐藏数据
|
||||
*
|
||||
* @param outRankHide
|
||||
*/
|
||||
public void setHide(List<String> outRankHide) {
|
||||
this.outRankHide = outRankHide;
|
||||
if (mAdapter != null)
|
||||
mAdapter.setHide(outRankHide);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class MainListContributeViewHolder extends AbsMainListChildViewHolder {
|
||||
|
||||
public MainListContributeViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
isRankOne = false;
|
||||
isRankOne = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder {
|
||||
|
||||
public MainListProfitViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
isRankOne = true;
|
||||
isRankOne = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
10
main/src/main/res/drawable/background_ff9072.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="62dp" android:height="26dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ffffffff" />
|
||||
<solid android:color="#FF9072" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
main/src/main/res/drawable/background_ffff9072.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="68dp" android:height="28dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#FF9072" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -16,6 +16,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:scaleType="centerCrop"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</androidx.viewpager.widget.ViewPager>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bg_layout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -91,5 +92,4 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
main/src/main/res/mipmap-xxhdpi/bg_glamour3_top.png
Normal file
|
After Width: | Height: | Size: 277 KiB |