Merge remote-tracking branch 'origin/master'

This commit is contained in:
zlzw 2022-11-25 16:28:19 +08:00
commit 4a9a8c3ec3
40 changed files with 2197 additions and 327 deletions

View File

@ -10,6 +10,8 @@ import java.util.List;
*/ */
public class Constants { public class Constants {
public static final String NEW_ENTER_ROOM = "enterRoom";
public static final String URL = "url"; public static final String URL = "url";
public static final String PAYLOAD = "payload"; public static final String PAYLOAD = "payload";
public static final String SEX = "sex"; public static final String SEX = "sex";

View File

@ -75,7 +75,7 @@ public class AnchorRecommendItemModel extends BaseModel {
private String avatarThumb = ""; private String avatarThumb = "";
@SerializedName("avatar2") @SerializedName("avatar2")
private String avatar2 = ""; private String avatar2 = "";
@SerializedName("user_nicename") @SerializedName(value = "user_nicename", alternate = "userNiceName")
private String userNicename = ""; private String userNicename = "";
@SerializedName("level") @SerializedName("level")
private String level = ""; private String level = "";

View File

@ -0,0 +1,53 @@
package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
public class CheckLiveModel extends BaseModel {
@SerializedName("type")
private int type;
@SerializedName("type_val")
private String typeVal;
@SerializedName("type_msg")
private String typeMsg;
@SerializedName("live_sdk")
private String liveSdk;
public static CheckLiveModel objectFromData(String str) {
return new Gson().fromJson(str, CheckLiveModel.class);
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getTypeVal() {
return typeVal;
}
public void setTypeVal(String typeVal) {
this.typeVal = typeVal;
}
public String getTypeMsg() {
return typeMsg;
}
public void setTypeMsg(String typeMsg) {
this.typeMsg = typeMsg;
}
public String getLiveSdk() {
return liveSdk;
}
public void setLiveSdk(String liveSdk) {
this.liveSdk = liveSdk;
}
}

View File

@ -0,0 +1,540 @@
package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import java.util.List;
public class EnterRoomInfoModel extends BaseModel {
@SerializedName("votestotal")
private String votestotal;
@SerializedName("medalRankNum")
private String medalRankNum;
@SerializedName("barrage_fee")
private String barrageFee;
@SerializedName("userlist_time")
private String userlistTime;
@SerializedName("chatserver")
private String chatserver;
@SerializedName("linkmic_uid")
private String linkmicUid;
@SerializedName("linkmic_pull")
private String linkmicPull;
@SerializedName("nums")
private String nums;
@SerializedName("game")
private List<?> game;
@SerializedName("gamebet")
private List<String> gamebet;
@SerializedName("gametime")
private String gametime;
@SerializedName("gameid")
private String gameid;
@SerializedName("gameaction")
private String gameaction;
@SerializedName("game_bankerid")
private String gameBankerid;
@SerializedName("game_banker_name")
private String gameBankerName;
@SerializedName("game_banker_avatar")
private String gameBankerAvatar;
@SerializedName("game_banker_coin")
private String gameBankerCoin;
@SerializedName("game_banker_limit")
private String gameBankerLimit;
@SerializedName("shut_time")
private String shutTime;
@SerializedName("kick_time")
private String kickTime;
@SerializedName("speak_limit")
private String speakLimit;
@SerializedName("barrage_limit")
private String barrageLimit;
@SerializedName("coin")
private String coin;
@SerializedName("vip")
private VipModel vip;
@SerializedName("liang")
private LiangModel liang;
@SerializedName("medal_level")
private String medalLevel;
@SerializedName("medal_name")
private String medalName;
@SerializedName("issuper")
private String issuper;
@SerializedName("usertype")
private String usertype;
@SerializedName("front_task")
private String frontTask;
@SerializedName("ismic")
private String ismic;
@SerializedName("isattention")
private String isattention;
@SerializedName("userlists")
private List<LiveUserGiftBean> userlists;
@SerializedName("guard")
private GuardModel guard;
@SerializedName("guard_nums")
private String guardNums;
@SerializedName("pkinfo")
private PkinfoModel pkinfo;
@SerializedName("lminfo")
private LminfoModel lminfo;
@SerializedName("isred")
private String isred;
@SerializedName("is_fans")
private String isFans;
@SerializedName("count_fans")
private String countFans;
@SerializedName("isconnection")
private String isconnection;
@SerializedName("isleave")
private String isleave;
@SerializedName("landscape")
private String landscape;
@SerializedName("un_charge")
private String unCharge;
@SerializedName("see_time")
private String seeTime;
@SerializedName("greetings")
private List<String> greetings;
@SerializedName("live_bg")
private String liveBg;
@SerializedName("anchor_goodnum")
private String anchorGoodnum;
public String getVotestotal() {
return votestotal;
}
public EnterRoomInfoModel setVotestotal(String votestotal) {
this.votestotal = votestotal;
return this;
}
public String getMedalRankNum() {
return medalRankNum;
}
public EnterRoomInfoModel setMedalRankNum(String medalRankNum) {
this.medalRankNum = medalRankNum;
return this;
}
public String getBarrageFee() {
return barrageFee;
}
public EnterRoomInfoModel setBarrageFee(String barrageFee) {
this.barrageFee = barrageFee;
return this;
}
public String getUserlistTime() {
return userlistTime;
}
public EnterRoomInfoModel setUserlistTime(String userlistTime) {
this.userlistTime = userlistTime;
return this;
}
public String getChatserver() {
return chatserver;
}
public EnterRoomInfoModel setChatserver(String chatserver) {
this.chatserver = chatserver;
return this;
}
public String getLinkmicUid() {
return linkmicUid;
}
public EnterRoomInfoModel setLinkmicUid(String linkmicUid) {
this.linkmicUid = linkmicUid;
return this;
}
public String getLinkmicPull() {
return linkmicPull;
}
public EnterRoomInfoModel setLinkmicPull(String linkmicPull) {
this.linkmicPull = linkmicPull;
return this;
}
public String getNums() {
return nums;
}
public EnterRoomInfoModel setNums(String nums) {
this.nums = nums;
return this;
}
public List<?> getGame() {
return game;
}
public EnterRoomInfoModel setGame(List<?> game) {
this.game = game;
return this;
}
public List<String> getGamebet() {
return gamebet;
}
public EnterRoomInfoModel setGamebet(List<String> gamebet) {
this.gamebet = gamebet;
return this;
}
public String getGametime() {
return gametime;
}
public EnterRoomInfoModel setGametime(String gametime) {
this.gametime = gametime;
return this;
}
public String getGameid() {
return gameid;
}
public EnterRoomInfoModel setGameid(String gameid) {
this.gameid = gameid;
return this;
}
public String getGameaction() {
return gameaction;
}
public EnterRoomInfoModel setGameaction(String gameaction) {
this.gameaction = gameaction;
return this;
}
public String getGameBankerid() {
return gameBankerid;
}
public EnterRoomInfoModel setGameBankerid(String gameBankerid) {
this.gameBankerid = gameBankerid;
return this;
}
public String getGameBankerName() {
return gameBankerName;
}
public EnterRoomInfoModel setGameBankerName(String gameBankerName) {
this.gameBankerName = gameBankerName;
return this;
}
public String getGameBankerAvatar() {
return gameBankerAvatar;
}
public EnterRoomInfoModel setGameBankerAvatar(String gameBankerAvatar) {
this.gameBankerAvatar = gameBankerAvatar;
return this;
}
public String getGameBankerCoin() {
return gameBankerCoin;
}
public EnterRoomInfoModel setGameBankerCoin(String gameBankerCoin) {
this.gameBankerCoin = gameBankerCoin;
return this;
}
public String getGameBankerLimit() {
return gameBankerLimit;
}
public EnterRoomInfoModel setGameBankerLimit(String gameBankerLimit) {
this.gameBankerLimit = gameBankerLimit;
return this;
}
public String getShutTime() {
return shutTime;
}
public EnterRoomInfoModel setShutTime(String shutTime) {
this.shutTime = shutTime;
return this;
}
public String getKickTime() {
return kickTime;
}
public EnterRoomInfoModel setKickTime(String kickTime) {
this.kickTime = kickTime;
return this;
}
public String getSpeakLimit() {
return speakLimit;
}
public EnterRoomInfoModel setSpeakLimit(String speakLimit) {
this.speakLimit = speakLimit;
return this;
}
public String getBarrageLimit() {
return barrageLimit;
}
public EnterRoomInfoModel setBarrageLimit(String barrageLimit) {
this.barrageLimit = barrageLimit;
return this;
}
public String getCoin() {
return coin;
}
public EnterRoomInfoModel setCoin(String coin) {
this.coin = coin;
return this;
}
public VipModel getVip() {
return vip;
}
public EnterRoomInfoModel setVip(VipModel vip) {
this.vip = vip;
return this;
}
public LiangModel getLiang() {
return liang;
}
public EnterRoomInfoModel setLiang(LiangModel liang) {
this.liang = liang;
return this;
}
public String getMedalLevel() {
return medalLevel;
}
public EnterRoomInfoModel setMedalLevel(String medalLevel) {
this.medalLevel = medalLevel;
return this;
}
public String getMedalName() {
return medalName;
}
public EnterRoomInfoModel setMedalName(String medalName) {
this.medalName = medalName;
return this;
}
public String getIssuper() {
return issuper;
}
public EnterRoomInfoModel setIssuper(String issuper) {
this.issuper = issuper;
return this;
}
public String getUsertype() {
return usertype;
}
public EnterRoomInfoModel setUsertype(String usertype) {
this.usertype = usertype;
return this;
}
public String getFrontTask() {
return frontTask;
}
public EnterRoomInfoModel setFrontTask(String frontTask) {
this.frontTask = frontTask;
return this;
}
public String getIsmic() {
return ismic;
}
public EnterRoomInfoModel setIsmic(String ismic) {
this.ismic = ismic;
return this;
}
public String getIsattention() {
return isattention;
}
public EnterRoomInfoModel setIsattention(String isattention) {
this.isattention = isattention;
return this;
}
public List<LiveUserGiftBean> getUserlists() {
return userlists;
}
public EnterRoomInfoModel setUserlists(List<LiveUserGiftBean> userlists) {
this.userlists = userlists;
return this;
}
public GuardModel getGuard() {
return guard;
}
public EnterRoomInfoModel setGuard(GuardModel guard) {
this.guard = guard;
return this;
}
public String getGuardNums() {
return guardNums;
}
public EnterRoomInfoModel setGuardNums(String guardNums) {
this.guardNums = guardNums;
return this;
}
public PkinfoModel getPkinfo() {
return pkinfo;
}
public EnterRoomInfoModel setPkinfo(PkinfoModel pkinfo) {
this.pkinfo = pkinfo;
return this;
}
public LminfoModel getLminfo() {
return lminfo;
}
public EnterRoomInfoModel setLminfo(LminfoModel lminfo) {
this.lminfo = lminfo;
return this;
}
public String getIsred() {
return isred;
}
public EnterRoomInfoModel setIsred(String isred) {
this.isred = isred;
return this;
}
public String getIsFans() {
return isFans;
}
public EnterRoomInfoModel setIsFans(String isFans) {
this.isFans = isFans;
return this;
}
public String getCountFans() {
return countFans;
}
public EnterRoomInfoModel setCountFans(String countFans) {
this.countFans = countFans;
return this;
}
public String getIsconnection() {
return isconnection;
}
public EnterRoomInfoModel setIsconnection(String isconnection) {
this.isconnection = isconnection;
return this;
}
public String getIsleave() {
return isleave;
}
public EnterRoomInfoModel setIsleave(String isleave) {
this.isleave = isleave;
return this;
}
public String getLandscape() {
return landscape;
}
public EnterRoomInfoModel setLandscape(String landscape) {
this.landscape = landscape;
return this;
}
public String getUnCharge() {
return unCharge;
}
public EnterRoomInfoModel setUnCharge(String unCharge) {
this.unCharge = unCharge;
return this;
}
public String getSeeTime() {
return seeTime;
}
public EnterRoomInfoModel setSeeTime(String seeTime) {
this.seeTime = seeTime;
return this;
}
public List<String> getGreetings() {
return greetings;
}
public EnterRoomInfoModel setGreetings(List<String> greetings) {
this.greetings = greetings;
return this;
}
public String getLiveBg() {
return liveBg;
}
public EnterRoomInfoModel setLiveBg(String liveBg) {
this.liveBg = liveBg;
return this;
}
public String getAnchorGoodnum() {
return anchorGoodnum;
}
public EnterRoomInfoModel setAnchorGoodnum(String anchorGoodnum) {
this.anchorGoodnum = anchorGoodnum;
return this;
}
}

View File

@ -0,0 +1,111 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* 整合进入直播间接口
*/
public class EnterRoomNewModel extends BaseModel {
@SerializedName("liveInfo")
private LiveInfoModel liveInfo;//直播间信息
@SerializedName("enterRoomInfo")
private EnterRoomInfoModel enterRoomInfo;//原接口进入直播间数据返回
@SerializedName("rankHour")
private RankHourModel rankHour;//.热度卡
@SerializedName("newPeopleTask")
private NewPeopleTaskModel newPeopleTask;//新人任务
@SerializedName("wishList")
private WishListModel wishList;//心愿单
@SerializedName("guardUser")
private GuardUserModel guardUserAvatar;//守护
@SerializedName("activeList")
private List<ActiveModel> activeList;//活动列表
@SerializedName("isUseHotCard")
private String isUseHotCard;//是否使用热度卡
@SerializedName("liveRoomActivity")
private List<LiveRoomActivityModel> liveRoomActivityModels;//活动列表
public List<LiveRoomActivityModel> getLiveRoomActivityModels() {
return liveRoomActivityModels;
}
public EnterRoomNewModel setLiveRoomActivityModels(List<LiveRoomActivityModel> liveRoomActivityModels) {
this.liveRoomActivityModels = liveRoomActivityModels;
return this;
}
public LiveInfoModel getLiveInfo() {
return liveInfo;
}
public EnterRoomNewModel setLiveInfo(LiveInfoModel liveInfo) {
this.liveInfo = liveInfo;
return this;
}
public EnterRoomInfoModel getEnterRoomInfo() {
return enterRoomInfo;
}
public EnterRoomNewModel setEnterRoomInfo(EnterRoomInfoModel enterRoomInfo) {
this.enterRoomInfo = enterRoomInfo;
return this;
}
public RankHourModel getRankHour() {
return rankHour;
}
public EnterRoomNewModel setRankHour(RankHourModel rankHour) {
this.rankHour = rankHour;
return this;
}
public NewPeopleTaskModel getNewPeopleTask() {
return newPeopleTask;
}
public EnterRoomNewModel setNewPeopleTask(NewPeopleTaskModel newPeopleTask) {
this.newPeopleTask = newPeopleTask;
return this;
}
public WishListModel getWishList() {
return wishList;
}
public EnterRoomNewModel setWishList(WishListModel wishList) {
this.wishList = wishList;
return this;
}
public GuardUserModel getGuardUserAvatar() {
return guardUserAvatar;
}
public EnterRoomNewModel setGuardUserAvatar(GuardUserModel guardUserAvatar) {
this.guardUserAvatar = guardUserAvatar;
return this;
}
public List<ActiveModel> getActiveList() {
return activeList;
}
public EnterRoomNewModel setActiveList(List<ActiveModel> activeList) {
this.activeList = activeList;
return this;
}
public String getIsUseHotCard() {
return isUseHotCard;
}
public EnterRoomNewModel setIsUseHotCard(String isUseHotCard) {
this.isUseHotCard = isUseHotCard;
return this;
}
}

View File

@ -0,0 +1,29 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class GuardModel extends BaseModel {
@SerializedName("type")
private String type;
@SerializedName("endtime")
private String endtime;
public String getType() {
return type;
}
public GuardModel setType(String type) {
this.type = type;
return this;
}
public String getEndtime() {
return endtime;
}
public GuardModel setEndtime(String endtime) {
this.endtime = endtime;
return this;
}
}

View File

@ -0,0 +1,33 @@
package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
public class GuardUserModel extends BaseModel{
@SerializedName("guardUserAvatar")
private String guardUserAvatar;
@SerializedName("guardType")
private String guardType;
public static GuardUserModel objectFromData(String str) {
return new Gson().fromJson(str, GuardUserModel.class);
}
public String getGuardUserAvatar() {
return guardUserAvatar;
}
public void setGuardUserAvatar(String guardUserAvatar) {
this.guardUserAvatar = guardUserAvatar;
}
public String getGuardType() {
return guardType;
}
public void setGuardType(String guardType) {
this.guardType = guardType;
}
}

View File

@ -66,6 +66,7 @@ public class IMLoginModel extends BaseModel {
* noble_name : 贵族 * noble_name : 贵族
* sex : 1 * sex : 1
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}] * slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
* slide : [{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"首充特惠大禮包","slide_id":91,"slide_name":"首充特惠大禮包","slide_pic":"https://qny.shayucm.com/20220531/90f6942fb928c3034baeb380b9c4003d.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/activity/firstTopUp/newUp.html"},{"listorder":0,"slide_cid":4,"slide_content":"","slide_des":"充值反饋活動","slide_id":88,"slide_name":"充值反饋活動","slide_pic":"https://qny.shayucm.com/20220511/faacb51d5a45f7ff24a6f0314df133fb.gif","slide_status":1,"slide_url":"https://ceshi.yaoulive.com/h5/GuildTournament/202204/Tournament.html"}]
* users_type : A * users_type : A
* votes : 0.00 * votes : 0.00
* votestotal : 0 * votestotal : 0
@ -224,6 +225,126 @@ public class IMLoginModel extends BaseModel {
//超皇字体颜色 //超皇字体颜色
@SerializedName("contentColor") @SerializedName("contentColor")
private String contentColor = ""; private String contentColor = "";
//创建时间
@SerializedName("create_time")
private String createTime = "";
@SerializedName("is_guess")
private String isGuess = "";
@SerializedName("goodnum_expire_time")
private String goodnumExpireTime = "";
@SerializedName("version")
private String version = "";
@SerializedName("max_noble_end_time")
private String maxNobleEndTime = "";
@SerializedName("custom_color_id")
private String customColorId = "";
@SerializedName("is_chat")
private String isChat = "";
@SerializedName("is_rong")
private String isRong = "";
@SerializedName("contribution")
private String contribution = "";
@SerializedName("guard_type")
private String guardType = "";
public String getCreateTime() {
return createTime;
}
public IMLoginModel setCreateTime(String createTime) {
this.createTime = createTime;
return this;
}
public String getIsGuess() {
return isGuess;
}
public IMLoginModel setIsGuess(String isGuess) {
this.isGuess = isGuess;
return this;
}
public String getGoodnumExpireTime() {
return goodnumExpireTime;
}
public IMLoginModel setGoodnumExpireTime(String goodnumExpireTime) {
this.goodnumExpireTime = goodnumExpireTime;
return this;
}
public String getVersion() {
return version;
}
public IMLoginModel setVersion(String version) {
this.version = version;
return this;
}
public String getMaxNobleEndTime() {
return maxNobleEndTime;
}
public IMLoginModel setMaxNobleEndTime(String maxNobleEndTime) {
this.maxNobleEndTime = maxNobleEndTime;
return this;
}
public String getCustomColorId() {
return customColorId;
}
public IMLoginModel setCustomColorId(String customColorId) {
this.customColorId = customColorId;
return this;
}
public String getIsChat() {
return isChat;
}
public IMLoginModel setIsChat(String isChat) {
this.isChat = isChat;
return this;
}
public String getIsRong() {
return isRong;
}
public IMLoginModel setIsRong(String isRong) {
this.isRong = isRong;
return this;
}
public String getContribution() {
return contribution;
}
public IMLoginModel setContribution(String contribution) {
this.contribution = contribution;
return this;
}
public String getGuardType() {
return guardType;
}
public IMLoginModel setGuardType(String guardType) {
this.guardType = guardType;
return this;
}
public String getNobleEndTime() { public String getNobleEndTime() {
return nobleEndTime; return nobleEndTime;

View File

@ -5,8 +5,6 @@ import android.os.Parcelable;
import android.text.TextUtils; import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.yunbao.common.R;
import com.yunbao.common.utils.WordUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -387,18 +385,19 @@ public class LiveBean implements Parcelable {
} }
private LiveBean(Parcel in) { private LiveBean(Parcel in) {
this.uid = in.readString(); this.uid = in.readString();
this.avatar = in.readString(); this.avatar = in.readString();
this.avatarThumb = in.readString(); this.avatarThumb = in.readString();
this.userNiceName = in.readString(); this.userNiceName = in.readString();
this.sex = in.readInt();
this.title = in.readString(); this.title = in.readString();
this.city = in.readString(); this.city = in.readString();
this.stream = in.readString(); this.stream = in.readString();
this.pull = in.readString(); this.pull = in.readString();
this.thumb = in.readString(); this.thumb = in.readString();
this.nums = in.readString(); this.nums = in.readString();
this.sex = in.readInt();
this.distance = in.readString(); this.distance = in.readString();
this.levelAnchor = in.readInt(); this.levelAnchor = in.readInt();
this.type = in.readInt(); this.type = in.readInt();
@ -406,6 +405,23 @@ public class LiveBean implements Parcelable {
this.goodNum = in.readString(); this.goodNum = in.readString();
this.gameAction = in.readInt(); this.gameAction = in.readInt();
this.game = in.readString(); this.game = in.readString();
this.islive = in.readString();
this.isTop = in.readString();
this.pk_avatar_thumb = in.readString();
this.landscape = in.readInt();
this.hot_num = in.readString();
this.content_pic_size_one = in.readString();
this.content_pic_size_two = in.readString();
this.content_pic_size_three = in.readString();
this.is_week = in.readString();
this.img = in.readString();
this.url = in.readString();
this.drpk_status = in.readString();
this.is_rong = in.readInt();
this.isattention = in.readString();
this.recommendCardtype = in.readString();
this.recommendCardIconSizeTwo = in.readString();
this.recommendCardIconSizeThree = in.readString();
} }
@Override @Override
@ -419,13 +435,13 @@ public class LiveBean implements Parcelable {
dest.writeString(this.avatar); dest.writeString(this.avatar);
dest.writeString(this.avatarThumb); dest.writeString(this.avatarThumb);
dest.writeString(this.userNiceName); dest.writeString(this.userNiceName);
dest.writeInt(this.sex);
dest.writeString(this.title); dest.writeString(this.title);
dest.writeString(this.city); dest.writeString(this.city);
dest.writeString(this.stream); dest.writeString(this.stream);
dest.writeString(this.pull); dest.writeString(this.pull);
dest.writeString(this.thumb); dest.writeString(this.thumb);
dest.writeString(this.nums); dest.writeString(this.nums);
dest.writeInt(this.sex);
dest.writeString(this.distance); dest.writeString(this.distance);
dest.writeInt(this.levelAnchor); dest.writeInt(this.levelAnchor);
dest.writeInt(this.type); dest.writeInt(this.type);
@ -433,6 +449,23 @@ public class LiveBean implements Parcelable {
dest.writeString(this.goodNum); dest.writeString(this.goodNum);
dest.writeInt(this.gameAction); dest.writeInt(this.gameAction);
dest.writeString(this.game); dest.writeString(this.game);
dest.writeString(this.islive);
dest.writeString(this.isTop);
dest.writeString(this.pk_avatar_thumb);
dest.writeInt(this.landscape);
dest.writeString(this.hot_num);
dest.writeString(this.content_pic_size_one);
dest.writeString(this.content_pic_size_two);
dest.writeString(this.content_pic_size_three);
dest.writeString(this.is_week);
dest.writeString(this.img);
dest.writeString(this.url);
dest.writeString(this.drpk_status);
dest.writeInt(this.is_rong);
dest.writeString(this.isattention);
dest.writeString(this.recommendCardtype);
dest.writeString(this.recommendCardIconSizeTwo);
dest.writeString(this.recommendCardIconSizeThree);
} }
public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() { public static final Creator<LiveBean> CREATOR = new Creator<LiveBean>() {

View File

@ -0,0 +1,66 @@
package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
/**
* 活动列表
*/
public class LiveRoomActivityModel extends BaseModel {
@SerializedName("name")
private String name;
@SerializedName("img")
private String img;
@SerializedName("link")
private String link;
@SerializedName("is_hidden")
private String isHidden;
@SerializedName("show_type")
private String showType;
public String getName() {
return name;
}
public LiveRoomActivityModel setName(String name) {
this.name = name;
return this;
}
public String getImg() {
return img;
}
public LiveRoomActivityModel setImg(String img) {
this.img = img;
return this;
}
public String getLink() {
return link;
}
public LiveRoomActivityModel setLink(String link) {
this.link = link;
return this;
}
public String getIsHidden() {
return isHidden;
}
public LiveRoomActivityModel setIsHidden(String isHidden) {
this.isHidden = isHidden;
return this;
}
public String getShowType() {
return showType;
}
public LiveRoomActivityModel setShowType(String showType) {
this.showType = showType;
return this;
}
}

View File

@ -1,5 +1,6 @@
package com.yunbao.live.bean; package com.yunbao.common.bean;
import android.os.Parcel;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
@ -51,4 +52,13 @@ public class LiveUserGiftBean extends UserBean {
public void setGuardType(int guardType) { public void setGuardType(int guardType) {
this.guardType = guardType; this.guardType = guardType;
} }
public LiveUserGiftBean(Parcel in) {
super(in);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
}
} }

View File

@ -0,0 +1,23 @@
package com.yunbao.common.bean;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
public class LminfoModel extends BaseModel{
@SerializedName("status")
private int status;
public static LminfoModel objectFromData(String str) {
return new Gson().fromJson(str, LminfoModel.class);
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}

View File

@ -0,0 +1,14 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class NewPeopleTaskModel extends BaseModel {
// @SerializedName("task")
// private TaskModel task;
// @SerializedName("gift")
// private GiftModel gift;
// @SerializedName("reward_all")
// private RewardAllModel rewardAll;
// @SerializedName("reward_one")
// private RewardAllModel rewardOne;
}

View File

@ -0,0 +1,39 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class PKTopThreeModel extends BaseModel {
@SerializedName("uid")
private String uid;
@SerializedName("img")
private String img;
@SerializedName("liveuid")
private String liveuid;
public String getUid() {
return uid;
}
public PKTopThreeModel setUid(String uid) {
this.uid = uid;
return this;
}
public String getImg() {
return img;
}
public PKTopThreeModel setImg(String img) {
this.img = img;
return this;
}
public String getLiveuid() {
return liveuid;
}
public PKTopThreeModel setLiveuid(String liveuid) {
this.liveuid = liveuid;
return this;
}
}

View File

@ -0,0 +1,18 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class PkTopUsersModel extends BaseModel {
@SerializedName("red_one")
private PKTopThreeModel redOne;
@SerializedName("red_two")
private PKTopThreeModel redTwo;
@SerializedName("red_three")
private PKTopThreeModel redThree;
@SerializedName("blue_one")
private PKTopThreeModel blueOne;
@SerializedName("blue_two")
private PKTopThreeModel blueTwo;
@SerializedName("blue_three")
private PKTopThreeModel blueThree;
}

View File

@ -0,0 +1,161 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class PkinfoModel extends BaseModel {
@SerializedName("pkuid")
private String pkuid;
@SerializedName("pkuname")
private String pkuname;
@SerializedName("pkuimg")
private String pkuimg;
@SerializedName("pkpull")
private String pkpull;
@SerializedName("ifpk")
private String ifpk;
@SerializedName("pk_time")
private String pkTime;
@SerializedName("end_pk_time")
private String endPkTime;
@SerializedName("pk_gift_liveuid")
private String pkGiftLiveuid;
@SerializedName("pk_gift_pkuid")
private String pkGiftPkuid;
@SerializedName("anyway")
private String anyway;
@SerializedName("drpk_status")
private String drpkStatus;
@SerializedName("drpk_roomid")
private String drpkRoomid;
@SerializedName("drpk_time")
private String drpkTime;
@SerializedName("pk_top_users")
private PkTopUsersModel pkTopUsers;
public String getPkuid() {
return pkuid;
}
public PkinfoModel setPkuid(String pkuid) {
this.pkuid = pkuid;
return this;
}
public String getPkuname() {
return pkuname;
}
public PkinfoModel setPkuname(String pkuname) {
this.pkuname = pkuname;
return this;
}
public String getPkuimg() {
return pkuimg;
}
public PkinfoModel setPkuimg(String pkuimg) {
this.pkuimg = pkuimg;
return this;
}
public String getPkpull() {
return pkpull;
}
public PkinfoModel setPkpull(String pkpull) {
this.pkpull = pkpull;
return this;
}
public String getIfpk() {
return ifpk;
}
public PkinfoModel setIfpk(String ifpk) {
this.ifpk = ifpk;
return this;
}
public String getPkTime() {
return pkTime;
}
public PkinfoModel setPkTime(String pkTime) {
this.pkTime = pkTime;
return this;
}
public String getEndPkTime() {
return endPkTime;
}
public PkinfoModel setEndPkTime(String endPkTime) {
this.endPkTime = endPkTime;
return this;
}
public String getPkGiftLiveuid() {
return pkGiftLiveuid;
}
public PkinfoModel setPkGiftLiveuid(String pkGiftLiveuid) {
this.pkGiftLiveuid = pkGiftLiveuid;
return this;
}
public String getPkGiftPkuid() {
return pkGiftPkuid;
}
public PkinfoModel setPkGiftPkuid(String pkGiftPkuid) {
this.pkGiftPkuid = pkGiftPkuid;
return this;
}
public String getAnyway() {
return anyway;
}
public PkinfoModel setAnyway(String anyway) {
this.anyway = anyway;
return this;
}
public String getDrpkStatus() {
return drpkStatus;
}
public PkinfoModel setDrpkStatus(String drpkStatus) {
this.drpkStatus = drpkStatus;
return this;
}
public String getDrpkRoomid() {
return drpkRoomid;
}
public PkinfoModel setDrpkRoomid(String drpkRoomid) {
this.drpkRoomid = drpkRoomid;
return this;
}
public String getDrpkTime() {
return drpkTime;
}
public PkinfoModel setDrpkTime(String drpkTime) {
this.drpkTime = drpkTime;
return this;
}
public PkTopUsersModel getPkTopUsers() {
return pkTopUsers;
}
public PkinfoModel setPkTopUsers(PkTopUsersModel pkTopUsers) {
this.pkTopUsers = pkTopUsers;
return this;
}
}

View File

@ -0,0 +1,61 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class RankHourModel extends BaseModel {
@SerializedName("liveuid")
private String liveuid;
@SerializedName("hourchart_h5_url")
private String hourchartH5Url;
@SerializedName("rank")
private String rank;
@SerializedName("starlightVal")
private String starlightVal;
@SerializedName("isshow")
private String isshow;
public String getLiveuid() {
return liveuid;
}
public RankHourModel setLiveuid(String liveuid) {
this.liveuid = liveuid;
return this;
}
public String getHourchartH5Url() {
return hourchartH5Url;
}
public RankHourModel setHourchartH5Url(String hourchartH5Url) {
this.hourchartH5Url = hourchartH5Url;
return this;
}
public String getRank() {
return rank;
}
public RankHourModel setRank(String rank) {
this.rank = rank;
return this;
}
public String getStarlightVal() {
return starlightVal;
}
public RankHourModel setStarlightVal(String starlightVal) {
this.starlightVal = starlightVal;
return this;
}
public String getIsshow() {
return isshow;
}
public RankHourModel setIsshow(String isshow) {
this.isshow = isshow;
return this;
}
}

View File

@ -0,0 +1,30 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class WishListModel extends BaseModel {
@SerializedName("wishList")
private List<WishModel> wishList;
@SerializedName("img")
private String img;
public List<WishModel> getWishList() {
return wishList;
}
public WishListModel setWishList(List<WishModel> wishList) {
this.wishList = wishList;
return this;
}
public String getImg() {
return img;
}
public WishListModel setImg(String img) {
this.img = img;
return this;
}
}

View File

@ -0,0 +1,106 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
public class WishModel extends BaseModel {
@SerializedName("id")
private String id;
@SerializedName("dtime")
private String dtime;
@SerializedName("luid")
private String luid;
@SerializedName("lid")
private String lid;
@SerializedName("wishlist_icon")
private String wishlistIcon;
@SerializedName("wishlist_num")
private String wishlistNum;
@SerializedName("wishlist_progress")
private String wishlistProgress;
@SerializedName("wishlist_name")
private String wishlistName;
@SerializedName("create_time")
private String createTime;
public String getId() {
return id;
}
public WishModel setId(String id) {
this.id = id;
return this;
}
public String getDtime() {
return dtime;
}
public WishModel setDtime(String dtime) {
this.dtime = dtime;
return this;
}
public String getLuid() {
return luid;
}
public WishModel setLuid(String luid) {
this.luid = luid;
return this;
}
public String getLid() {
return lid;
}
public WishModel setLid(String lid) {
this.lid = lid;
return this;
}
public String getWishlistIcon() {
return wishlistIcon;
}
public WishModel setWishlistIcon(String wishlistIcon) {
this.wishlistIcon = wishlistIcon;
return this;
}
public String getWishlistNum() {
return wishlistNum;
}
public WishModel setWishlistNum(String wishlistNum) {
this.wishlistNum = wishlistNum;
return this;
}
public String getWishlistProgress() {
return wishlistProgress;
}
public WishModel setWishlistProgress(String wishlistProgress) {
this.wishlistProgress = wishlistProgress;
return this;
}
public String getWishlistName() {
return wishlistName;
}
public WishModel setWishlistName(String wishlistName) {
this.wishlistName = wishlistName;
return this;
}
public String getCreateTime() {
return createTime;
}
public WishModel setCreateTime(String createTime) {
this.createTime = createTime;
return this;
}
}

View File

@ -3,8 +3,10 @@ package com.yunbao.common.http;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.ContributeModel; import com.yunbao.common.bean.ContributeModel;
import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.FaceBookUpModel;
import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
@ -268,17 +270,58 @@ public interface PDLiveApi {
* PK排位赛接口 * PK排位赛接口
*/ */
@GET("/api/public/?service=Ranking.getAnchorRankData") @GET("/api/public/?service=Ranking.getAnchorRankData")
Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId,@Query("anchor_id2")String pkUid); /** Observable<ResponseModel<PkRankBean>> getPkRanksList(@Query("anchor_id") String anchorId, @Query("anchor_id2") String pkUid);
/**
* PK排位赛接口 * PK排位赛接口
*/ */
@GET("/api/public/?service=Live.createDrLm") @GET("/api/public/?service=Live.createDrLm")
Observable<ResponseModel<BaseModel>> createDrLm(); Observable<ResponseModel<BaseModel>> createDrLm();
/* PK排位赛接口 /* PK排位赛接口
*/ */
@GET("/api/public/?service=Live.delDrLm") @GET("/api/public/?service=Live.delDrLm")
Observable<ResponseModel<BaseModel>> delDrLm(); Observable<ResponseModel<BaseModel>> delDrLm();
/* PK排位赛接口 /* PK排位赛接口
*/ */
@GET("/api/public/?service=Live.killDrLm") @GET("/api/public/?service=Live.killDrLm")
Observable<ResponseModel<BaseModel>> killDrLm(@Query("uid") String uid, @Query("roomid") String roomId); Observable<ResponseModel<BaseModel>> killDrLm(@Query("uid") String uid, @Query("roomid") String roomId);
/**
* 新进入房间接口
*
* @param groupId 房间名 g+liveUid
* @param stream
* @param liveUid
* @param city
* @return
*/
@GET("/api/public/?service=Live.enterRoomNew")
Observable<ResponseModel<EnterRoomNewModel>> enterRoomNew(
@Query("GroupId") String groupId,
@Query("stream") String stream,
@Query("liveuid") String liveUid,
@Query("city") String city
);
/**
* 检查直播间状态
*
* @return
*/
@GET("/api/public/?service=Live.checkLive")
Observable<ResponseModel<List<CheckLiveModel>>> checkLive(
@Query("liveuid") String liveUid,
@Query("stream") String stream
);
/**
* 加入房间推送Im欢迎语
*/
@GET("/api/public/?service=Tx.userJoinRoomNew")
Observable<ResponseModel<String>> userJoinRoomNew(
@Query("GroupId") String GroupId,
@Query("stream") String stream
);
} }

View File

@ -0,0 +1,30 @@
package com.yunbao.common.http.base;
import com.yunbao.common.bean.CheckLiveModel;
/**
* 直播间类型返回
*/
public interface CheckLiveCallBack {
/**
* 普通房
*/
void forwardNormalRoom(CheckLiveModel model);
/**
* 密码房
*/
void forwardPwdRoom(CheckLiveModel model);
/**
* 收费房
*/
void forwardPayRoom(CheckLiveModel model);
/**
* 请求失败
*
* @param error
*/
void onError(String error);
}

View File

@ -3,10 +3,13 @@ package com.yunbao.common.http.live;
import android.content.Context; import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import com.yunbao.common.Constants;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.CustomSidebarInfoModel;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleRankHideUserListModel;
@ -16,11 +19,11 @@ import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.VipModel; import com.yunbao.common.bean.VipModel;
import com.yunbao.common.http.API; import com.yunbao.common.http.API;
import com.yunbao.common.http.ResponseModel; import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.http.base.CheckLiveCallBack;
import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.base.HttpCallback;
import java.util.List; import java.util.List;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
@ -291,4 +294,116 @@ public class LiveNetManager {
} }
}, throwable -> callback.onError(throwable.getMessage())).isDisposed(); }, throwable -> callback.onError(throwable.getMessage())).isDisposed();
} }
/**
* 检查直播间状态
*
* @param liveUid
* @param stream
* @param callBack
*/
public void checkLive(String liveUid, String stream, CheckLiveCallBack callBack) {
API.get().pdLiveApi(mContext)
.checkLive(liveUid, stream)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<CheckLiveModel>>>() {
@Override
public void accept(ResponseModel<List<CheckLiveModel>> listResponseModel) throws Exception {
if (listResponseModel.getData().getCode() == 0) {
List<CheckLiveModel> checkLiveModels = listResponseModel.getData().getInfo();
if (checkLiveModels.size() > 0) {
CheckLiveModel liveModel = checkLiveModels.get(0);
switch (liveModel.getType()) {
case Constants.LIVE_TYPE_NORMAL:
if (callBack != null) {
callBack.forwardNormalRoom(liveModel);
}
break;
case Constants.LIVE_TYPE_PWD:
if (callBack != null) {
callBack.forwardPwdRoom(liveModel);
}
break;
case Constants.LIVE_TYPE_PAY:
case Constants.LIVE_TYPE_TIME:
if (callBack != null) {
callBack.forwardPayRoom(liveModel);
}
break;
}
} else {
if (callBack != null) {
callBack.onError(listResponseModel.getData().getMsg());
}
}
} else {
if (callBack != null) {
callBack.onError(listResponseModel.getData().getMsg());
}
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callBack != null) {
callBack.onError(throwable.getMessage());
}
}
}).isDisposed();
}
/**
* 新进入直播间接口
*
* @param stream
* @param liveUid
* @param city
* @param callback
*/
public void enterRoomNew(String stream, String liveUid, String city, HttpCallback<EnterRoomNewModel> callback) {
API.get().pdLiveApi(mContext)
.enterRoomNew("g" + liveUid, stream, liveUid, city)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<EnterRoomNewModel>>() {
@Override
public void accept(ResponseModel<EnterRoomNewModel> enterRoomNewModelResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(enterRoomNewModelResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}
}).isDisposed();
}
/**
* 加入房间推送IM消息
*
* @param stream
* @param liveUid
*/
public void userJoinRoomNew(String stream, String liveUid) {
API.get().pdLiveApi(mContext)
.userJoinRoomNew("g" + liveUid, stream)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<String>>() {
@Override
public void accept(ResponseModel<String> stringResponseModel) throws Exception {
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
}
}).isDisposed();
}
} }

View File

@ -186,6 +186,7 @@ public class RouteUtil {
*/ */
public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) { public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
ARouter.getInstance().build(PATH_LIVE_AUDIENCE) ARouter.getInstance().build(PATH_LIVE_AUDIENCE)
.withBoolean(Constants.NEW_ENTER_ROOM, false)
.withParcelable(Constants.LIVE_BEAN, mLiveBean) .withParcelable(Constants.LIVE_BEAN, mLiveBean)
.withInt(Constants.LIVE_TYPE, mLiveType) .withInt(Constants.LIVE_TYPE, mLiveType)
.withInt(Constants.LIVE_SDK, mLiveSDK) .withInt(Constants.LIVE_SDK, mLiveSDK)
@ -193,6 +194,8 @@ public class RouteUtil {
.navigation(); .navigation();
} }
/** /**
* 举报个人 * 举报个人
*/ */

View File

@ -10,9 +10,9 @@ ext {
manifestPlaceholders = [ manifestPlaceholders = [
// //
serverHost : "https://napi.yaoulive.com", // serverHost : "https://napi.yaoulive.com",
// //
// serverHost : "https://ceshi.yaoulive.com", serverHost : "https://ceshi.yaoulive.com",
// //
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -51,7 +51,7 @@ import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.live.dialog.GiftPrizePoolFragment; import com.yunbao.live.dialog.GiftPrizePoolFragment;
import com.yunbao.live.dialog.LiveChatRoomDialogFragment; import com.yunbao.live.dialog.LiveChatRoomDialogFragment;
import com.yunbao.live.dialog.LiveFansFragment; import com.yunbao.live.dialog.LiveFansFragment;

View File

@ -170,15 +170,14 @@ public class LiveAudienceActivity extends LiveActivity {
L.e(TAG, "直播sdk----->" + (mLiveSDK == Constants.LIVE_SDK_KSY ? "金山云" : "腾讯云")); L.e(TAG, "直播sdk----->" + (mLiveSDK == Constants.LIVE_SDK_KSY ? "金山云" : "腾讯云"));
mLiveType = intent.getIntExtra(Constants.LIVE_TYPE, Constants.LIVE_TYPE_NORMAL); mLiveType = intent.getIntExtra(Constants.LIVE_TYPE, Constants.LIVE_TYPE_NORMAL);
mLiveTypeVal = intent.getIntExtra(Constants.LIVE_TYPE_VAL, 0); mLiveTypeVal = intent.getIntExtra(Constants.LIVE_TYPE_VAL, 0);
initView();
setVolumeControlStream(AudioManager.STREAM_MUSIC);
manager = new PortraitLiveManager(this, intent);
mLiveBean = intent.getParcelableExtra(Constants.LIVE_BEAN); mLiveBean = intent.getParcelableExtra(Constants.LIVE_BEAN);
mLiveUid = mLiveBean.getUid(); mLiveUid = mLiveBean.getUid();
mStream = mLiveBean.getStream(); mStream = mLiveBean.getStream();
setVolumeControlStream(AudioManager.STREAM_MUSIC);
manager = new PortraitLiveManager(this, intent);
initView();
initData(); initData();
} }
/** /**
* 初始化界面 * 初始化界面
*/ */
@ -303,37 +302,26 @@ public class LiveAudienceActivity extends LiveActivity {
private Runnable liveRunnable = new Runnable() { private Runnable liveRunnable = new Runnable() {
@Override @Override
public void run() { public void run() {
AnchorRecommendItemModel data = itemModelList.get(mCurrentPage); AnchorRecommendItemModel data = itemModelList.get(mCurrentPage);
new LiveRoomCheckLivePresenter(mContext, data.getUid(), data.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
//获取直播间状态
LiveHttpUtil.getLiveInfo(data.getUid(), liveInfo);
}
};
/**
* 获取直播间状态
*/
private HttpCallback liveInfo = new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); try {
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> { mLiveSDK = Integer.parseInt(liveSdk);
//主播正在直播 mLiveTypeVal = Integer.parseInt(liveTypeVal);
if (liveBean1 == null) { } catch (NumberFormatException e) {
return; mLiveSDK = 0;
mLiveTypeVal = 0;
} }
runOnUiThread(() -> {
mLiveSDK = liveSdk;
mLiveType = liveType; mLiveType = liveType;
mLiveTypeVal = liveTypeVal; String json = GsonUtils.toJson(data);
mLiveBean = liveBean1; mLiveBean = GsonUtils.fromJson(json, LiveBean.class);
mLiveUid = liveBean1.getUid(); mLiveBean.setUserNiceName(data.getUserNicename());
mStream = liveBean1.getStream(); mLiveUid = mLiveBean.getUid();
mAncherName = liveBean1.getUserNiceName(); mStream = mLiveBean.getStream();
mAncherIcon = liveBean1.getAvatar(); mAncherName = mLiveBean.getUserNiceName();
mAncherIcon = mLiveBean.getAvatar();
Log.e(TAG, "mLiveUid--------------------------->" + mLiveUid); Log.e(TAG, "mLiveUid--------------------------->" + mLiveUid);
//加载当前页面数据 //加载当前页面数据
View rootView = manager.getRootView(); View rootView = manager.getRootView();
@ -343,23 +331,64 @@ public class LiveAudienceActivity extends LiveActivity {
} }
mViewGroup.addView(manager.getRootView()); mViewGroup.addView(manager.getRootView());
manager.onAdd(liveBean1, liveType, liveTypeVal, liveSdk); manager.onAdd(mLiveBean, liveType, mLiveTypeVal, mLiveSDK);
//加载完页面后再后台静默下载礼物svga //加载完页面后再后台静默下载礼物svga
downloadAllGift(); downloadAllGift();
over(); over();
});
});
mCheckLivePresenter.checkLive(liveBean);
} else {
//主播未直播时自动下滑至下一个直播间
verticalViewPager.setCurrentItem(mCurrentPage + 1);
} }
});
} }
}; };
/**
* 获取直播间状态
*/
// private HttpCallback liveInfo = new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 0 && info.length > 0) {
// LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
// LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
// //主播正在直播
// if (liveBean1 == null) {
// return;
// }
// runOnUiThread(() -> {
// mLiveSDK = liveSdk;
// mLiveType = liveType;
// mLiveTypeVal = liveTypeVal;
// mLiveBean = liveBean1;
// mLiveUid = liveBean1.getUid();
// mStream = liveBean1.getStream();
// mAncherName = liveBean1.getUserNiceName();
// mAncherIcon = liveBean1.getAvatar();
// Log.e(TAG, "mLiveUid--------------------------->" + mLiveUid);
// //加载当前页面数据
// View rootView = manager.getRootView();
// if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) {
// ((ViewGroup) (rootView.getParent())).removeView(rootView);
// manager.onRemove(false);
// }
// mViewGroup.addView(manager.getRootView());
//
// manager.onAdd(liveBean1, liveType, liveTypeVal, liveSdk);
// //加载完页面后再后台静默下载礼物svga
// downloadAllGift();
// over();
// });
//
//
// });
//
// mCheckLivePresenter.checkLive(liveBean);
// } else {
// //主播未直播时自动下滑至下一个直播间
// verticalViewPager.setCurrentItem(mCurrentPage + 1);
// }
// }
// };
private void over() { private void over() {
if ("NEWUSER".equals(getIntent().getStringExtra("OPEN"))) { if ("NEWUSER".equals(getIntent().getStringExtra("OPEN"))) {
Intent intent = getIntent(); Intent intent = getIntent();
@ -529,28 +558,38 @@ public class LiveAudienceActivity extends LiveActivity {
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
if (manager != null) {
manager.onPause(); manager.onPause();
}
GiftCacheUtil.getInstance().pause(); GiftCacheUtil.getInstance().pause();
} }
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
if (manager != null) {
manager.onStop(); manager.onStop();
} }
}
/** /**
* 点亮 * 点亮
*/ */
public void light() { public void light() {
if (manager != null) {
manager.light(); manager.light();
} }
}
/** /**
* 计时收费更新主播映票数 * 计时收费更新主播映票数
*/ */
public void roomChargeUpdateVotes() { public void roomChargeUpdateVotes() {
if (manager != null)
manager.sendUpdateVotesMessage(); manager.sendUpdateVotesMessage();
} }
@ -558,6 +597,7 @@ public class LiveAudienceActivity extends LiveActivity {
* 暂停播放 * 暂停播放
*/ */
public void pausePlay() { public void pausePlay() {
if (manager != null)
manager.pausePlay(); manager.pausePlay();
} }
@ -565,6 +605,7 @@ public class LiveAudienceActivity extends LiveActivity {
* 恢复播放 * 恢复播放
*/ */
public void resumePlay() { public void resumePlay() {
if (manager != null)
manager.resumePlay(); manager.resumePlay();
} }
@ -576,6 +617,7 @@ public class LiveAudienceActivity extends LiveActivity {
* 充值成功 * 充值成功
*/ */
public void onChargeSuccess() { public void onChargeSuccess() {
if (manager != null)
manager.onChargeSuccess(); manager.onChargeSuccess();
} }
@ -663,7 +705,9 @@ public class LiveAudienceActivity extends LiveActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (manager != null) {
manager.onResume(); manager.onResume();
}
GiftCacheUtil.getInstance().restart(); GiftCacheUtil.getInstance().restart();
} }
@ -732,7 +776,7 @@ public class LiveAudienceActivity extends LiveActivity {
@Override @Override
public void goToLive(AnchorRecommendItemModel model) { public void goToLive(AnchorRecommendItemModel model) {
//获取直播间状态 //获取直播间状态
LiveHttpUtil.getLiveInfo(model.getUid(), liveInfo); // LiveHttpUtil.getLiveInfo(model.getUid(), liveInfo);
customDrawerPopupView.dismiss(); customDrawerPopupView.dismiss();
} }

View File

@ -65,7 +65,7 @@ import com.yunbao.live.R;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.live.bean.MicUserBean; import com.yunbao.live.bean.MicUserBean;
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment; import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveMicAnchorDialogFragment; import com.yunbao.live.dialog.LiveMicAnchorDialogFragment;

View File

@ -24,7 +24,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;

View File

@ -35,7 +35,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.live.dialog.LiveUserMoreDialogFragment; import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
import com.yunbao.live.utils.LiveTextRender; import com.yunbao.live.utils.LiveTextRender;

View File

@ -1,5 +1,7 @@
package com.yunbao.live.bean; package com.yunbao.live.bean;
import com.yunbao.common.bean.LiveUserGiftBean;
/** /**
* Created by cxf on 2018/10/12. * Created by cxf on 2018/10/12.
*/ */

View File

@ -31,7 +31,7 @@ import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.adapter.AnchorUserMicInfoAdapter; import com.yunbao.live.adapter.AnchorUserMicInfoAdapter;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.live.bean.MicUserBean; import com.yunbao.live.bean.MicUserBean;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.utils.LiveImDeletUtil; import com.yunbao.live.utils.LiveImDeletUtil;

View File

@ -38,7 +38,7 @@ import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.adapter.UserMoreInfoAdapter; import com.yunbao.live.adapter.UserMoreInfoAdapter;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -9,14 +9,17 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.CheckLiveModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.base.CheckLiveCallBack;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
@ -37,6 +40,83 @@ public class LiveRoomCheckLivePresenter {
//搜索页面不提示密码 //搜索页面不提示密码
public static boolean isRoom = false; public static boolean isRoom = false;
/**
* 新的检查直播间状态方法
*
* @param context 上下文
* @param liveUid 直播间ID
* @param stream
*/
public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) {
LiveNetManager.get(context)
.checkLive(liveUid, stream, new CheckLiveCallBack() {
@Override
public void forwardNormalRoom(CheckLiveModel model) {
if (actionListener != null) {
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
}
}
@Override
public void forwardPwdRoom(CheckLiveModel model) {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() {
@Override
public void onCancelClick() {
if (mContext instanceof Activity) {
((Activity) mContext).finish();
}
}
@Override
public void onConfirmClick(Dialog dialog, String content) {
if (TextUtils.isEmpty(content)) {
ToastUtil.show(WordUtil.getString(R.string.live_input_password));
return;
}
String password = MD5Util.getMD5(content);
if (mLiveTypeMsg.equalsIgnoreCase(password)) {
dialog.dismiss();
if (actionListener != null) {
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
}
} else {
ToastUtil.show(WordUtil.getString(R.string.live_password_error));
}
}
});
}
@Override
public void forwardPayRoom(CheckLiveModel model) {
DialogUitl.showSimpleDialog(mContext, mLiveTypeMsg, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
LiveHttpUtil.roomCharge(liveUid, stream, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0) {
if (actionListener != null) {
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
}
} else {
ToastUtil.show(msg);
}
}
});
}
});
}
@Override
public void onError(String error) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_ROOM_EXCEPTION));
ToastUtil.show(error);
}
});
}
public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) { public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) {
mContext = context; mContext = context;
mActionListener = actionListener; mActionListener = actionListener;
@ -194,4 +274,8 @@ public class LiveRoomCheckLivePresenter {
public interface ActionListener { public interface ActionListener {
void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk); void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk);
} }
public interface NewActionListener {
void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk);
}
} }

View File

@ -32,7 +32,7 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.live.presenter.LiveLinkMicPkPresenter; import com.yunbao.live.presenter.LiveLinkMicPkPresenter;
import com.yunbao.live.views.LivePlayKsyViewHolder; import com.yunbao.live.views.LivePlayKsyViewHolder;
import com.yunbao.live.views.LivePushTxViewHolder; import com.yunbao.live.views.LivePushTxViewHolder;

View File

@ -10,7 +10,7 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import java.util.List; import java.util.List;

View File

@ -19,12 +19,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.reflect.TypeToken;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.AiAutomaticSpeechModel;
import com.yunbao.common.bean.FansMedalBean; import com.yunbao.common.bean.FansMedalBean;
import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LinkMicUserBean;
import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.SocketModel; import com.yunbao.common.bean.SocketModel;
@ -47,7 +49,6 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean;
import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.views.LiveEndViewHolder; import com.yunbao.live.views.LiveEndViewHolder;
import com.yunbao.live.views.LivePlayKsyViewHolder; import com.yunbao.live.views.LivePlayKsyViewHolder;
@ -199,7 +200,8 @@ public class SocketRyClient {
mListener.onUpUserList(map.getJSONObject("ct")); mListener.onUpUserList(map.getJSONObject("ct"));
EventBus.getDefault().post(new LiveAudienceEvent() EventBus.getDefault().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_AUDIENCE_LIST) .setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_AUDIENCE_LIST)
.setObject(JSON.parseArray(map.getJSONObject("ct").getString("userlist"), LiveUserGiftBean.class)) .setObject( GsonUtils.fromJson(map.getJSONObject("ct").getString("userlist"), new TypeToken<List<LiveUserGiftBean>>() {
}.getType()))
); );
break; break;
case Constants.CARD: case Constants.CARD:
@ -708,7 +710,7 @@ public class SocketRyClient {
mListener.onChat(chatBean, 1); mListener.onChat(chatBean, 1);
} else if ("0".equals(msgtype)) {//用户进入房间 } else if ("0".equals(msgtype)) {//用户进入房间
JSONObject obj = JSON.parseObject(map.getString("ct")); JSONObject obj = JSON.parseObject(map.getString("ct"));
LiveUserGiftBean u = JSON.toJavaObject(obj, LiveUserGiftBean.class); LiveUserGiftBean u = GsonUtils.fromJson(obj.toJSONString(), LiveUserGiftBean.class);
UserBean.Vip vip = new UserBean.Vip(); UserBean.Vip vip = new UserBean.Vip();
int vipType = obj.getIntValue("vip_type"); int vipType = obj.getIntValue("vip_type");
vip.setType(vipType); vip.setType(vipType);
@ -751,6 +753,7 @@ public class SocketRyClient {
chatBean.setBubbleSrc(obj.getString("bubbleSrc"));//氣泡 chatBean.setBubbleSrc(obj.getString("bubbleSrc"));//氣泡
//增加粉丝徽章信息 //增加粉丝徽章信息
chatBean.setMedalNmae(obj.getString("medal_name")); chatBean.setMedalNmae(obj.getString("medal_name"));
chatBean.setUserNiceName(obj.getString("user_nicename"));//名字
FansMedalBean fansMedalBean = CommonAppConfig.getInstance().getAnchorFansMedal(obj.getIntValue("medal_level")); FansMedalBean fansMedalBean = CommonAppConfig.getInstance().getAnchorFansMedal(obj.getIntValue("medal_level"));
if (fansMedalBean != null) if (fansMedalBean != null)
chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb()); chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());

View File

@ -39,6 +39,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.load.engine.GlideException;
@ -46,6 +47,7 @@ import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.target.Target;
import com.google.gson.reflect.TypeToken;
import com.makeramen.roundedimageview.RoundedImageView; import com.makeramen.roundedimageview.RoundedImageView;
import com.ms.banner.Banner; import com.ms.banner.Banner;
import com.ms.banner.BannerConfig; import com.ms.banner.BannerConfig;
@ -59,14 +61,18 @@ import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.AiAutomaticSpeechModel;
import com.yunbao.common.bean.BannerBean; import com.yunbao.common.bean.BannerBean;
import com.yunbao.common.bean.GuardUserModel;
import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LevelBean; import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.NewLevelModel;
import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.RankHourModel;
import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
@ -112,7 +118,6 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean;
import com.yunbao.live.bean.LiveWishlistBean; import com.yunbao.live.bean.LiveWishlistBean;
import com.yunbao.live.bean.WishlistItemModel; import com.yunbao.live.bean.WishlistItemModel;
import com.yunbao.live.custom.LiveLightView; import com.yunbao.live.custom.LiveLightView;
@ -313,6 +318,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private TextView mRedVal, mBlueVal; private TextView mRedVal, mBlueVal;
private String pkUid = ""; private String pkUid = "";
//接口整合新加参数
private GuardUserModel guardUserModel;
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) { public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
super(context, parentView); super(context, parentView);
Contexts = context; Contexts = context;
@ -1145,8 +1153,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
msgLayout.setVisibility(View.GONE); msgLayout.setVisibility(View.GONE);
} }
public void addWishList(BannerBean bannerModel) { /**
mBannerList2.add(bannerModel); * 添加心愿单轮播he活动
*/
public void addWishListActivity(List<BannerBean> bannerModels) {
mBannerList2.addAll(bannerModels);
if (mBanner2.isStart()) { if (mBanner2.isStart()) {
mBanner2.update(mBannerList2); mBanner2.update(mBannerList2);
} else { } else {
@ -1476,6 +1487,49 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}); });
} }
public void initHourRank(RankHourModel model) {
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5);
View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
ImageView hotPic = hotView.findViewById(R.id.wish_pic);
ImageView hourPic = hourView.findViewById(R.id.wish_pic);
mHotText = hotView.findViewById(R.id.wish_index);
mHourRank = hourView.findViewById(R.id.wish_index);
mHotText.setText("0");
mHotText.setLayoutParams(textParams);
mHourRank.setLayoutParams(textParams);
mHotText.setGravity(Gravity.CENTER);
mHourRank.setGravity(Gravity.CENTER);
setHourRankData(Long.parseLong(model.getRank()));
hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en);
hourPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hour_list : R.drawable.live_tags_hour_list_en);
hotPic.setLayoutParams(params);
hourPic.setLayoutParams(params);
flipper.addView(hotView);
flipper.addView(hourView);
flipper.startFlipping();
flipper.setOnClickListener(view -> {
Bundle bundle = new Bundle();
String path = model.getHourchartH5Url();
if (!path.startsWith("/")) {
path = "/" + path;
}
String url = CommonAppConfig.HOST + path;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url);
bundle.putInt("height", DpUtil.dp2px(500));
bundle.putInt("show_type", 0);
bundle.putString("roomId", mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
});
}
/** /**
* 初始化小时榜 * 初始化小时榜
*/ */
@ -2068,6 +2122,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
} }
/**
* 接口整合守护展示
*
* @param model
*/
public void setGuardIcon(GuardUserModel model) {
if (model != null && !TextUtils.isEmpty(model.getGuardUserAvatar())) {
guardUserModel = model;
ViewGroup.LayoutParams params = userGuard.getLayoutParams();
params.height = DpUtil.dp2px(30);
params.width = DpUtil.dp2px(30);
userGuard.setLayoutParams(params);
ImgLoader.displayAvatar(mContext, model.getGuardUserAvatar(), userGuard);
gift_svga.setVisibility(View.VISIBLE);
}
}
/** /**
* 守护信息发生变化 * 守护信息发生变化
@ -2403,7 +2474,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 刷新用户列表 * 刷新用户列表
*/ */
public void refreshUserList(JSONObject obj) { public void refreshUserList(JSONObject obj) {
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlist"), LiveUserGiftBean.class); List<LiveUserGiftBean> list = GsonUtils.fromJson(obj.getString("userlist"), new TypeToken<List<LiveUserGiftBean>>() {
}.getType());
mLiveUserAdapter.refreshList(list); mLiveUserAdapter.refreshList(list);
} }

View File

@ -34,7 +34,10 @@ import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.AiAutomaticSpeechModel;
import com.yunbao.common.bean.BannerBean; import com.yunbao.common.bean.BannerBean;
import com.yunbao.common.bean.EnterRoomNewModel;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveRoomActivityModel;
import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
@ -46,6 +49,7 @@ import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
@ -67,9 +71,7 @@ import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean;
import com.yunbao.live.bean.OpenParametersModel; import com.yunbao.live.bean.OpenParametersModel;
import com.yunbao.live.bean.WishlistModel;
import com.yunbao.live.dialog.BlowkissDialog; import com.yunbao.live.dialog.BlowkissDialog;
import com.yunbao.live.dialog.NewUserDialog; import com.yunbao.live.dialog.NewUserDialog;
import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LinkMicTxAccEvent;
@ -275,44 +277,251 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.clearGuardIcon(); mLiveRoomViewHolder.clearGuardIcon();
mLiveRoomViewHolder.releaseGift(); mLiveRoomViewHolder.releaseGift();
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), ""); mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
mLiveRoomViewHolder.setLiveUid(data.getUid());
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this); mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this);
if (mLiveLinkMicPresenter != null) { if (mLiveLinkMicPresenter != null) {
mLiveLinkMicPresenter.setSocketClient(mSocketClient); mLiveLinkMicPresenter.setSocketClient(mSocketClient);
} }
//心愿单 enterRoomNew();
LiveHttpUtil.getWishList(mLiveBean.getUid(), new HttpCallback() { }
});
}
private void enterRoom() {
//进入直播间IM
timeIndex = 0;
LiveHttpUtil.enterRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (info.length > 0) { isEnterRoom = true;
String json = info[0]; if (code == 0 && info.length > 0) {
WishlistModel model = GsonUtils.fromJson(json, WishlistModel.class); JSONObject obj = JSON.parseObject(info[0]);
if (mLiveRoomViewHolder != null && model != null && model.getWishlist().size() > 0) {
//连接socket
LiveHttpUtil.enterBackRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
//链接上socket以后隐藏Loading加载直播间内容
}
});
if (mLiveRoomViewHolder != null) {
LivePlayKsyViewHolder.setLandscape(obj.getIntValue("landscape"));
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), obj.getIntValue("userlist_time") * 4000);
mLiveRoomViewHolder.setFastMessage(greetings);
mLiveRoomViewHolder.setVotes(obj.getString("votestotal"));
//真爱排行 数量
mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum"));
isattention = obj.getIntValue("isattention");
if (isattention == 0) {
if (countDownTimer != null) {
countDownTimer.cancel();
timeIndex = 0;
countDownTimer = null;
setTime();
} else {
setTime();
}
} else {
if (countDownTimer != null) {
countDownTimer.cancel();
countDownTimer = null;
}
}
mLiveAudienceViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), mLiveBean.getAvatar(), isattention);
mLiveRoomViewHolder.setAttention(isattention);
if (obj.containsKey("lminfo")) {
JSONObject mic_data = obj.getJSONObject("lminfo");
if (mic_data.containsKey("userlist")) {
mLiveRoomViewHolder.updataMicList(mic_data.getJSONArray("userlist"));
}
}
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlists"), LiveUserGiftBean.class);
mLiveRoomViewHolder.setUserList(list);
// resetUserListWidth(list);
mLiveRoomViewHolder.startRefreshUserList();
if (mLiveType == Constants.LIVE_TYPE_TIME) {//计时收费
mLiveRoomViewHolder.startRequestTimeCharge();
}
}
if (leave == 1) {
if (LivePlayRyViewHolder.leave != null) {
LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE);
}
}
//判断是否有连麦要显示连麦窗口
String linkMicUid = obj.getString("linkmic_uid");
String linkMicPull = obj.getString("linkmic_pull");
if (!TextUtils.isEmpty(linkMicUid) && !"0".equals(linkMicUid) && !TextUtils.isEmpty(linkMicPull)) {
if (mLiveSDK != Constants.LIVE_SDK_TX && mLiveLinkMicPresenter != null) {
mLiveLinkMicPresenter.onLinkMicPlay(linkMicUid, linkMicPull);
}
}
//判断是否有主播连麦
pkInfo = JSON.parseObject(obj.getString("pkinfo"));
if (pkInfo != null && pkInfo.getIntValue("drpk_status") != 1) {
String pkUid = pkInfo.getString("pkuid");
anyway = "1";
if (!TextUtils.isEmpty(pkUid) && !"0".equals(pkUid) && anyway.equals("0")) {
if (mLiveSDK != Constants.LIVE_SDK_TX) {
String pkPull = pkInfo.getString("pkpull");
if (!TextUtils.isEmpty(pkPull) && mLiveLinkMicAnchorPresenter != null) {
mLiveLinkMicAnchorPresenter.onLinkMicAnchorPlayUrl(pkUid, pkPull);
}
} else {
if (mLivePlayViewHolder instanceof LivePlayTxViewHolder) {
((LivePlayTxViewHolder) mLivePlayViewHolder).setAnchorLinkMic(true, 0);
}
}
}
if (obj.getString("isconnection") != null && obj.getString("isconnection").equals("1")) {
LivePlayRyViewHolder.setViewUP(1);
}
if (pkInfo.getIntValue("ifpk") == 1 && pkInfo.getString("end_pk_time").equals("0")) {//pk开始了
LivePlayRyViewHolder.setViewUP(2);
//pk排名数据
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname"));
}
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
LivePlayRyViewHolder.setViewUP(3);
//pk排名数据
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
}
//多人PK
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
LivePlayRyViewHolder.setViewUP(4);
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
}
//守护相关
mLiveGuardInfo = new LiveGuardInfo();
int guardNum = obj.getIntValue("guard_nums");
fansNum = obj.getIntValue("count_fans");
is_fans = obj.getString("is_fans") + "";
mLiveGuardInfo.setGuardNum(guardNum);
JSONObject guardObj = obj.getJSONObject("guard");
if (guardObj != null) {
mLiveGuardInfo.setMyGuardType(guardObj.getIntValue("type"));
mLiveGuardInfo.setMyGuardEndTime(guardObj.getString("endtime"));
}
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(openParametersModel.setmLiveGuardInfo(mLiveGuardInfo)
.setFansNum(fansNum)
.setIs_fans(is_fans)));
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setGuardNum(guardNum);
mLiveRoomViewHolder.setFansNum(fansNum);
//红包相关
mLiveRoomViewHolder.setRedPackBtnVisible(obj.getIntValue("isred") == 1);
}
//奖池等级
int giftPrizePoolLevel = obj.getIntValue("jackpot_level");
if (giftPrizePoolLevel >= 0) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
}
}
}
}
});
}
/**
* 新进入房间接口
*/
private void enterRoomNew() {
LiveNetManager.get(mContext)
.enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() {
@Override
public void onSuccess(EnterRoomNewModel data) {
//小时榜
mLiveRoomViewHolder.initHourRank(data.getRankHour());
//守护
mLiveRoomViewHolder.setGuardIcon(data.getGuardUserAvatar());
//在线列表
mLiveRoomViewHolder.setUserList(data.getEnterRoomInfo().getUserlists());
List<BannerBean> bannerBeans = new ArrayList<>();
//心愿单
if (data.getWishList().getWishList().size() > 0) {
BannerBean bannerModel = new BannerBean(); BannerBean bannerModel = new BannerBean();
bannerModel.setShow_type("2"); bannerModel.setShow_type("2");
bannerModel.setLink(CommonAppConfig.HOST + "/index.php"); bannerModel.setLink(CommonAppConfig.HOST + "/index.php");
bannerModel.setImageUrl(data.getWishList().getImg());
bannerBeans.add(bannerModel);
}
//活动列表
if (data.getLiveRoomActivityModels().size() > 0) {
for (LiveRoomActivityModel model : data.getLiveRoomActivityModels()) {
BannerBean bannerModel = new BannerBean();
bannerModel.setShow_type(model.getShowType());
bannerModel.setStart(false);
bannerModel.setLink(model.getLink());
bannerModel.setImageUrl(model.getImg()); bannerModel.setImageUrl(model.getImg());
mLiveRoomViewHolder.addWishList(bannerModel); bannerBeans.add(bannerModel);
} }
} }
//底部轮播
mLiveRoomViewHolder.addWishListActivity(bannerBeans);
//直播间上部轮播新人特惠趣味游戏幸运天使 轮播接口
mLiveRoomViewHolder.showLiveRoomActivityBanner();
//兼容老接口数据
mDanmuPrice = data.getEnterRoomInfo().getBarrageFee();
mSocketUserType = Integer.parseInt(data.getEnterRoomInfo().getUsertype());
mChatLevel = Integer.parseInt(data.getEnterRoomInfo().getSpeakLimit());
mDanMuLevel = Integer.parseInt(data.getEnterRoomInfo().getBarrageLimit());
leave = Integer.parseInt(data.getEnterRoomInfo().getIsleave());
if (!data.getEnterRoomInfo().getGreetings().isEmpty()) {
greetings = data.getEnterRoomInfo().getGreetings();
}
if (!TextUtils.isEmpty(data.getEnterRoomInfo().getLiveBg())) {
if (liveBg == 0) {
//直播间背景
ImgLoader.display(mContext, R.mipmap.live_bg, liveBack);
mask.setVisibility(View.GONE);
}
} else {
liveBg = -1;
}
//回传参数
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(openParametersModel.setmDanmuPrice(mDanmuPrice)
.setmSocketUserType(mSocketUserType)
.setmChatLevel(mChatLevel)
.setmDanMuLevel(mDanMuLevel)
.setLiveBg(liveBg)));
//加入房间发送Im消息
LiveNetManager.get(mContext).userJoinRoomNew(mLiveBean.getStream(), mLiveBean.getUid());
} }
@Override @Override
public void onFinish() { public void onError(String error) {
ToastUtil.show(error);
//直播间上部轮播新人特惠趣味游戏幸运天使 轮播接口
}
});
enterRoom();
mLiveRoomViewHolder.initHourRankList();
mLiveRoomViewHolder.showLiveRoomActivityBanner(); mLiveRoomViewHolder.showLiveRoomActivityBanner();
} }
}); });
} }
public void removeLiveEnd() { public void removeLiveEnd() {
@ -1098,186 +1307,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}; };
private void enterRoom() {
//进入直播间IM
timeIndex = 0;
LiveHttpUtil.enterRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
isEnterRoom = true;
if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]);
mDanmuPrice = obj.getString("barrage_fee");
mSocketUserType = obj.getIntValue("usertype");
mChatLevel = obj.getIntValue("speak_limit");
mDanMuLevel = obj.getIntValue("barrage_limit");
liveBg = obj.getIntValue("live_bg");
leave = obj.getInteger("isleave");
if (obj.containsKey("greetings")) {
greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class);
}
if (obj.containsKey("live_bg")) {
if (liveBg == 0) {
//直播间背景
ImgLoader.display(mContext, R.mipmap.live_bg, liveBack);
mask.setVisibility(View.GONE);
}
}
//回传参数
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(openParametersModel.setmDanmuPrice(mDanmuPrice)
.setmSocketUserType(mSocketUserType)
.setmChatLevel(mChatLevel)
.setmDanMuLevel(mDanMuLevel)
.setLiveBg(liveBg)));
//连接socket
LiveHttpUtil.enterBackRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
//链接上socket以后隐藏Loading加载直播间内容
}
});
if (mLiveRoomViewHolder != null) {
LivePlayKsyViewHolder.setLandscape(obj.getIntValue("landscape"));
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), obj.getIntValue("userlist_time") * 4000);
mLiveRoomViewHolder.setFastMessage(greetings);
mLiveRoomViewHolder.setVotes(obj.getString("votestotal"));
//真爱排行 数量
mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum"));
isattention = obj.getIntValue("isattention");
if (isattention == 0) {
if (countDownTimer != null) {
countDownTimer.cancel();
timeIndex = 0;
countDownTimer = null;
setTime();
} else {
setTime();
}
} else {
if (countDownTimer != null) {
countDownTimer.cancel();
countDownTimer = null;
}
}
mLiveAudienceViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), mLiveBean.getAvatar(), isattention);
mLiveRoomViewHolder.setAttention(isattention);
if (obj.containsKey("lminfo")) {
JSONObject mic_data = obj.getJSONObject("lminfo");
if (mic_data.containsKey("userlist")) {
mLiveRoomViewHolder.updataMicList(mic_data.getJSONArray("userlist"));
}
}
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlists"), LiveUserGiftBean.class);
mLiveRoomViewHolder.setUserList(list);
// resetUserListWidth(list);
mLiveRoomViewHolder.startRefreshUserList();
if (mLiveType == Constants.LIVE_TYPE_TIME) {//计时收费
mLiveRoomViewHolder.startRequestTimeCharge();
}
}
if (leave == 1) {
if (LivePlayRyViewHolder.leave != null) {
LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE);
}
}
//判断是否有连麦要显示连麦窗口
String linkMicUid = obj.getString("linkmic_uid");
String linkMicPull = obj.getString("linkmic_pull");
if (!TextUtils.isEmpty(linkMicUid) && !"0".equals(linkMicUid) && !TextUtils.isEmpty(linkMicPull)) {
if (mLiveSDK != Constants.LIVE_SDK_TX && mLiveLinkMicPresenter != null) {
mLiveLinkMicPresenter.onLinkMicPlay(linkMicUid, linkMicPull);
}
}
//判断是否有主播连麦
pkInfo = JSON.parseObject(obj.getString("pkinfo"));
if (pkInfo != null && pkInfo.getIntValue("drpk_status") != 1) {
String pkUid = pkInfo.getString("pkuid");
anyway = "1";
if (!TextUtils.isEmpty(pkUid) && !"0".equals(pkUid) && anyway.equals("0")) {
if (mLiveSDK != Constants.LIVE_SDK_TX) {
String pkPull = pkInfo.getString("pkpull");
if (!TextUtils.isEmpty(pkPull) && mLiveLinkMicAnchorPresenter != null) {
mLiveLinkMicAnchorPresenter.onLinkMicAnchorPlayUrl(pkUid, pkPull);
}
} else {
if (mLivePlayViewHolder instanceof LivePlayTxViewHolder) {
((LivePlayTxViewHolder) mLivePlayViewHolder).setAnchorLinkMic(true, 0);
}
}
}
if (obj.getString("isconnection") != null && obj.getString("isconnection").equals("1")) {
LivePlayRyViewHolder.setViewUP(1);
}
if (pkInfo.getIntValue("ifpk") == 1 && pkInfo.getString("end_pk_time").equals("0")) {//pk开始了
LivePlayRyViewHolder.setViewUP(2);
//pk排名数据
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname"));
}
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
LivePlayRyViewHolder.setViewUP(3);
//pk排名数据
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
}
//多人PK
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
LivePlayRyViewHolder.setViewUP(4);
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
}
//守护相关
mLiveGuardInfo = new LiveGuardInfo();
int guardNum = obj.getIntValue("guard_nums");
fansNum = obj.getIntValue("count_fans");
is_fans = obj.getString("is_fans") + "";
mLiveGuardInfo.setGuardNum(guardNum);
JSONObject guardObj = obj.getJSONObject("guard");
if (guardObj != null) {
mLiveGuardInfo.setMyGuardType(guardObj.getIntValue("type"));
mLiveGuardInfo.setMyGuardEndTime(guardObj.getString("endtime"));
}
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(openParametersModel.setmLiveGuardInfo(mLiveGuardInfo)
.setFansNum(fansNum)
.setIs_fans(is_fans)));
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setGuardNum(guardNum);
mLiveRoomViewHolder.setFansNum(fansNum);
//红包相关
mLiveRoomViewHolder.setRedPackBtnVisible(obj.getIntValue("isred") == 1);
}
//奖池等级
int giftPrizePoolLevel = obj.getIntValue("jackpot_level");
if (giftPrizePoolLevel >= 0) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
}
}
}
}
});
}
//定时器 //定时器
public CountDownTimer countDownTimer = null; public CountDownTimer countDownTimer = null;
private int timeIndex = 1; private int timeIndex = 1;

View File

@ -105,7 +105,6 @@ import com.yunbao.main.http.MainHttpConsts;
import com.yunbao.main.http.MainHttpUtil; import com.yunbao.main.http.MainHttpUtil;
import com.yunbao.main.interfaces.MainAppBarLayoutListener; import com.yunbao.main.interfaces.MainAppBarLayoutListener;
import com.yunbao.main.manager.imrongcloud.ConversationIMListManager; import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
import com.yunbao.main.presenter.CheckLivePresenter;
import com.yunbao.main.utils.GenerateTestUserSig; import com.yunbao.main.utils.GenerateTestUserSig;
import com.yunbao.main.views.FloatBannerView; import com.yunbao.main.views.FloatBannerView;
import com.yunbao.main.views.MainHomeCommunityViewHolder; import com.yunbao.main.views.MainHomeCommunityViewHolder;
@ -167,10 +166,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private boolean mHided; private boolean mHided;
private ProcessResultUtil mProcessResultUtil; private ProcessResultUtil mProcessResultUtil;
private CheckLivePresenter mCheckLivePresenter;
private boolean mFristLoad; private boolean mFristLoad;
private long mLastClickBackTime;//上次点击back键的时间 private long mLastClickBackTime;//上次点击back键的时间
private HttpCallback mGetLiveSdkCallback;
private String mUrlCsd; private String mUrlCsd;
private TextView v_table_redpoint; private TextView v_table_redpoint;
private View v_table_redpoint_me; private View v_table_redpoint_me;
@ -878,9 +875,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
MainHttpUtil.cancel(MainHttpConsts.REQUEST_BONUS); MainHttpUtil.cancel(MainHttpConsts.REQUEST_BONUS);
MainHttpUtil.cancel(MainHttpConsts.GET_BONUS); MainHttpUtil.cancel(MainHttpConsts.GET_BONUS);
MainHttpUtil.cancel(MainHttpConsts.SET_DISTRIBUT); MainHttpUtil.cancel(MainHttpConsts.SET_DISTRIBUT);
if (mCheckLivePresenter != null) {
mCheckLivePresenter.cancel();
}
LocationUtil.getInstance().stopLocation(); LocationUtil.getInstance().stopLocation();
if (mProcessResultUtil != null) { if (mProcessResultUtil != null) {
mProcessResultUtil.release(); mProcessResultUtil.release();
@ -907,14 +902,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
* 观看直播 * 观看直播
*/ */
public void watchLive(LiveBean liveBean, String key, int position) { public void watchLive(LiveBean liveBean, String key, int position) {
if (mCheckLivePresenter == null) { new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
mCheckLivePresenter = new CheckLivePresenter(mContext); @Override
} public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
if (CommonAppConfig.LIVE_ROOM_SCROLL) { RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
mCheckLivePresenter.watchLive(liveBean, key, position);
} else {
mCheckLivePresenter.watchLive(liveBean);
} }
});
} }

View File

@ -144,6 +144,8 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
@Override @Override
public void onItemClick(ListBean bean, int position) { public void onItemClick(ListBean bean, int position) {
if (bean.getIslive() == 1) { if (bean.getIslive() == 1) {
LiveHttpUtil.getLiveInfo(bean.getUid(), new HttpCallback() { LiveHttpUtil.getLiveInfo(bean.getUid(), new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {