Merge branch 'dev_6.5.2'
# Conflicts: # common/src/main/java/com/yunbao/common/http/PDLiveApi.java # common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java # common/src/main/res/values-en-rUS/string.xml # common/src/main/res/values-zh/strings.xml # common/src/main/res/values/strings.xml # live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
This commit is contained in:
@@ -179,6 +179,9 @@ public class Constants {
|
||||
public static final String CUSTOM_FULL_SERVICE_NOTIFY = "customFullServiceNotify";//全服通知
|
||||
public static final String XYD_COMPLETE = "XydComplete";//心愿单完成通知
|
||||
public static final String WISH_LIST_PROGRESS = "wishListProgress";//心愿单进度通知
|
||||
public static final String LIVE_VOTE_CREATE="createVote";
|
||||
public static final String LIVE_VOTE_UPDATE="updateVote";
|
||||
public static final String LIVE_VOTE_END="endVote";
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
|
||||
@@ -104,12 +104,22 @@ public class EnterRoomInfoModel extends BaseModel {
|
||||
private String anchorGoodnum;
|
||||
@SerializedName("jackpot_level")
|
||||
private String jackpotLevel="-1";
|
||||
@SerializedName("live_vote")
|
||||
private LiveRoomVoteModel voteModel;
|
||||
|
||||
public String getJackpotLevel() {
|
||||
|
||||
return jackpotLevel;
|
||||
}
|
||||
|
||||
public LiveRoomVoteModel getVoteModel() {
|
||||
return voteModel;
|
||||
}
|
||||
|
||||
public void setVoteModel(LiveRoomVoteModel voteModel) {
|
||||
this.voteModel = voteModel;
|
||||
}
|
||||
|
||||
public EnterRoomInfoModel setJackpotLevel(String jackpotLevel) {
|
||||
this.jackpotLevel = jackpotLevel;
|
||||
return this;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class LiveGiftBean {
|
||||
// public static final int MARK_LUCK = 3;
|
||||
|
||||
private int id;
|
||||
private int type;//0 普通礼物 1是豪华礼物
|
||||
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团
|
||||
private int mark;// 0 普通 1热门 2守护 3幸运
|
||||
private String name;
|
||||
private String price;
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 主播创建投票
|
||||
* {
|
||||
* "live_vote_id": "20",
|
||||
* "question_content": "123",
|
||||
* "vote_end_time": 180,
|
||||
* "option_content_first_num": 0,
|
||||
* "option_content_second_num": 0,
|
||||
* "users_id": []
|
||||
* }
|
||||
*/
|
||||
public class LiveRoomVoteModel extends BaseModel {
|
||||
@SerializedName("vote_status")
|
||||
private int status;
|
||||
@SerializedName("live_vote_id")
|
||||
private String voteId;
|
||||
@SerializedName("question_content")
|
||||
private String content;
|
||||
@SerializedName("vote_end_time")
|
||||
private int time;
|
||||
@SerializedName("option_content_first_num")
|
||||
private int answer1Num;
|
||||
@SerializedName("option_content_second_num")
|
||||
private int answer2Num;
|
||||
@SerializedName("users_id")
|
||||
private List<String> userIds;
|
||||
@SerializedName("option_content_first")
|
||||
private String answer1;
|
||||
@SerializedName("option_content_second")
|
||||
private String answer2;
|
||||
@SerializedName("result")
|
||||
private String result;
|
||||
@SerializedName("option_text")
|
||||
private String optionText;
|
||||
@SerializedName("option_content_key")
|
||||
private String vote;
|
||||
|
||||
private String liveUid;
|
||||
|
||||
public String getLiveUid() {
|
||||
return liveUid;
|
||||
}
|
||||
|
||||
public void setLiveUid(String liveUid) {
|
||||
this.liveUid = liveUid;
|
||||
}
|
||||
|
||||
public String getAnswer1() {
|
||||
return answer1;
|
||||
}
|
||||
|
||||
public void setAnswer1(String answer1) {
|
||||
this.answer1 = answer1;
|
||||
}
|
||||
|
||||
public String getAnswer2() {
|
||||
return answer2;
|
||||
}
|
||||
|
||||
public void setAnswer2(String answer2) {
|
||||
this.answer2 = answer2;
|
||||
}
|
||||
|
||||
public String getVoteId() {
|
||||
return voteId;
|
||||
}
|
||||
|
||||
public void setVoteId(String voteId) {
|
||||
this.voteId = voteId;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(int time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public int getAnswer1Num() {
|
||||
return answer1Num;
|
||||
}
|
||||
|
||||
public void setAnswer1Num(int answer1Num) {
|
||||
this.answer1Num = answer1Num;
|
||||
}
|
||||
|
||||
public int getAnswer2Num() {
|
||||
return answer2Num;
|
||||
}
|
||||
|
||||
public void setAnswer2Num(int answer2Num) {
|
||||
this.answer2Num = answer2Num;
|
||||
}
|
||||
|
||||
public List<String> getUserIds() {
|
||||
return userIds;
|
||||
}
|
||||
|
||||
public void setUserIds(List<String> userIds) {
|
||||
this.userIds = userIds;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getOptionText() {
|
||||
return optionText;
|
||||
}
|
||||
|
||||
public void setOptionText(String optionText) {
|
||||
this.optionText = optionText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveRoomVoteModel{" +
|
||||
"status=" + status +
|
||||
", voteId='" + voteId + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", time=" + time +
|
||||
", answer1Num=" + answer1Num +
|
||||
", answer2Num=" + answer2Num +
|
||||
", userIds=" + userIds +
|
||||
", answer1='" + answer1 + '\'' +
|
||||
", answer2='" + answer2 + '\'' +
|
||||
", result='" + result + '\'' +
|
||||
", optionText='" + optionText + '\'' +
|
||||
", vote='" + vote + '\'' +
|
||||
", liveUid='" + liveUid + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getVote() {
|
||||
return vote;
|
||||
}
|
||||
|
||||
public void setVote(String vote) {
|
||||
this.vote = vote;
|
||||
}
|
||||
|
||||
public boolean isVoteLeft() {
|
||||
return vote.equals("option_content_first_num");
|
||||
}
|
||||
|
||||
public boolean isVote() {
|
||||
return !StringUtil.isEmpty(vote);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,9 @@ public abstract class AbsDialogPopupWindow extends BottomPopupView {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="https://github.com/li-xiaojun/XPopup/wiki/5.-%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE">参考配置</a>
|
||||
*/
|
||||
public abstract void buildDialog(XPopup.Builder builder);
|
||||
public abstract int bindLayoutId();
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
@@ -700,4 +701,25 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Task.userInfoTask")
|
||||
Observable<ResponseModel<List<Object>>> userInfoTask();
|
||||
|
||||
/**
|
||||
* 创建投票
|
||||
*/
|
||||
@GET("/api/public/?service=Live.createLiveVote")
|
||||
Observable<ResponseModel<LiveRoomVoteModel>> createLiveVote(@Query("liveuid") String liveUid,
|
||||
@Query("question_content") String content,
|
||||
@Query("option_content_first") String first,
|
||||
@Query("option_content_second") String second);
|
||||
|
||||
/**
|
||||
* 更新投票
|
||||
*/
|
||||
@GET("/api/public/?service=Live.setLiveVote")
|
||||
Observable<ResponseModel<List<String>>> updateLiveVote(@Query("liveuid") String liveUid,
|
||||
@Query("option_content_key") String key);
|
||||
/**
|
||||
* 主动结束投票
|
||||
*/
|
||||
@GET("/api/public/?service=Live.endLiveVote")
|
||||
Observable<ResponseModel<List<String>>> endLiveVote(@Query("liveuid") String liveUid);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
@@ -1427,6 +1428,78 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void createLiveVote(String liveUid, String content, String first, String second, HttpCallback<LiveRoomVoteModel> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createLiveVote(liveUid, content, first, second)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<LiveRoomVoteModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<LiveRoomVoteModel> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void updateLiveVote(String liveUid, boolean isLeftVote, HttpCallback<String> callback) {
|
||||
String key;
|
||||
if (isLeftVote) {//是左边的投票
|
||||
key = "option_content_first_num";
|
||||
} else {
|
||||
key = "option_content_second_num";
|
||||
}
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateLiveVote(liveUid, key)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<String>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<String>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess("");
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void endLiveVote(String liveUid, HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.endLiveVote(liveUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<String>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<String>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void userInfoTask(HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.userInfoTask()
|
||||
|
||||
@@ -121,7 +121,7 @@ public class AppManager {
|
||||
*/
|
||||
public static void runDebugCode(Runnable runnable) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
// runnable.run();
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.InputFilter;
|
||||
import android.text.InputType;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateFormat;
|
||||
import android.util.SparseArray;
|
||||
@@ -331,7 +330,7 @@ public class DialogUitl {
|
||||
private Context mContext;
|
||||
private String mTitle;
|
||||
private String mContent;
|
||||
private String mConfrimString;
|
||||
private String mConfirmString;
|
||||
private String mCancelString;
|
||||
private boolean mCancelable;
|
||||
private boolean mBackgroundDimEnabled;//显示区域以外是否使用黑色半透明背景
|
||||
@@ -371,8 +370,8 @@ public class DialogUitl {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setConfrimString(String confrimString) {
|
||||
mConfrimString = confrimString;
|
||||
public Builder setConfirmString(String confirmString) {
|
||||
mConfirmString = confirmString;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -460,8 +459,8 @@ public class DialogUitl {
|
||||
content.setFilters(new InputFilter[]{new InputFilter.LengthFilter(mLength)});
|
||||
}
|
||||
TextView btnConfirm = (TextView) dialog.findViewById(R.id.btn_confirm);
|
||||
if (!TextUtils.isEmpty(mConfrimString)) {
|
||||
btnConfirm.setText(mConfrimString);
|
||||
if (!TextUtils.isEmpty(mConfirmString)) {
|
||||
btnConfirm.setText(mConfirmString);
|
||||
}
|
||||
TextView btnCancel = (TextView) dialog.findViewById(R.id.btn_cancel);
|
||||
if (!TextUtils.isEmpty(mCancelString)) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class VersionUtil {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfrimString(context.getString(R.string.version_immediate_use))
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
@@ -81,7 +81,7 @@ public class VersionUtil {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfrimString(context.getString(R.string.version_immediate_use))
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
@@ -111,7 +111,7 @@ public class VersionUtil {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfrimString(context.getString(R.string.version_immediate_use))
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
@@ -134,7 +134,7 @@ public class VersionUtil {
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.version_update))
|
||||
.setContent(configBean.getUpdateDes())
|
||||
.setConfrimString(context.getString(R.string.version_immediate_use))
|
||||
.setConfirmString(context.getString(R.string.version_immediate_use))
|
||||
.setCancelString(context.getString(R.string.version_not_update))
|
||||
.setCancelable(false)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback2() {
|
||||
|
||||
Reference in New Issue
Block a user