修复多人连麦回到桌面再返回直播间丢失连麦图标问题
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LinkMicUserBean extends BaseModel {
|
||||
@SerializedName("user_nicename")
|
||||
private String uname;
|
||||
@SerializedName("avatar")
|
||||
private String avatar;
|
||||
@SerializedName("dress_avatar")
|
||||
private String dress_avatar;
|
||||
private String uid = "";
|
||||
private String action;
|
||||
@SerializedName("id")
|
||||
private String id;//连麦显示右侧头像时要用
|
||||
@SerializedName("level")
|
||||
private int level;
|
||||
@SerializedName("sex")
|
||||
private int sex;
|
||||
|
||||
public String getUname() {
|
||||
@@ -64,4 +73,26 @@ public class LinkMicUserBean extends BaseModel {
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LinkMicUserBean{" +
|
||||
"uname='" + uname + '\'' +
|
||||
", avatar='" + avatar + '\'' +
|
||||
", dress_avatar='" + dress_avatar + '\'' +
|
||||
", uid='" + uid + '\'' +
|
||||
", action='" + action + '\'' +
|
||||
", id='" + id + '\'' +
|
||||
", level=" + level +
|
||||
", sex=" + sex +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LinkMicUserBeanV2 extends BaseModel {
|
||||
private String roomuserid;
|
||||
private int status;
|
||||
private List<LinkMicUserBean> userlist;
|
||||
|
||||
public String getRoomuserid() {
|
||||
return roomuserid;
|
||||
}
|
||||
|
||||
public void setRoomuserid(String roomuserid) {
|
||||
this.roomuserid = roomuserid;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public List<LinkMicUserBean> getUserlist() {
|
||||
return userlist;
|
||||
}
|
||||
|
||||
public void setUserlist(List<LinkMicUserBean> userlist) {
|
||||
this.userlist = userlist;
|
||||
}
|
||||
}
|
||||
77
common/src/main/java/com/yunbao/common/bean/MicUserBean.java
Normal file
77
common/src/main/java/com/yunbao/common/bean/MicUserBean.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
public class MicUserBean extends BaseModel{
|
||||
protected String id;
|
||||
protected String userNiceName;
|
||||
protected String avatar;
|
||||
protected int level;
|
||||
protected int sex;
|
||||
protected String dress_avatar;
|
||||
protected int type;
|
||||
|
||||
@JSONField(name = "dress_avatar")
|
||||
public String getDress_avatar() {
|
||||
return dress_avatar;
|
||||
}
|
||||
@JSONField(name = "dress_avatar")
|
||||
public void setDress_avatar(String dress_avatar) {
|
||||
this.dress_avatar = dress_avatar;
|
||||
}
|
||||
|
||||
@JSONField(name = "level")
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
@JSONField(name = "level")
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
@JSONField(name = "sex")
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
@JSONField(name = "sex")
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
@JSONField(name = "user_nicename")
|
||||
public String getUserNiceName() {
|
||||
return userNiceName;
|
||||
}
|
||||
|
||||
@JSONField(name = "user_nicename")
|
||||
public void setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
}
|
||||
|
||||
@JSONField(name = "id")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JSONField(name = "id")
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@JSONField(name = "avatar")
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
@JSONField(name = "avatar")
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.MsgSwitchDetailModel;
|
||||
@@ -173,10 +174,10 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
||||
|
||||
/**
|
||||
* 获取活动
|
||||
* 获取多人连麦列表
|
||||
*/
|
||||
@GET("/api/public/?service=live.getDrLm")
|
||||
Observable<ResponseModel<List<ActiveModel>>> getDrLm();
|
||||
Observable<ResponseModel<List<LinkMicUserBeanV2>>> getDrLm(@Query("uid")String uid);
|
||||
|
||||
/**
|
||||
* 获取日榜、周榜数据
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
@@ -23,6 +25,7 @@ import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -373,7 +376,7 @@ public class LiveNetManager {
|
||||
.subscribe(new Consumer<ResponseModel<EnterRoomNewModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<EnterRoomNewModel> enterRoomNewModelResponseModel) throws Exception {
|
||||
Log.e("进入房间","enterRoomNew--------------------------------------------");
|
||||
Log.e("进入房间", "enterRoomNew--------------------------------------------");
|
||||
enterRoomDisposable = null;
|
||||
if (callback != null) {
|
||||
callback.onSuccess(enterRoomNewModelResponseModel.getData().getInfo());
|
||||
@@ -406,7 +409,7 @@ public class LiveNetManager {
|
||||
.subscribe(new Consumer<ResponseModel<String>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<String> stringResponseModel) throws Exception {
|
||||
Log.e("进入房间","userJoinRoomNew--------------------------------------------");
|
||||
Log.e("进入房间", "userJoinRoomNew--------------------------------------------");
|
||||
userJoinDisposable = null;
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@@ -445,6 +448,39 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取多人连麦用户列表
|
||||
*/
|
||||
public void getDRMicUserList(String uid, HttpCallback<List<LinkMicUserBean>> callback) {
|
||||
API.get().createPDLiveApi(false)
|
||||
.getDrLm(uid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<LinkMicUserBeanV2>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<LinkMicUserBeanV2>> listResponseModel) throws Exception {
|
||||
List<LinkMicUserBean> list=new ArrayList<>();
|
||||
for (LinkMicUserBeanV2 bean : listResponseModel.getData().getInfo()) {
|
||||
list.addAll(bean.getUserlist());
|
||||
for (LinkMicUserBean userBean : bean.getUserlist()) {
|
||||
Log.i("多人连麦", "list: " + userBean.toString());
|
||||
}
|
||||
}
|
||||
Log.i("多人连麦", "accept: " + list.size());
|
||||
if (callback != null) {
|
||||
callback.onSuccess(list);
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -169,10 +169,10 @@ public class MicStatusManager {
|
||||
* 显示退出连麦状态对话框
|
||||
*/
|
||||
public void showDownMicDialog(Context context) {
|
||||
DialogUitl.showSimpleDialog(context, "當前正在連麥中,是否退出連麥", new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleDialog(context, "當前正在連麥中", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
downMic();
|
||||
// downMic(); //不做下麦跳转
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user