新增小游戏相关内容
This commit is contained in:
parent
abc37aa486
commit
fe28d3508b
@ -493,6 +493,9 @@ public class IMLoginModel extends BaseModel {
|
|||||||
public long getId() {
|
public long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
public String getUid(){
|
||||||
|
return id+"";
|
||||||
|
}
|
||||||
|
|
||||||
public IMLoginModel setId(long id) {
|
public IMLoginModel setId(long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
public class SudActivityGameInfoBean extends BaseModel {
|
||||||
|
private int id;
|
||||||
|
private int uid;//用户id
|
||||||
|
private int userType;//用户类型 1.主播 2.用户
|
||||||
|
private int score;//对局获得的积分
|
||||||
|
private int hot_num;//对局获得的热度
|
||||||
|
private int is_win;//对局结果 0.无结果 1.输 2.赢 3.平局
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUserType() {
|
||||||
|
return userType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserType(int userType) {
|
||||||
|
this.userType = userType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScore() {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScore(int score) {
|
||||||
|
this.score = score;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHot_num() {
|
||||||
|
return hot_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHot_num(int hot_num) {
|
||||||
|
this.hot_num = hot_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIs_win() {
|
||||||
|
return is_win;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_win(int is_win) {
|
||||||
|
this.is_win = is_win;
|
||||||
|
}
|
||||||
|
}
|
@ -44,6 +44,16 @@ public class SudRoomListModel extends BaseModel {
|
|||||||
private String sudgameicon;
|
private String sudgameicon;
|
||||||
@SerializedName("currency_type")
|
@SerializedName("currency_type")
|
||||||
private String currencyType;
|
private String currencyType;
|
||||||
|
@SerializedName("is_activity")
|
||||||
|
private String isActivity;
|
||||||
|
|
||||||
|
public String getIsActivity() {
|
||||||
|
return isActivity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsActivity(String isActivity) {
|
||||||
|
this.isActivity = isActivity;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCurrencyType() {
|
public String getCurrencyType() {
|
||||||
return currencyType;
|
return currencyType;
|
||||||
|
@ -3,11 +3,16 @@ package com.yunbao.common.dialog;
|
|||||||
import static androidx.core.content.ContextCompat.getSystemService;
|
import static androidx.core.content.ContextCompat.getSystemService;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.text.style.ImageSpan;
|
||||||
|
import android.view.View;
|
||||||
import android.view.animation.LinearInterpolator;
|
import android.view.animation.LinearInterpolator;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
@ -32,7 +37,9 @@ import com.yunbao.common.event.SudGameListDissMissEvent;
|
|||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.RandomSudGameManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
@ -95,6 +102,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
|
|
||||||
private String userName;
|
private String userName;
|
||||||
private boolean isYuanbao;
|
private boolean isYuanbao;
|
||||||
|
private CheckCurrencyModel currencyModel;
|
||||||
|
|
||||||
private void initDate() {
|
private void initDate() {
|
||||||
currencyTypeName = getContext().getString(R.string.golden_bean);
|
currencyTypeName = getContext().getString(R.string.golden_bean);
|
||||||
@ -108,6 +116,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(CheckCurrencyModel data) {
|
public void onSuccess(CheckCurrencyModel data) {
|
||||||
isYuanbao = TextUtils.equals(data.getIsYuanbao(), "1") || TextUtils.equals(data.getIsYuanbao(), "true");
|
isYuanbao = TextUtils.equals(data.getIsYuanbao(), "1") || TextUtils.equals(data.getIsYuanbao(), "true");
|
||||||
|
currencyModel = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -213,7 +222,8 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show("Currency quantity range [10-1000]");
|
ToastUtil.show("Currency quantity range [10-1000]");
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -245,7 +255,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if(!TextUtils.equals(currencyType, "4")){
|
||||||
if (sill.length() > 4) {
|
if (sill.length() > 4) {
|
||||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
ToastUtil.show("貨幣數量区间为[10 - 1000]");
|
||||||
@ -274,17 +284,28 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TextUtils.equals(currencyType, "4") && currencyModel.getZqTicketNumberInt() < 1) {
|
||||||
|
RandomSudGameManager.getManager().showNotActivityTicketDialog(getContext());
|
||||||
|
return;
|
||||||
|
}
|
||||||
LiveNetManager.get(getContext())
|
LiveNetManager.get(getContext())
|
||||||
.createSudRoom(name, sill, currencyType, id, new HttpCallback<CreateSudRoomModel>() {
|
.createSudRoom(name, sill, currencyType, id, TextUtils.equals(currencyType, "4"), new HttpCallback<CreateSudRoomModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(CreateSudRoomModel data) {
|
public void onSuccess(CreateSudRoomModel data) {
|
||||||
|
if(TextUtils.equals(currencyType, "4")){
|
||||||
|
RandomSudGameManager.getManager().start(data,isHome);
|
||||||
|
dialog.dismiss();
|
||||||
|
if(!isHome){
|
||||||
|
Bus.get().post(new SudGameListDissMissEvent());
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isHome) {
|
if (isHome) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
if (CommonAppConfig.getInstance().getConfig().isSw()) {
|
||||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data),true,isHome);
|
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data), false, isHome);
|
||||||
}else{
|
} else {
|
||||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data),true,isHome);
|
RouteUtil.forwardRySudGameActivity(new Gson().toJson(data), true, isHome);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||||
@ -299,6 +320,15 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
ToastUtil.show(error);
|
ToastUtil.show(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error, int code) {
|
||||||
|
if (code != 501) {
|
||||||
|
super.onError(error, code);
|
||||||
|
} else {
|
||||||
|
RandomSudGameManager.getManager().showNotActivityTicketDialog(getContext());
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -332,7 +362,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
.isDestroyOnDismiss(true)
|
.isDestroyOnDismiss(true)
|
||||||
.isLightStatusBar(false)
|
.isLightStatusBar(false)
|
||||||
.popupPosition(PopupPosition.Bottom)
|
.popupPosition(PopupPosition.Bottom)
|
||||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName, isYuanbao, id, currencyModel)
|
||||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(DialogInterface dialog) {
|
public void onDismiss(DialogInterface dialog) {
|
||||||
@ -343,13 +373,13 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
}else {
|
} else {
|
||||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||||
builder.hasShadowBg(false)
|
builder.hasShadowBg(false)
|
||||||
.isDestroyOnDismiss(true)
|
.isDestroyOnDismiss(true)
|
||||||
.isLightStatusBar(false)
|
.isLightStatusBar(false)
|
||||||
.popupPosition(PopupPosition.Bottom)
|
.popupPosition(PopupPosition.Bottom)
|
||||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName, isYuanbao, id, currencyModel)
|
||||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(DialogInterface dialog) {
|
public void onDismiss(DialogInterface dialog) {
|
||||||
@ -361,11 +391,12 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void closeAnimSudGameListEvent() {
|
private void closeAnimSudGameListEvent() {
|
||||||
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
|
ObjectAnimator animator = ObjectAnimator.ofFloat(roomGameArrow, "rotation", 90f, 0f);
|
||||||
animator.setDuration(animDuration);
|
animator.setDuration(animDuration);
|
||||||
@ -384,7 +415,8 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
interactionID = event.getInteractionID();
|
interactionID = event.getInteractionID();
|
||||||
createGameType.setText(event.getTitle());
|
createGameType.setText(event.getTitle());
|
||||||
id = event.getId();
|
id = event.getId();
|
||||||
|
gameSill.setEnabled(true);
|
||||||
|
gameSill.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
@ -397,5 +429,12 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
} else {
|
} else {
|
||||||
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
gameSill.setHint(WordUtil.isNewZh() ? "請輸入貨幣數量" : "Please enter the amount of currency");
|
||||||
}
|
}
|
||||||
|
if(TextUtils.equals(currencyType,"4")){
|
||||||
|
gameSill.setText("1");
|
||||||
|
gameSill.setEnabled(false);
|
||||||
|
}else {
|
||||||
|
gameSill.setEnabled(true);
|
||||||
|
gameSill.setText("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,14 @@ package com.yunbao.common.dialog;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
@ -14,36 +20,46 @@ import com.lxj.xpopup.XPopup;
|
|||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudSettleBean;
|
import com.yunbao.common.bean.SudSettleBean;
|
||||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 双人小游戏结算弹窗
|
* 双人小游戏结算弹窗
|
||||||
*/
|
*/
|
||||||
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow {
|
||||||
public SudGameDoubleDialog(@NonNull Context context) {
|
public SudGameDoubleDialog(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bindLayoutId() {
|
public int bindLayoutId() {
|
||||||
return R.layout.dialog_sub_double;
|
return R.layout.dialog_sub_double;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AppCompatImageView sub_win_hat,sub_leave,sub_again,sub_title;
|
private AppCompatImageView sub_win_hat, sub_leave, sub_again, sub_title;
|
||||||
private RoundedImageView sub_win_head,sub_loss_head;
|
private RoundedImageView sub_win_head, sub_loss_head;
|
||||||
private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time;
|
private AppCompatTextView sub_win_name, sub_win_score, sub_loss_name, sub_loss_score, sub_time;
|
||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
|
private TextView activityGameAchievement;
|
||||||
|
private ImageView lossActivityIcon, winActivityIcon;
|
||||||
private List<SudSettleBean> settleBeans = new ArrayList<>();
|
private List<SudSettleBean> settleBeans = new ArrayList<>();
|
||||||
private boolean containMe;
|
private boolean containMe;
|
||||||
|
private boolean isActivityGame;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildDialog(XPopup.Builder builder) {
|
public void buildDialog(XPopup.Builder builder) {
|
||||||
@ -64,20 +80,22 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
|||||||
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
|
sub_loss_name = findViewById(R.id.sub_loss_name);//失败方昵称
|
||||||
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
|
sub_loss_score = findViewById(R.id.sub_loss_score);//失败方分数
|
||||||
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
sub_time = findViewById(R.id.sub_time);//关闭倒计时
|
||||||
|
lossActivityIcon = findViewById(R.id.lossActivityIcon);
|
||||||
|
winActivityIcon = findViewById(R.id.winActivityIcon);
|
||||||
|
activityGameAchievement = findViewById(R.id.activityGameAchievement);
|
||||||
|
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
if (WordUtil.isNewZh()){
|
if (WordUtil.isNewZh()) {
|
||||||
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
sub_leave.setImageResource(R.mipmap.sub_leave_zh);
|
||||||
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
sub_again.setImageResource(R.mipmap.sub_again_zh);
|
||||||
}else {
|
} else {
|
||||||
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
sub_leave.setImageResource(R.mipmap.sub_leave_en);
|
||||||
sub_again.setImageResource(R.mipmap.sub_again_en);
|
sub_again.setImageResource(R.mipmap.sub_again_en);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub_leave.setOnClickListener(v-> destroyDialog());
|
sub_leave.setOnClickListener(v -> destroyDialog());
|
||||||
sub_again.setOnClickListener(v-> {
|
sub_again.setOnClickListener(v -> {
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||||
destroyDialog();
|
destroyDialog();
|
||||||
});
|
});
|
||||||
@ -86,30 +104,47 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
|||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
private void initData() {
|
private void initData() {
|
||||||
if (settleBeans.size() == 2){
|
if (settleBeans.size() == 2) {
|
||||||
sortByWinNum(settleBeans);
|
sortByWinNum(settleBeans);
|
||||||
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
||||||
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
||||||
checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
checkMe(sudSettleBean1.getUid(), sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
||||||
|
LogUtils.e("第一名:" + sudSettleBean1.getNick_name());
|
||||||
|
LogUtils.e("第二名:" + sudSettleBean2.getNick_name());
|
||||||
// 检查是否是当前用户
|
// 检查是否是当前用户
|
||||||
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
||||||
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
||||||
boolean isZh = WordUtil.isNewZh();
|
boolean isZh = WordUtil.isNewZh();
|
||||||
|
LogUtils.e("isFirstMe:" + isFirstMe);
|
||||||
if (containMe) {
|
if (containMe) {
|
||||||
// 当前用户在游戏中
|
// 当前用户在游戏中
|
||||||
SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
// SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2;
|
||||||
SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
|
// SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1;
|
||||||
|
SudSettleBean winBean= sudSettleBean1;
|
||||||
|
SudSettleBean lossBean= sudSettleBean2;
|
||||||
|
|
||||||
|
|
||||||
|
if (isActivityGame) {
|
||||||
|
Map<String, Integer> map = showActivityGameScore();
|
||||||
|
if (!map.isEmpty()) {
|
||||||
|
isDraw = map.get("win").intValue() == map.get("loss").intValue();
|
||||||
|
isFirstMe = IMLoginManager.get(mContext).getUserInfo().getUid().equals(String.valueOf(map.get("win_uid")));
|
||||||
|
if (lossBean.getUid().equals(map.get("win_uid").toString())) {
|
||||||
|
SudSettleBean tmp = lossBean;
|
||||||
|
lossBean = winBean;
|
||||||
|
winBean = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ToastUtil.show("结算:" + isDraw + " | " + isFirstMe + "|");
|
||||||
|
} else {
|
||||||
|
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
|
||||||
|
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
|
||||||
|
System.out.println("胜者名字:" + winBean.getNick_name() + "|败者名字:" + lossBean.getNick_name());
|
||||||
|
}
|
||||||
ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head);
|
ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head);
|
||||||
ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head);
|
ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head);
|
||||||
sub_win_name.setText(winBean.getNick_name());
|
sub_win_name.setText(winBean.getNick_name());
|
||||||
sub_loss_name.setText(lossBean.getNick_name());
|
sub_loss_name.setText(lossBean.getNick_name());
|
||||||
|
|
||||||
sub_win_score.setText(winBean.getWin_num() > 0 ? "+" + winBean.getWin_num() : String.valueOf(winBean.getWin_num()));
|
|
||||||
sub_loss_score.setText(String.valueOf(lossBean.getWin_num()));
|
|
||||||
|
|
||||||
if (isDraw) {
|
if (isDraw) {
|
||||||
// 平局
|
// 平局
|
||||||
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en);
|
||||||
@ -140,9 +175,40 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
System.out.println("是否为活动游戏" + isActivityGame + " 成就内容:" + gameSettle.achievement);
|
||||||
|
if (isActivityGame) {
|
||||||
|
//TODO 败者没显示成就
|
||||||
|
if (!StringUtil.isEmpty(gameSettle.achievement)) {
|
||||||
|
String activityGameAchievementText = WordUtil.getNewString(R.string.game_dialog_activity_achievements_title);
|
||||||
|
String activityGameAchievementContent = gameSettle.achievement;
|
||||||
|
activityGameAchievement.setVisibility(View.VISIBLE);
|
||||||
|
SpannableString ss = new SpannableString(activityGameAchievementText + activityGameAchievementContent);
|
||||||
|
ss.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBA6A")), activityGameAchievementText.length(), ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
activityGameAchievement.setText(ss);
|
||||||
|
}
|
||||||
|
lossActivityIcon.setVisibility(View.VISIBLE);
|
||||||
|
winActivityIcon.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkMe(String id1,String id2){
|
@SuppressLint("SetTextI18n")
|
||||||
|
private Map<String, Integer> showActivityGameScore() {
|
||||||
|
Map<String, Integer> map = new HashMap<>();
|
||||||
|
if (gameSettle.activityGameInfoBean == null) return map;
|
||||||
|
for (SudActivityGameInfoBean infoBean : gameSettle.activityGameInfoBean) {
|
||||||
|
if (infoBean.getIs_win() == 1) {
|
||||||
|
sub_loss_score.setText("+" + infoBean.getScore());
|
||||||
|
map.put("loss", infoBean.getScore());
|
||||||
|
} else if (infoBean.getIs_win() == 2) {
|
||||||
|
sub_win_score.setText("+" + infoBean.getScore());
|
||||||
|
map.put("win", infoBean.getScore());
|
||||||
|
map.put("win_uid", infoBean.getUid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkMe(String id1, String id2) {
|
||||||
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
|
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,11 +216,11 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
|||||||
protected void onShow() {
|
protected void onShow() {
|
||||||
super.onShow();
|
super.onShow();
|
||||||
//关闭倒计时
|
//关闭倒计时
|
||||||
countDownTimer = new CountDownTimer(10000, 1000){
|
countDownTimer = new CountDownTimer(140000, 1000) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTick(long l) {
|
public void onTick(long l) {
|
||||||
sub_time.setText(String.valueOf((l+500)/1000));
|
sub_time.setText(String.valueOf((l + 500) / 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -165,23 +231,30 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
|||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSudSettleList(List<SudSettleBean> data){
|
SudMGPMGState.MGCommonGameSettle gameSettle;
|
||||||
|
|
||||||
|
public void setSudSettleList(SudMGPMGState.MGCommonGameSettle data) {
|
||||||
|
gameSettle = data;
|
||||||
settleBeans.clear();
|
settleBeans.clear();
|
||||||
settleBeans.addAll(data);
|
settleBeans.addAll(data.sudSettleBeans);
|
||||||
LogUtils.e("yqw=====>"+settleBeans);
|
LogUtils.e("yqw=====>" + settleBeans);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sortByWinNum(List<SudSettleBean> list){
|
private void sortByWinNum(List<SudSettleBean> list) {
|
||||||
// 按照胜利数排序 settleBeans 列表
|
// 按照胜利数排序 settleBeans 列表
|
||||||
Collections.sort(list, (bean1, bean2) -> {
|
Collections.sort(list, (bean1, bean2) -> {
|
||||||
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序
|
||||||
});
|
});
|
||||||
|
LogUtils.e("排序后=====>" + settleBeans);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void destroyDialog(){
|
private void destroyDialog() {
|
||||||
dismiss();
|
dismiss();
|
||||||
countDownTimer.cancel();
|
countDownTimer.cancel();
|
||||||
countDownTimer = null;
|
countDownTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setActivityGame() {
|
||||||
|
isActivityGame = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import com.lxj.xpopup.core.AttachPopupView;
|
|||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.adapter.SudTitleSelectAdapter;
|
import com.yunbao.common.adapter.SudTitleSelectAdapter;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
import com.yunbao.common.event.CreateSudGameEvent;
|
import com.yunbao.common.event.CreateSudGameEvent;
|
||||||
import com.yunbao.common.event.CurrencyTypeEvent;
|
import com.yunbao.common.event.CurrencyTypeEvent;
|
||||||
import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
||||||
@ -21,6 +22,7 @@ import com.yunbao.common.event.SudGameListEvent;
|
|||||||
import com.yunbao.common.event.SudGameListSillEvent;
|
import com.yunbao.common.event.SudGameListSillEvent;
|
||||||
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.WordUtil;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -42,6 +44,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
private DialogInterface.OnDismissListener onDismissListener;
|
private DialogInterface.OnDismissListener onDismissListener;
|
||||||
private String mSill;
|
private String mSill;
|
||||||
private boolean isYuanbao;
|
private boolean isYuanbao;
|
||||||
|
private String gameId = null;
|
||||||
|
private CheckCurrencyModel currencyModel = null;
|
||||||
|
|
||||||
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
|
public SudGameListSelectPopup(@NonNull Context context, int type, List<CustomSidebarChildModel> child, long interactionID) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -68,6 +72,15 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
this.isYuanbao = isYuanbao;
|
this.isYuanbao = isYuanbao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SudGameListSelectPopup(@NonNull Context context, int mType, String sill, boolean isYuanbao, String gameId, CheckCurrencyModel data) {
|
||||||
|
super(context);
|
||||||
|
this.mType = mType;
|
||||||
|
mSill = sill;
|
||||||
|
this.isYuanbao = isYuanbao;
|
||||||
|
this.gameId = gameId;
|
||||||
|
this.currencyModel = data;
|
||||||
|
}
|
||||||
|
|
||||||
public SudGameListSelectPopup(@NonNull Context context, String sill, List<CustomSidebarChildModel> child) {
|
public SudGameListSelectPopup(@NonNull Context context, String sill, List<CustomSidebarChildModel> child) {
|
||||||
super(context);
|
super(context);
|
||||||
this.mType = 8;
|
this.mType = 8;
|
||||||
@ -160,7 +173,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (mType == 2) {
|
}
|
||||||
|
else if (mType == 2) {
|
||||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||||
selectString.add(getContext().getString(R.string.live_anchor));
|
selectString.add(getContext().getString(R.string.live_anchor));
|
||||||
selectString.add(getContext().getString(R.string.interactive_game_player));
|
selectString.add(getContext().getString(R.string.interactive_game_player));
|
||||||
@ -195,6 +209,10 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
if (isYuanbao) {
|
if (isYuanbao) {
|
||||||
selectSill.put(getContext().getString(R.string.coins), "2");
|
selectSill.put(getContext().getString(R.string.coins), "2");
|
||||||
}
|
}
|
||||||
|
if (currencyModel != null && currencyModel.isActivityGame(gameId)) {
|
||||||
|
selectString.add(WordUtil.getNewString(R.string.game_create_coid_ticket));
|
||||||
|
selectSill.put(WordUtil.getNewString(R.string.game_create_coid_ticket), "4");
|
||||||
|
}
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
for (int i = 0; i < selectString.size(); i++) {
|
for (int i = 0; i < selectString.size(); i++) {
|
||||||
@ -247,7 +265,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (mType == 7) {
|
}
|
||||||
|
else if (mType == 7) {
|
||||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today));
|
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today));
|
||||||
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_7));
|
selectString.add(getContext().getString(R.string.sud_in_game_game_game_peer_today_7));
|
||||||
@ -278,7 +297,8 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (mType == 8) {
|
}
|
||||||
|
else if (mType == 8) {
|
||||||
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
selectString.add(getContext().getString(R.string.interactive_game_create_unlimited));
|
||||||
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
selectSill.put(getContext().getString(R.string.interactive_game_create_unlimited), "0");
|
||||||
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
||||||
|
@ -97,9 +97,9 @@ public class SudGameMultipleDialog extends AbsDialogCenterPopupWindow{
|
|||||||
// limitItem();
|
// limitItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSudSettleList(List<SudSettleBean> data){
|
public void setSudSettleList(SudMGPMGState.MGCommonGameSettle data){
|
||||||
settleBeans.clear();
|
settleBeans.clear();
|
||||||
settleBeans.addAll(data);
|
settleBeans.addAll(data.sudSettleBeans);
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置最多显示的高度
|
//设置最多显示的高度
|
||||||
|
@ -1,12 +1,42 @@
|
|||||||
package com.yunbao.common.event;
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CheckCurrencyModel extends BaseModel {
|
public class CheckCurrencyModel extends BaseModel {
|
||||||
|
|
||||||
@SerializedName("is_yuanbao")
|
@SerializedName("is_yuanbao")
|
||||||
private String isYuanbao;
|
private String isYuanbao;//是否开启星币 0.否 1.是
|
||||||
|
|
||||||
|
@SerializedName("zq_game_status")
|
||||||
|
private String zqGameStatus="1";//一杆清台活动开启状态 0.未开启 1.开启
|
||||||
|
|
||||||
|
@SerializedName("zq_ticket_number")
|
||||||
|
private String zqTicketNumber;//一杆清台活动门票余额
|
||||||
|
|
||||||
|
private List<String> activityList;//活动列表 **本地注册,接口本身没这个字段
|
||||||
|
|
||||||
|
public CheckCurrencyModel() {
|
||||||
|
activityList = new ArrayList<>();
|
||||||
|
activityList.add("24");//测试服-台球
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getActivityList() {
|
||||||
|
return activityList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivityGame(String gameId){
|
||||||
|
if(StringUtil.isEmpty(gameId))return false;
|
||||||
|
if(TextUtils.equals(zqGameStatus,"0")) return false;
|
||||||
|
return activityList.contains(gameId);
|
||||||
|
}
|
||||||
|
|
||||||
public String getIsYuanbao() {
|
public String getIsYuanbao() {
|
||||||
return isYuanbao;
|
return isYuanbao;
|
||||||
@ -16,4 +46,27 @@ public class CheckCurrencyModel extends BaseModel {
|
|||||||
this.isYuanbao = isYuanbao;
|
this.isYuanbao = isYuanbao;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getZqGameStatus() {
|
||||||
|
return zqGameStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZqGameStatus(String zqGameStatus) {
|
||||||
|
this.zqGameStatus = zqGameStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZqTicketNumber() {
|
||||||
|
return zqTicketNumber;
|
||||||
|
}
|
||||||
|
public int getZqTicketNumberInt() {
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(zqTicketNumber);
|
||||||
|
}catch (Exception e){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZqTicketNumber(String zqTicketNumber) {
|
||||||
|
this.zqTicketNumber = zqTicketNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,41 @@
|
|||||||
package com.yunbao.common.event;
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CheckRemainingBalanceEvent extends BaseModel {
|
public class CheckRemainingBalanceEvent extends BaseModel {
|
||||||
public int seatIndex=0;
|
public int seatIndex = 0;
|
||||||
private String SudMGPMGState;
|
private String SudMGPMGState;
|
||||||
private boolean subReady = false;//是否直接自动准备
|
private boolean subReady = false;//是否直接自动准备
|
||||||
private SudMGPMGState.MGCommonGameSettle mgCommonGameSettle;//结算数据
|
private SudMGPMGState.MGCommonGameSettle mgCommonGameSettle;//结算数据
|
||||||
|
private boolean isActivityGame;
|
||||||
|
|
||||||
|
public boolean isSubReady() {
|
||||||
|
return subReady;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActivityGame() {
|
||||||
|
return isActivityGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CheckRemainingBalanceEvent setActivityGame(boolean activityGame) {
|
||||||
|
isActivityGame = activityGame;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle() {
|
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle() {
|
||||||
return mgCommonGameSettle;
|
return mgCommonGameSettle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SudMGPMGState.MGCommonGameSettle getMgCommonGameSettle(List<SudActivityGameInfoBean> data) {
|
||||||
|
mgCommonGameSettle.activityGameInfoBean = data;
|
||||||
|
return mgCommonGameSettle;
|
||||||
|
}
|
||||||
|
|
||||||
public CheckRemainingBalanceEvent setMgCommonGameSettle(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
public CheckRemainingBalanceEvent setMgCommonGameSettle(SudMGPMGState.MGCommonGameSettle mgCommonGameSettle) {
|
||||||
this.mgCommonGameSettle = mgCommonGameSettle;
|
this.mgCommonGameSettle = mgCommonGameSettle;
|
||||||
return this;
|
return this;
|
||||||
@ -36,12 +59,12 @@ public class CheckRemainingBalanceEvent extends BaseModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckRemainingBalanceEvent setSubReady(boolean subReady){
|
public CheckRemainingBalanceEvent setSubReady(boolean subReady) {
|
||||||
this.subReady = subReady;
|
this.subReady = subReady;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getSubReady(){
|
public boolean getSubReady() {
|
||||||
return subReady;
|
return subReady;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,16 @@ import com.yunbao.common.bean.CreateSudRoomModel;
|
|||||||
public class LiveSudGamePopupShowOrHideEvent {
|
public class LiveSudGamePopupShowOrHideEvent {
|
||||||
private int type = 0;//0展示,1hide隱藏,2dismiss關閉
|
private int type = 0;//0展示,1hide隱藏,2dismiss關閉
|
||||||
private CreateSudRoomModel createSudRoomModel;
|
private CreateSudRoomModel createSudRoomModel;
|
||||||
|
private boolean isActivityGame;
|
||||||
|
|
||||||
|
public boolean isActivityGame() {
|
||||||
|
return isActivityGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveSudGamePopupShowOrHideEvent setActivityGame(boolean activityGame) {
|
||||||
|
isActivityGame = activityGame;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public CreateSudRoomModel getCreateSudRoomModel() {
|
public CreateSudRoomModel getCreateSudRoomModel() {
|
||||||
return createSudRoomModel;
|
return createSudRoomModel;
|
||||||
|
@ -74,6 +74,7 @@ import com.yunbao.common.bean.SendMoneyLongModel;
|
|||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.SlideInBannerModel;
|
import com.yunbao.common.bean.SlideInBannerModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
|
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudGameInfoBean;
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudGameScoreBean;
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
import com.yunbao.common.bean.SudGameUserModel;
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
@ -1054,6 +1055,7 @@ public interface PDLiveApi {
|
|||||||
@Query("room_name") String roomName,
|
@Query("room_name") String roomName,
|
||||||
@Query("golden_bean_number") String goldenBeanNumber,
|
@Query("golden_bean_number") String goldenBeanNumber,
|
||||||
@Query("currency_type") String currencyType,
|
@Query("currency_type") String currencyType,
|
||||||
|
@Query("activity_game") String isActivity,
|
||||||
@Query("game_id") String gameId);
|
@Query("game_id") String gameId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1344,4 +1346,12 @@ public interface PDLiveApi {
|
|||||||
@Query("gift_id")String giftId,
|
@Query("gift_id")String giftId,
|
||||||
@Query("live_uid")String liveUid
|
@Query("live_uid")String liveUid
|
||||||
);
|
);
|
||||||
|
@GET("/api/public/?service=Sudgameserver.ballClearanceTableStatus")
|
||||||
|
Observable<ResponseModel<BaseModel>> ballClearanceTableStatus(
|
||||||
|
@Query("room_id")String roomId
|
||||||
|
);
|
||||||
|
@GET("/api/public/?service=Sudgameserver.ballClearanceTableGetResultScore")
|
||||||
|
Observable<ResponseModel<List<SudActivityGameInfoBean>>> ballClearanceTableGetResultScore(
|
||||||
|
@Query("room_id")String roomId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -3,18 +3,21 @@ package com.yunbao.common.http.base;
|
|||||||
/**
|
/**
|
||||||
* maim的请求回调接口
|
* maim的请求回调接口
|
||||||
*/
|
*/
|
||||||
public interface HttpCallback<T> {
|
public abstract class HttpCallback<T> {
|
||||||
/**
|
/**
|
||||||
* 请求成功
|
* 请求成功
|
||||||
*
|
*
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
void onSuccess(T data);
|
public abstract void onSuccess(T data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求失败
|
* 请求失败
|
||||||
*
|
*
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void onError(String error);
|
public abstract void onError(String error);
|
||||||
|
public void onError(String error,int code){
|
||||||
|
onError(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,7 @@ import com.yunbao.common.bean.RoomMicStatusModel;
|
|||||||
import com.yunbao.common.bean.SendMoneyLongModel;
|
import com.yunbao.common.bean.SendMoneyLongModel;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
|
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudGameInfoBean;
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudGameScoreBean;
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
import com.yunbao.common.bean.SudGameUserModel;
|
import com.yunbao.common.bean.SudGameUserModel;
|
||||||
@ -2301,20 +2302,21 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取房间金豆门槛和赢家获得的金豆
|
* 获取房间金豆门槛和赢家获得的金豆
|
||||||
|
*
|
||||||
* @param roomId
|
* @param roomId
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public void getScore(String roomId,HttpCallback<SudGameScoreBean> callback){
|
public void getScore(String roomId, HttpCallback<SudGameScoreBean> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.getScore(roomId)
|
.getScore(roomId)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(sudGameScoreBeanResponseModel -> {
|
.subscribe(sudGameScoreBeanResponseModel -> {
|
||||||
if (callback != null){
|
if (callback != null) {
|
||||||
callback.onSuccess(sudGameScoreBeanResponseModel.getData().getInfo());
|
callback.onSuccess(sudGameScoreBeanResponseModel.getData().getInfo());
|
||||||
}
|
}
|
||||||
}, throwable -> {
|
}, throwable -> {
|
||||||
if (callback != null){
|
if (callback != null) {
|
||||||
callback.onError(mContext.getString(R.string.net_error));
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
@ -2322,28 +2324,43 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取游戏中所有玩家的信息
|
* 获取游戏中所有玩家的信息
|
||||||
|
*
|
||||||
* @param roomId
|
* @param roomId
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public void getSudGameInfo(String roomId,HttpCallback<List<SudGameInfoBean>> callback){
|
public void getSudGameInfo(String roomId, HttpCallback<List<SudGameInfoBean>> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.getSudGameInfo(roomId)
|
.getSudGameInfo(roomId)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(infoModel->{
|
.subscribe(infoModel -> {
|
||||||
if (callback != null){
|
if (callback != null) {
|
||||||
callback.onSuccess(infoModel.getData().getInfo());
|
callback.onSuccess(infoModel.getData().getInfo());
|
||||||
}
|
}
|
||||||
},throwable -> {
|
}, throwable -> {
|
||||||
if (callback != null){
|
if (callback != null) {
|
||||||
callback.onError(mContext.getString(R.string.net_error));
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, HttpCallback<CreateSudRoomModel> callback) {
|
||||||
|
createSudRoom(roomName, goldenBeanNumber, currencyType, gameId, false, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建游戏房
|
||||||
|
*
|
||||||
|
* @param roomName 房间名称
|
||||||
|
* @param goldenBeanNumber 游戏豆数量
|
||||||
|
* @param currencyType 货币类型
|
||||||
|
* @param gameId 游戏ID
|
||||||
|
* @param isActivityGame 是否是活动游戏
|
||||||
|
* @param callback 回调
|
||||||
|
*/
|
||||||
|
public void createSudRoom(String roomName, String goldenBeanNumber, String currencyType, String gameId, boolean isActivityGame, HttpCallback<CreateSudRoomModel> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.createSudRoom(roomName, goldenBeanNumber, currencyType, gameId)
|
.createSudRoom(roomName, goldenBeanNumber, currencyType, isActivityGame ? "1" : "0", gameId)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
.subscribe(new Consumer<ResponseModel<CreateSudRoomModel>>() {
|
||||||
@ -2353,7 +2370,7 @@ public class LiveNetManager {
|
|||||||
if (createSudRoomModelResponseModel.getData().getCode() == 0) {
|
if (createSudRoomModelResponseModel.getData().getCode() == 0) {
|
||||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||||
} else {
|
} else {
|
||||||
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
|
callback.onError(createSudRoomModelResponseModel.getData().getMsg(), createSudRoomModelResponseModel.getData().getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3061,9 +3078,9 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openGuard(String liveUid, String guardType, String priceKey, String stream,String coupon_type,String couponId, HttpCallback<String> callback) {
|
public void openGuard(String liveUid, String guardType, String priceKey, String stream, String coupon_type, String couponId, HttpCallback<String> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.openGuard(liveUid, guardType, priceKey, stream,coupon_type,couponId)
|
.openGuard(liveUid, guardType, priceKey, stream, coupon_type, couponId)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Consumer<ResponseModel<Object>>() {
|
.subscribe(new Consumer<ResponseModel<Object>>() {
|
||||||
@ -3572,9 +3589,9 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void userUseDress( String usersDressId, HttpCallback<HttpCallbackModel> callback) {
|
public void userUseDress(String usersDressId, HttpCallback<HttpCallbackModel> callback) {
|
||||||
API.get().pdLiveApi(mContext)
|
API.get().pdLiveApi(mContext)
|
||||||
.userUseDress(usersDressId,3)
|
.userUseDress(usersDressId, 3)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
||||||
@ -3596,6 +3613,44 @@ public class LiveNetManager {
|
|||||||
}
|
}
|
||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
public void ballClearanceTableStatus( String roomId, HttpCallback<BaseModel> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.ballClearanceTableStatus(roomId)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
public void ballClearanceTableGetResultScore( String roomId, HttpCallback<List<SudActivityGameInfoBean>> callback) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.ballClearanceTableGetResultScore(roomId)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(listResponseModel -> {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||||
|
}
|
||||||
|
}, new Consumer<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Throwable throwable) throws Exception {
|
||||||
|
throwable.printStackTrace();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(mContext.getString(R.string.net_error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
private MultipartBody.Part createUploadFile(File file) {
|
private MultipartBody.Part createUploadFile(File file) {
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
|
@ -0,0 +1,142 @@
|
|||||||
|
package com.yunbao.common.manager;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.style.ImageSpan;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.manager.game.AbsRandomGameManager;
|
||||||
|
import com.yunbao.common.manager.game.BilliardsRandomManager;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
public class RandomSudGameManager {
|
||||||
|
private static RandomSudGameManager manager;
|
||||||
|
private AbsRandomGameManager gameManager;
|
||||||
|
|
||||||
|
public static RandomSudGameManager getManager() {
|
||||||
|
if (manager == null) {
|
||||||
|
manager = new RandomSudGameManager();
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
private RandomSudGameManager() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start(CreateSudRoomModel data, boolean isHome) {
|
||||||
|
//TODO 等待五秒调用接口获取可以匹配的玩家
|
||||||
|
//TODO 五秒内没有玩家就自己创建
|
||||||
|
createRoom(data, isHome);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createRoom(CreateSudRoomModel data, boolean isHome) {
|
||||||
|
//TODO 创建房间五秒内没有其他玩家就上AI
|
||||||
|
LiveNetManager.get(AppManager.getInstance().getMainActivity())
|
||||||
|
.checkCurrency(new HttpCallback<CheckCurrencyModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(CheckCurrencyModel currencyModel) {
|
||||||
|
gameManager = new BilliardsRandomManager();
|
||||||
|
gameManager.onStart(currencyModel, data, isHome);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
if (gameManager != null) {
|
||||||
|
gameManager.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 游戏结算
|
||||||
|
*
|
||||||
|
* @return 返回true则用默认的结算弹框
|
||||||
|
*/
|
||||||
|
public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) {
|
||||||
|
if (gameManager == null) return true;
|
||||||
|
return gameManager.onGameMGCommonGameSettle(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台球状态
|
||||||
|
*/
|
||||||
|
public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) {
|
||||||
|
if (gameManager != null) {
|
||||||
|
gameManager.onGameMGCommonGameBilliardsHitState(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showNotActivityTicketDialog(Context mContext) {
|
||||||
|
showNotActivityTicketDialog(mContext, false, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showNotActivityTicketDialog(Context mContext, boolean isAudience, DialogUitl.SimpleCallback2 simpleCallback) {
|
||||||
|
String text = WordUtil.isNewZh() ? "您的$不足,快去獲取門票吧~" : "Your$is not enough, go and get tickets~";
|
||||||
|
SpannableString ss = new SpannableString(text);
|
||||||
|
ImageSpan image = new ImageSpan(mContext, R.mipmap.ic_game_ticket);
|
||||||
|
ss.setSpan(image, text.indexOf("$"), text.indexOf("$") + 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
|
||||||
|
DialogUitl.Builder builder = new DialogUitl.Builder(mContext)
|
||||||
|
.setTitle(WordUtil.isNewZh() ? "提示" : "Hint")
|
||||||
|
.setHtmlCode(ss)
|
||||||
|
.setShowConfirmButton(true)
|
||||||
|
.setShowCancelButton(true);
|
||||||
|
if (isAudience) {
|
||||||
|
builder.setCancelString(WordUtil.isNewZh() ? "僅觀戰" : "Watch the game");
|
||||||
|
}
|
||||||
|
builder.setConfirmString(WordUtil.isNewZh() ? "獲取" : "Obtain");
|
||||||
|
builder.setSimpleCallbackView(new DialogUitl.SimpleCallbackView() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShow(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
|
||||||
|
dialog.dismiss();
|
||||||
|
if (simpleCallback != null) {
|
||||||
|
simpleCallback.onConfirmClick(dialog, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel(Dialog dialog, View title, View context, View confirmBtn, View cancelBtn) {
|
||||||
|
dialog.dismiss();
|
||||||
|
if (simpleCallback != null) {
|
||||||
|
simpleCallback.onCancelClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build()
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onInitGame(CreateSudRoomModel mCreateSudRoomModel) {
|
||||||
|
if (gameManager == null) {
|
||||||
|
gameManager = new BilliardsRandomManager();
|
||||||
|
gameManager.onStart(null, mCreateSudRoomModel, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onGameState(CheckRemainingBalanceEvent event) {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.yunbao.common.manager.game;
|
||||||
|
|
||||||
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
|
||||||
|
public abstract class AbsRandomGameManager {
|
||||||
|
protected CreateSudRoomModel data;
|
||||||
|
public abstract void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome);
|
||||||
|
public abstract void reset();
|
||||||
|
public abstract void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model);
|
||||||
|
public abstract boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) ;
|
||||||
|
}
|
@ -0,0 +1,130 @@
|
|||||||
|
package com.yunbao.common.manager.game;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
|
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||||
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
|
public class BilliardsRandomManager extends AbsRandomGameManager {
|
||||||
|
int isOneOverForMy = -1;//自己是否一杆清台
|
||||||
|
int isOneOverForOther = -1;//对方是否一杆清台
|
||||||
|
int comboNumberForMy = 0;//自己连杆数
|
||||||
|
int comboNumberForOther = 0;//对方连杆数
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart(CheckCurrencyModel currencyModel, CreateSudRoomModel data, boolean isHome) {
|
||||||
|
this.data = data;
|
||||||
|
if (currencyModel == null) return;
|
||||||
|
if (isHome) {
|
||||||
|
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(data), true, true);
|
||||||
|
} else {
|
||||||
|
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data).setActivityGame(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
isOneOverForMy = -1;
|
||||||
|
isOneOverForOther = -1;
|
||||||
|
comboNumberForMy = 0;
|
||||||
|
comboNumberForOther = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) {
|
||||||
|
ToastUtil.show("台球状态:" + model.state);
|
||||||
|
if (Integer.parseInt(model.uid) == IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo().getId()) {
|
||||||
|
isOneOverForOther = 0;
|
||||||
|
if (isOneOverForMy == -1) {
|
||||||
|
isOneOverForMy = 1;
|
||||||
|
}
|
||||||
|
if (model.state == 13 && comboNumberForMy == 0) {
|
||||||
|
comboNumberForMy = 1;
|
||||||
|
} else if (model.state >= 2 && model.state <= 7) {
|
||||||
|
if (model.state > comboNumberForMy) {
|
||||||
|
comboNumberForMy = model.state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isOneOverForMy == 1) {
|
||||||
|
onSendNotOneOver();
|
||||||
|
}
|
||||||
|
isOneOverForMy = 0;
|
||||||
|
if (isOneOverForOther == -1) {
|
||||||
|
isOneOverForOther = 1;
|
||||||
|
}
|
||||||
|
if (model.state == 13 && comboNumberForOther == 0) {
|
||||||
|
comboNumberForOther = 1;
|
||||||
|
} else if (model.state >= 2 && model.state <= 7) {
|
||||||
|
if (model.state > comboNumberForOther) {
|
||||||
|
comboNumberForOther = model.state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) {
|
||||||
|
System.out.println("游戏结束 :" + isOneOverForMy + "|" + comboNumberForMy);
|
||||||
|
if (isOneOverForMy == 1 && comboNumberForMy > 1) {
|
||||||
|
ToastUtil.show("一杆清");
|
||||||
|
} else if (comboNumberForMy > 0) {
|
||||||
|
ToastUtil.show("连杆:" + comboNumberForMy);
|
||||||
|
switch (comboNumberForMy) {
|
||||||
|
case 1:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_5);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_6);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_7);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Bus.get().post(new CheckRemainingBalanceEvent()
|
||||||
|
.setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE)
|
||||||
|
.setActivityGame(true)
|
||||||
|
.setMgCommonGameSettle(model));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onSendNotOneOver() {
|
||||||
|
LiveNetManager.get(AppManager.getInstance().getMainActivity())
|
||||||
|
.ballClearanceTableStatus(data.getSudGameRoomId(), new HttpCallback<BaseModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(BaseModel data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,8 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.BuildConfig;
|
import com.yunbao.common.BuildConfig;
|
||||||
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
|
import com.yunbao.common.manager.RandomSudGameManager;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
||||||
@ -19,6 +21,7 @@ import com.yunbao.common.sud.model.GameConfigModel;
|
|||||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||||
import com.yunbao.common.sud.state.MGStateResponse;
|
import com.yunbao.common.sud.state.MGStateResponse;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.SudJsonUtils;
|
import com.yunbao.common.utils.SudJsonUtils;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@ -127,7 +130,8 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
public void onFailure(int errCode, String errMsg) {
|
public void onFailure(int errCode, String errMsg) {
|
||||||
// TODO: 2022/6/13 下面toast可以根据业务需要决定是否保留
|
// TODO: 2022/6/13 下面toast可以根据业务需要决定是否保留
|
||||||
if (isTestEnv()) {
|
if (isTestEnv()) {
|
||||||
Toast.makeText(activity, "initSDK onFailure:" + errMsg + "(" + errCode + ")", Toast.LENGTH_LONG).show();
|
//Toast.makeText(activity, "initSDK onFailure:" + errMsg + "(" + errCode + ")", Toast.LENGTH_LONG).show();
|
||||||
|
ToastUtil.show("initSDK onFailure:" + errMsg + "(" + errCode + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
delayLoadGame(activity, gameId);
|
delayLoadGame(activity, gameId);
|
||||||
@ -491,7 +495,17 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
|
public void onGameMGCommonGameSettle(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameSettle model) {
|
||||||
LogUtils.e("yqw=====>"+model);
|
LogUtils.e("yqw=====>"+model);
|
||||||
|
if(RandomSudGameManager.getManager().onGameMGCommonGameSettle(model)){
|
||||||
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(model));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台球回调
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onGameMGCommonGameBilliardsHitState(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameBilliardsHitState model) {
|
||||||
|
SudFSMMGListener.super.onGameMGCommonGameBilliardsHitState(handle, model);
|
||||||
|
RandomSudGameManager.getManager().onGameMGCommonGameBilliardsHitState(model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import com.yunbao.common.sud.model.GameConfigModel;
|
|||||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -74,7 +75,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
||||||
private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励
|
private SudGameScoreBean sudGameScoreBean;//房间金豆的门槛和赢家奖励
|
||||||
private List<SudGameInfoBean> sudGameInfoBeanList = new ArrayList<>();//玩家信息
|
private List<SudGameInfoBean> sudGameInfoBeanList = new ArrayList<>();//玩家信息
|
||||||
public final MutableLiveData<List<SudSettleBean>> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
|
public final MutableLiveData<SudMGPMGState.MGCommonGameSettle> listMutableLiveData = new MutableLiveData<>();//玩家排名信息
|
||||||
|
|
||||||
public void setSudGameInfoBeanList(List<SudGameInfoBean> sudGameInfoBeanList) {
|
public void setSudGameInfoBeanList(List<SudGameInfoBean> sudGameInfoBeanList) {
|
||||||
this.sudGameInfoBeanList = sudGameInfoBeanList;
|
this.sudGameInfoBeanList = sudGameInfoBeanList;
|
||||||
@ -94,7 +95,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
||||||
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (WordUtil.isNewZh()) {
|
||||||
languageCode = "zh-TW";
|
languageCode = "zh-TW";
|
||||||
} else {
|
} else {
|
||||||
languageCode = "en-US";
|
languageCode = "en-US";
|
||||||
@ -203,27 +204,29 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
String uid = playerResult.uid;
|
String uid = playerResult.uid;
|
||||||
int rank = playerResult.rank;
|
int rank = playerResult.rank;
|
||||||
SudGameInfoBean sudGameInfoBean = findGameInfoBean(uid);
|
SudGameInfoBean sudGameInfoBean = findGameInfoBean(uid);
|
||||||
|
System.out.println("查找游戏信息" + sudGameInfoBean);
|
||||||
if (sudGameInfoBean == null) return;
|
if (sudGameInfoBean == null) return;
|
||||||
|
|
||||||
if (sudGameScoreBean.getGame_mode() == 1) {
|
if (sudGameScoreBean.getGame_mode() == 1) {
|
||||||
//双人游戏
|
//双人游戏
|
||||||
if (winnerNUm == 1){
|
if (winnerNUm == 1) {
|
||||||
winNum = (rank == 1) ? (int) (sudGameScoreBean.getRoom_sill() * 0.8) : -sudGameScoreBean.getRoom_sill();
|
winNum = (rank == 1) ? (int) (sudGameScoreBean.getRoom_sill() * 0.8) : -sudGameScoreBean.getRoom_sill();
|
||||||
}else {
|
} else {
|
||||||
winNum = -sudGameScoreBean.getRoom_ticket();
|
winNum = -sudGameScoreBean.getRoom_ticket();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//多人游戏
|
//多人游戏
|
||||||
if (rank == 1){
|
if (rank == 1) {
|
||||||
winNum = (playerNum*sudGameScoreBean.getRoom_win_num()-winnerNUm*sudGameScoreBean.getRoom_sill())/winnerNUm;
|
winNum = (playerNum * sudGameScoreBean.getRoom_win_num() - winnerNUm * sudGameScoreBean.getRoom_sill()) / winnerNUm;
|
||||||
}else {
|
} else {
|
||||||
winNum = -sudGameScoreBean.getRoom_sill();
|
winNum = -sudGameScoreBean.getRoom_sill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settleBeans.add(new SudSettleBean(uid,sudGameInfoBean.getNick_name(),sudGameInfoBean.getAvatar_url(),rank,winNum));
|
settleBeans.add(new SudSettleBean(uid, sudGameInfoBean.getNick_name(), sudGameInfoBean.getAvatar_url(), rank, winNum));
|
||||||
}
|
}
|
||||||
|
mgCommonGameSettle.sudSettleBeans = settleBeans;
|
||||||
// 更新LiveData
|
// 更新LiveData
|
||||||
listMutableLiveData.setValue(settleBeans);
|
listMutableLiveData.setValue(mgCommonGameSettle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 统计第一名的玩家数量
|
// 统计第一名的玩家数量
|
||||||
|
@ -10,7 +10,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.blankj.utilcode.util.LogUtils;
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||||
|
import com.yunbao.common.manager.RandomSudGameManager;
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||||
import com.yunbao.common.utils.SudJsonUtils;
|
import com.yunbao.common.utils.SudJsonUtils;
|
||||||
@ -178,7 +180,6 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
} else {
|
} else {
|
||||||
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
listener.onGameMGCommonGameSettle(handle, mgCommonGameSettle);
|
||||||
}
|
}
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_SETTLE).setMgCommonGameSettle(mgCommonGameSettle));
|
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN: // 4. 加入游戏按钮点击状态
|
||||||
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
|
SudMGPMGState.MGCommonSelfClickJoinBtn mgCommonSelfClickJoinBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickJoinBtn.class);
|
||||||
@ -216,6 +217,12 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN: // 8. 开始游戏按钮点击状态
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN: // 8. 开始游戏按钮点击状态
|
||||||
SudMGPMGState.MGCommonSelfClickStartBtn mgCommonSelfClickStartBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickStartBtn.class);
|
SudMGPMGState.MGCommonSelfClickStartBtn mgCommonSelfClickStartBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickStartBtn.class);
|
||||||
|
AppManager.runDebugCode(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
RandomSudGameManager.getManager().reset();
|
||||||
|
}
|
||||||
|
});
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN));
|
||||||
// if (listener == null) {
|
// if (listener == null) {
|
||||||
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
// ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
@ -533,6 +540,102 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
listener.onGameMGCommonHideGameScene(handle, mgCommonHideGameScene);
|
listener.onGameMGCommonHideGameScene(handle, mgCommonHideGameScene);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_GOLD_BTN: // 46. 通知app点击了游戏的金币按钮(赛车)
|
||||||
|
SudMGPMGState.MGCommonSelfClickGoldBtn mgCommonSelfClickGoldBtn = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonSelfClickGoldBtn.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonSelfClickGoldBtn(handle, mgCommonSelfClickGoldBtn);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PIECE_ARRIVE_END: // 47. 通知app棋子到达终点(ludo)
|
||||||
|
SudMGPMGState.MGCommonGamePieceArriveEnd mgCommonGamePieceArriveEnd = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePieceArriveEnd.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePieceArriveEnd(handle, mgCommonGamePieceArriveEnd);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PLAYER_MANAGED_STATE: // 48. 通知app玩家是否托管
|
||||||
|
SudMGPMGState.MGCommonGamePlayerManagedState mgCommonGamePlayerManagedState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerManagedState.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePlayerManagedState(handle, mgCommonGamePlayerManagedState);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_SEND_BURST_WORD: // 49. 游戏向app发送爆词
|
||||||
|
SudMGPMGState.MGCommonGameSendBurstWord mgCommonGameSendBurstWord = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameSendBurstWord.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGameSendBurstWord(handle, mgCommonGameSendBurstWord);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PLAYER_RANKS: // 50. 游戏向app发送玩家实时排名(只支持怪物消消乐)
|
||||||
|
SudMGPMGState.MGCommonGamePlayerRanks mgCommonGamePlayerRanks = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerRanks.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePlayerRanks(handle, mgCommonGamePlayerRanks);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PLAYER_PAIR_SINGULAR: // 51. 游戏向app发送玩家即时变化的单双牌(只支持okey101)
|
||||||
|
SudMGPMGState.MGCommonGamePlayerPairSingular mgCommonGamePlayerPairSingular = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerPairSingular.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePlayerPairSingular(handle, mgCommonGamePlayerPairSingular);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PLAYER_MONOPOLY_CARDS: // 52. 游戏向app发送获取玩家持有的道具卡(只支持大富翁)
|
||||||
|
SudMGPMGState.MGCommonGamePlayerMonopolyCards mgCommonGamePlayerMonopolyCards = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerMonopolyCards.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePlayerMonopolyCards(handle, mgCommonGamePlayerMonopolyCards);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PLAYER_SCORES: // 53. 游戏向app发送玩家实时积分(只支持怪物消消乐)
|
||||||
|
SudMGPMGState.MGCommonGamePlayerScores mgCommonGamePlayerScores = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerScores.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePlayerScores(handle, mgCommonGamePlayerScores);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_DESTROY_GAME_SCENE: // 54. 游戏通知app销毁游戏(只支持部分概率类游戏)
|
||||||
|
SudMGPMGState.MGCommonDestroyGameScene mgCommonDestroyGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonDestroyGameScene.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonDestroyGameScene(handle, mgCommonDestroyGameScene);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_BILLIARDS_HIT_STATE: // 55. 游戏通知app击球状态(只支持桌球)
|
||||||
|
SudMGPMGState.MGCommonGameBilliardsHitState mgCommonGameBilliardsHitState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameBilliardsHitState.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGameBilliardsHitState(handle, mgCommonGameBilliardsHitState);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_PLAYER_PROPS_CARDS: // 56. 游戏向app发送获取玩家持有的指定点数道具卡(只支持飞行棋)
|
||||||
|
SudMGPMGState.MGCommonGamePlayerPropsCards mgCommonGamePlayerPropsCards = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGamePlayerPropsCards.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGamePlayerPropsCards(handle, mgCommonGamePlayerPropsCards);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_COMMON_GAME_INFO_X: // 57. 游戏向app发送获游戏通用数据
|
||||||
|
SudMGPMGState.MGCommonGameInfoX mgCommonGameInfoX = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameInfoX.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCommonGameInfoX(handle, mgCommonGameInfoX);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_DISCO_ACTION: // 1. 元宇宙砂砂舞指令回调
|
case SudMGPMGState.MG_COMMON_GAME_DISCO_ACTION: // 1. 元宇宙砂砂舞指令回调
|
||||||
SudMGPMGState.MGCommonGameDiscoAction mgCommonGameDiscoAction = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameDiscoAction.class);
|
SudMGPMGState.MGCommonGameDiscoAction mgCommonGameDiscoAction = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameDiscoAction.class);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
@ -749,39 +852,15 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
listener.onGameMGCustomRocketSaveSignColor(handle, mgCustomRocketSaveSignColor);
|
listener.onGameMGCustomRocketSaveSignColor(handle, mgCustomRocketSaveSignColor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_BASEBALL_RANKING: // 1. 查询排行榜数据(棒球)
|
case SudMGPMGState.MG_BASEBALL_DEFUALT_STATE: // 1. 设置界面默认状态(棒球)
|
||||||
SudMGPMGState.MGBaseballRanking mgBaseballRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRanking.class);
|
SudMGPMGState.MGBaseballDefaultState mgBaseballDefaultState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballDefaultState.class);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
} else {
|
} else {
|
||||||
listener.onGameMGBaseballRanking(handle, mgBaseballRanking);
|
listener.onGameMGBaseballDefaultState(handle, mgBaseballDefaultState);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_BASEBALL_MY_RANKING: // 2. 查询我的排名(棒球)
|
case SudMGPMGState.MG_BASEBALL_PREPARE_FINISH: // 2. 前期准备完成(棒球)
|
||||||
SudMGPMGState.MGBaseballMyRanking mgBaseballMyRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballMyRanking.class);
|
|
||||||
if (listener == null) {
|
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
|
||||||
} else {
|
|
||||||
listener.onGameMGBaseballMyRanking(handle, mgBaseballMyRanking);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SudMGPMGState.MG_BASEBALL_RANGE_INFO: // 3. 查询当前距离我的前后玩家数据(棒球)
|
|
||||||
SudMGPMGState.MGBaseballRangeInfo mgBaseballRangeInfo = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRangeInfo.class);
|
|
||||||
if (listener == null) {
|
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
|
||||||
} else {
|
|
||||||
listener.onGameMGBaseballRangeInfo(handle, mgBaseballRangeInfo);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SudMGPMGState.MG_BASEBALL_SET_CLICK_RECT: // 4. 设置app提供给游戏可点击区域(棒球)
|
|
||||||
SudMGPMGState.MGBaseballSetClickRect mgBaseballSetClickRect = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSetClickRect.class);
|
|
||||||
if (listener == null) {
|
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
|
||||||
} else {
|
|
||||||
listener.onGameMGBaseballSetClickRect(handle, mgBaseballSetClickRect);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SudMGPMGState.MG_BASEBALL_PREPARE_FINISH: // 5. 前期准备完成(棒球)
|
|
||||||
SudMGPMGState.MGBaseballPrepareFinish mgBaseballPrepareFinish = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballPrepareFinish.class);
|
SudMGPMGState.MGBaseballPrepareFinish mgBaseballPrepareFinish = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballPrepareFinish.class);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
@ -789,7 +868,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
listener.onGameMGBaseballPrepareFinish(handle, mgBaseballPrepareFinish);
|
listener.onGameMGBaseballPrepareFinish(handle, mgBaseballPrepareFinish);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_BASEBALL_SHOW_GAME_SCENE: // 6. 主界面已显示(棒球)
|
case SudMGPMGState.MG_BASEBALL_SHOW_GAME_SCENE: // 3. 主界面已显示(棒球)
|
||||||
SudMGPMGState.MGBaseballShowGameScene mgBaseballShowGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballShowGameScene.class);
|
SudMGPMGState.MGBaseballShowGameScene mgBaseballShowGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballShowGameScene.class);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
@ -797,7 +876,7 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
listener.onGameMGBaseballShowGameScene(handle, mgBaseballShowGameScene);
|
listener.onGameMGBaseballShowGameScene(handle, mgBaseballShowGameScene);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_BASEBALL_HIDE_GAME_SCENE: // 7. 主界面已隐藏(棒球)
|
case SudMGPMGState.MG_BASEBALL_HIDE_GAME_SCENE: // 4. 主界面已隐藏(棒球)
|
||||||
SudMGPMGState.MGBaseballHideGameScene mgBaseballHideGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballHideGameScene.class);
|
SudMGPMGState.MGBaseballHideGameScene mgBaseballHideGameScene = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballHideGameScene.class);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
@ -805,7 +884,39 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
listener.onGameMGBaseballHideGameScene(handle, mgBaseballHideGameScene);
|
listener.onGameMGBaseballHideGameScene(handle, mgBaseballHideGameScene);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_BASEBALL_TEXT_CONFIG: // 8. 获取文本配置数据(棒球)
|
case SudMGPMGState.MG_BASEBALL_RANKING: // 5. 查询排行榜数据(棒球)
|
||||||
|
SudMGPMGState.MGBaseballRanking mgBaseballRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRanking.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGBaseballRanking(handle, mgBaseballRanking);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_BASEBALL_MY_RANKING: // 6. 查询我的排名(棒球)
|
||||||
|
SudMGPMGState.MGBaseballMyRanking mgBaseballMyRanking = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballMyRanking.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGBaseballMyRanking(handle, mgBaseballMyRanking);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_BASEBALL_RANGE_INFO: // 7. 查询当前距离我的前后玩家数据(棒球)
|
||||||
|
SudMGPMGState.MGBaseballRangeInfo mgBaseballRangeInfo = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballRangeInfo.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGBaseballRangeInfo(handle, mgBaseballRangeInfo);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_BASEBALL_SET_CLICK_RECT: // 8. 设置app提供给游戏可点击区域(棒球)
|
||||||
|
SudMGPMGState.MGBaseballSetClickRect mgBaseballSetClickRect = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSetClickRect.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGBaseballSetClickRect(handle, mgBaseballSetClickRect);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_BASEBALL_TEXT_CONFIG: // 9. 获取文本配置数据(棒球)
|
||||||
SudMGPMGState.MGBaseballTextConfig mgBaseballTextConfig = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballTextConfig.class);
|
SudMGPMGState.MGBaseballTextConfig mgBaseballTextConfig = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballTextConfig.class);
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
@ -813,6 +924,30 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
listener.onGameMGBaseballTextConfig(handle, mgBaseballTextConfig);
|
listener.onGameMGBaseballTextConfig(handle, mgBaseballTextConfig);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SudMGPMGState.MG_BASEBALL_SEND_DISTANCE: // 10. 球落地, 通知距离(棒球)
|
||||||
|
SudMGPMGState.MGBaseballSendDistance mgBaseballSendDistance = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGBaseballSendDistance.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGBaseballSendDistance(handle, mgBaseballSendDistance);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_CUSTOM_CR_ROOM_INIT_DATA: // 1. 请求房间数据
|
||||||
|
SudMGPMGState.MGCustomCrRoomInitData mgCustomCrRoomInitData = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCustomCrRoomInitData.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCustomCrRoomInitData(handle, mgCustomCrRoomInitData);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SudMGPMGState.MG_CUSTOM_CR_CLICK_SEAT: // 2. 点击主播位或老板位通知
|
||||||
|
SudMGPMGState.MGCustomCrClickSeat mgCustomCrClickSeat = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCustomCrClickSeat.class);
|
||||||
|
if (listener == null) {
|
||||||
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
|
} else {
|
||||||
|
listener.onGameMGCustomCrClickSeat(handle, mgCustomCrClickSeat);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
break;
|
break;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,8 @@
|
|||||||
package com.yunbao.common.sud.state;
|
package com.yunbao.common.sud.state;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||||
|
import com.yunbao.common.bean.SudSettleBean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -113,6 +115,24 @@ public class SudMGPMGState implements Serializable {
|
|||||||
|
|
||||||
@SerializedName(value = "tr-TR")
|
@SerializedName(value = "tr-TR")
|
||||||
public String tr_TR; // 土耳其语
|
public String tr_TR; // 土耳其语
|
||||||
|
|
||||||
|
@SerializedName(value = "pt-PT")
|
||||||
|
public String pt_PT; // 葡萄语
|
||||||
|
|
||||||
|
@SerializedName(value = "hi-IN")
|
||||||
|
public String hi_IN; // 印地语
|
||||||
|
|
||||||
|
@SerializedName(value = "bn-BD")
|
||||||
|
public String bn_BD; // 孟加拉语
|
||||||
|
|
||||||
|
@SerializedName(value = "tl-PH")
|
||||||
|
public String tl_PH; // 塔加路语(菲律宾)
|
||||||
|
|
||||||
|
@SerializedName(value = "fa-IR")
|
||||||
|
public String fa_IR; // 波斯语(伊朗)
|
||||||
|
|
||||||
|
@SerializedName(value = "ru-RU")
|
||||||
|
public String ru_RU; // 俄罗斯语
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MGCommonPublicMessageMsgUser implements Serializable {
|
public static class MGCommonPublicMessageMsgUser implements Serializable {
|
||||||
@ -169,7 +189,9 @@ public class SudMGPMGState implements Serializable {
|
|||||||
|
|
||||||
// 游戏结果玩家列表
|
// 游戏结果玩家列表
|
||||||
public List<PlayerResult> results;
|
public List<PlayerResult> results;
|
||||||
|
public List<SudActivityGameInfoBean> activityGameInfoBean;
|
||||||
|
public List<SudSettleBean> sudSettleBeans;
|
||||||
|
public String achievement;
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MGCommonGameSettle{" +
|
return "MGCommonGameSettle{" +
|
||||||
@ -790,6 +812,178 @@ public class SudMGPMGState implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public static class MGCommonHideGameScene implements Serializable {
|
public static class MGCommonHideGameScene implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 46. 通知app点击了游戏的金币按钮(赛车)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_SELF_CLICK_GOLD_BTN = "mg_common_self_click_gold_btn";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 46. 通知app点击了游戏的金币按钮(赛车) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonSelfClickGoldBtn implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 47. 通知app棋子到达终点(ludo)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PIECE_ARRIVE_END = "mg_common_game_piece_arrive_end";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 47. 通知app棋子到达终点(ludo) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePieceArriveEnd implements Serializable {
|
||||||
|
public String uid; // 玩家id
|
||||||
|
public int pieceIndex; // 棋子编号 0 ~ 3
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 48. 通知app玩家是否托管
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PLAYER_MANAGED_STATE = "mg_common_game_player_managed_state";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 48. 通知app玩家是否托管 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePlayerManagedState implements Serializable {
|
||||||
|
public String uid; // 玩家id
|
||||||
|
public int managed; // 0: 未托管 1:托管
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 49. 游戏向app发送爆词
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_SEND_BURST_WORD = "mg_common_game_send_burst_word";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 49. 游戏向app发送爆词 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGameSendBurstWord implements Serializable {
|
||||||
|
public String text; // 爆词
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 50. 游戏向app发送玩家实时排名(只支持怪物消消乐)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PLAYER_RANKS = "mg_common_game_player_ranks";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 50. 游戏向app发送玩家实时排名(只支持怪物消消乐) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePlayerRanks implements Serializable {
|
||||||
|
public List<RanksModel> ranks; // 所有玩家排名变化推送
|
||||||
|
|
||||||
|
public static class RanksModel implements Serializable {
|
||||||
|
public String uid; // 用户id
|
||||||
|
public int rank; // 排名
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 51. 游戏向app发送玩家即时变化的单双牌(只支持okey101)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PLAYER_PAIR_SINGULAR = "mg_common_game_player_pair_singular";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 51. 游戏向app发送玩家即时变化的单双牌(只支持okey101) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePlayerPairSingular implements Serializable {
|
||||||
|
public List<SingularModel> pairs; // 玩家单双牌推送
|
||||||
|
|
||||||
|
public static class SingularModel implements Serializable {
|
||||||
|
public String uid; // 用户id
|
||||||
|
public int pair; // pair: 1 双,0 单
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 52. 游戏向app发送获取玩家持有的道具卡(只支持大富翁)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PLAYER_MONOPOLY_CARDS = "mg_common_game_player_monopoly_cards";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 52. 游戏向app发送获取玩家持有的道具卡(只支持大富翁) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePlayerMonopolyCards implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 53. 游戏向app发送玩家实时积分(只支持怪物消消乐)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PLAYER_SCORES = "mg_common_game_player_scores";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 53. 游戏向app发送玩家实时积分(只支持怪物消消乐) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePlayerScores implements Serializable {
|
||||||
|
public List<ScoresModel> scores; // 所有玩家积分变化推送
|
||||||
|
|
||||||
|
public static class ScoresModel implements Serializable {
|
||||||
|
public String uid; // 用户id
|
||||||
|
public int score; // 积分
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 54. 游戏通知app销毁游戏(只支持部分概率类游戏)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_DESTROY_GAME_SCENE = "mg_common_destroy_game_scene";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 54. 游戏通知app销毁游戏(只支持部分概率类游戏) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonDestroyGameScene implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 55. 游戏通知app击球状态(只支持桌球)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_BILLIARDS_HIT_STATE = "mg_common_game_billiards_hit_state";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 55. 游戏通知app击球状态(只支持桌球) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGameBilliardsHitState implements Serializable {
|
||||||
|
public String uid; // 操作玩家的id
|
||||||
|
/**
|
||||||
|
* state状态说明:
|
||||||
|
* 0: 母球击空或者第一击没击中目标球
|
||||||
|
* 2-7: 连杆
|
||||||
|
* 8: 白球进洞
|
||||||
|
* 9: 没有足够的撞库数量
|
||||||
|
* 10: 开球时进了黑八
|
||||||
|
* 11: 提前进了黑八
|
||||||
|
* 12: 没有有效进球
|
||||||
|
* 13: 有有效进球
|
||||||
|
* 14: 超时
|
||||||
|
*/
|
||||||
|
public int state;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 56. 游戏向app发送获取玩家持有的指定点数道具卡(只支持飞行棋)
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_PLAYER_PROPS_CARDS = "mg_common_game_player_props_cards";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 56. 游戏向app发送获取玩家持有的指定点数道具卡(只支持飞行棋) 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGamePlayerPropsCards implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 57. 游戏向app发送获游戏通用数据
|
||||||
|
*/
|
||||||
|
public static final String MG_COMMON_GAME_INFO_X = "mg_common_game_info_x";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 57. 游戏向app发送获游戏通用数据 模型
|
||||||
|
*/
|
||||||
|
public static class MGCommonGameInfoX implements Serializable {
|
||||||
|
public String eventName; // 事件名称 ,(注:具体游戏参考如下)
|
||||||
|
public String data; // 具体的数据,为一个JSON字符串, (注:具体游戏参考如下)
|
||||||
|
}
|
||||||
|
|
||||||
// endregion 通用状态-游戏
|
// endregion 通用状态-游戏
|
||||||
|
|
||||||
// region MG状态机-通用状态-玩家
|
// region MG状态机-通用状态-玩家
|
||||||
@ -1078,6 +1272,7 @@ public class SudMGPMGState implements Serializable {
|
|||||||
public static final class MGCommonGameDiscoAction implements Serializable {
|
public static final class MGCommonGameDiscoAction implements Serializable {
|
||||||
public int actionId; // 指令序号类型
|
public int actionId; // 指令序号类型
|
||||||
public boolean isSuccess; // true 指令成功,false 指令失败
|
public boolean isSuccess; // true 指令成功,false 指令失败
|
||||||
|
public int errCode; // 返回码
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1426,13 +1621,60 @@ public class SudMGPMGState implements Serializable {
|
|||||||
|
|
||||||
// region 棒球
|
// region 棒球
|
||||||
/**
|
/**
|
||||||
* 1. 查询排行榜数据(棒球)
|
* 1. 设置界面默认状态(棒球)
|
||||||
|
*/
|
||||||
|
public static final String MG_BASEBALL_DEFUALT_STATE = "mg_baseball_defualt_state";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. 设置界面默认状态(棒球) 模型
|
||||||
|
*/
|
||||||
|
public static final class MGBaseballDefaultState implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2. 前期准备完成(棒球)
|
||||||
|
* 游戏客户端通知APP指令动作前期准备完成
|
||||||
|
*/
|
||||||
|
public static final String MG_BASEBALL_PREPARE_FINISH = "mg_baseball_prepare_finish";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2. 前期准备完成(棒球) 模型
|
||||||
|
*/
|
||||||
|
public static final class MGBaseballPrepareFinish implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3. 主界面已显示(棒球)
|
||||||
|
* 游戏客户端通知APP指令动作主界面已显示
|
||||||
|
*/
|
||||||
|
public static final String MG_BASEBALL_SHOW_GAME_SCENE = "mg_baseball_show_game_scene";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3. 主界面已显示(棒球) 模型
|
||||||
|
*/
|
||||||
|
public static final class MGBaseballShowGameScene implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4. 主界面已隐藏(棒球)
|
||||||
|
* 游戏客户端通知APP指令动作主界面已隐藏
|
||||||
|
*/
|
||||||
|
public static final String MG_BASEBALL_HIDE_GAME_SCENE = "mg_baseball_hide_game_scene";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4. 主界面已隐藏(棒球) 模型
|
||||||
|
*/
|
||||||
|
public static final class MGBaseballHideGameScene implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5. 查询排行榜数据(棒球)
|
||||||
* 游戏客户端通知APP查询排行榜数据
|
* 游戏客户端通知APP查询排行榜数据
|
||||||
*/
|
*/
|
||||||
public static final String MG_BASEBALL_RANKING = "mg_baseball_ranking";
|
public static final String MG_BASEBALL_RANKING = "mg_baseball_ranking";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1. 查询排行榜数据(棒球) 模型
|
* 5. 查询排行榜数据(棒球) 模型
|
||||||
*/
|
*/
|
||||||
public static final class MGBaseballRanking implements Serializable {
|
public static final class MGBaseballRanking implements Serializable {
|
||||||
public int page; // 页数
|
public int page; // 页数
|
||||||
@ -1440,89 +1682,65 @@ public class SudMGPMGState implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2. 查询我的排名(棒球)
|
* 6. 查询我的排名(棒球)
|
||||||
* 游戏客户端通知APP查询我的排名
|
* 游戏客户端通知APP查询我的排名
|
||||||
*/
|
*/
|
||||||
public static final String MG_BASEBALL_MY_RANKING = "mg_baseball_my_ranking";
|
public static final String MG_BASEBALL_MY_RANKING = "mg_baseball_my_ranking";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2. 查询我的排名(棒球) 模型
|
* 6. 查询我的排名(棒球) 模型
|
||||||
*/
|
*/
|
||||||
public static final class MGBaseballMyRanking implements Serializable {
|
public static final class MGBaseballMyRanking implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 3. 查询当前距离我的前后玩家数据(棒球)
|
* 7. 查询当前距离我的前后玩家数据(棒球)
|
||||||
* 游戏客户端通知APP查询当前距离我的前后玩家数据(需要排除自己)
|
* 游戏客户端通知APP查询当前距离我的前后玩家数据(需要排除自己)
|
||||||
*/
|
*/
|
||||||
public static final String MG_BASEBALL_RANGE_INFO = "mg_baseball_range_info";
|
public static final String MG_BASEBALL_RANGE_INFO = "mg_baseball_range_info";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 3. 查询当前距离我的前后玩家数据(棒球) 模型
|
* 7. 查询当前距离我的前后玩家数据(棒球) 模型
|
||||||
*/
|
*/
|
||||||
public static final class MGBaseballRangeInfo implements Serializable {
|
public static final class MGBaseballRangeInfo implements Serializable {
|
||||||
public long distance; // 自己当前的距离
|
public long distance; // 自己当前的距离
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4. 设置app提供给游戏可点击区域(棒球)
|
* 8. 设置app提供给游戏可点击区域(棒球)
|
||||||
* 游戏客户端通知APP指令动作设置点击区域
|
* 游戏客户端通知APP指令动作设置点击区域
|
||||||
*/
|
*/
|
||||||
public static final String MG_BASEBALL_SET_CLICK_RECT = "mg_baseball_set_click_rect";
|
public static final String MG_BASEBALL_SET_CLICK_RECT = "mg_baseball_set_click_rect";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4. 设置app提供给游戏可点击区域(棒球) 模型
|
* 8. 设置app提供给游戏可点击区域(棒球) 模型
|
||||||
*/
|
*/
|
||||||
public static final class MGBaseballSetClickRect implements Serializable {
|
public static final class MGBaseballSetClickRect implements Serializable {
|
||||||
public List<InteractionClickRect> list;
|
public List<InteractionClickRect> list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5. 前期准备完成(棒球)
|
* 9. 获取文本配置数据(棒球)
|
||||||
* 游戏客户端通知APP指令动作前期准备完成
|
|
||||||
*/
|
|
||||||
public static final String MG_BASEBALL_PREPARE_FINISH = "mg_baseball_prepare_finish";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 5. 前期准备完成(棒球) 模型
|
|
||||||
*/
|
|
||||||
public static final class MGBaseballPrepareFinish implements Serializable {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 6. 主界面已显示(棒球)
|
|
||||||
* 游戏客户端通知APP指令动作主界面已显示
|
|
||||||
*/
|
|
||||||
public static final String MG_BASEBALL_SHOW_GAME_SCENE = "mg_baseball_show_game_scene";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 6. 主界面已显示(棒球) 模型
|
|
||||||
*/
|
|
||||||
public static final class MGBaseballShowGameScene implements Serializable {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 7. 主界面已隐藏(棒球)
|
|
||||||
* 游戏客户端通知APP指令动作主界面已隐藏
|
|
||||||
*/
|
|
||||||
public static final String MG_BASEBALL_HIDE_GAME_SCENE = "mg_baseball_hide_game_scene";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 7. 主界面已隐藏(棒球) 模型
|
|
||||||
*/
|
|
||||||
public static final class MGBaseballHideGameScene implements Serializable {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 8. 获取文本配置数据(棒球)
|
|
||||||
*/
|
*/
|
||||||
public static final String MG_BASEBALL_TEXT_CONFIG = "mg_baseball_text_config";
|
public static final String MG_BASEBALL_TEXT_CONFIG = "mg_baseball_text_config";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 8. 获取文本配置数据(棒球) 模型
|
* 9. 获取文本配置数据(棒球) 模型
|
||||||
*/
|
*/
|
||||||
public static final class MGBaseballTextConfig implements Serializable {
|
public static final class MGBaseballTextConfig implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10. 球落地, 通知距离(棒球)
|
||||||
|
*/
|
||||||
|
public static final String MG_BASEBALL_SEND_DISTANCE = "mg_baseball_send_distance";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10. 球落地, 通知距离(棒球) 模型
|
||||||
|
*/
|
||||||
|
public static final class MGBaseballSendDistance implements Serializable {
|
||||||
|
public int[] distances;
|
||||||
|
}
|
||||||
// endregion 棒球
|
// endregion 棒球
|
||||||
|
|
||||||
/** 点击区域定义 */
|
/** 点击区域定义 */
|
||||||
@ -1533,4 +1751,29 @@ public class SudMGPMGState implements Serializable {
|
|||||||
public float height; // 区域的height
|
public float height; // 区域的height
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// region 3D语聊房
|
||||||
|
/**
|
||||||
|
* 1. 请求房间数据
|
||||||
|
*/
|
||||||
|
public static final String MG_CUSTOM_CR_ROOM_INIT_DATA = "mg_custom_cr_room_init_data";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. 请求房间数据 模型
|
||||||
|
*/
|
||||||
|
public static final class MGCustomCrRoomInitData implements Serializable {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2. 点击主播位或老板位通知
|
||||||
|
*/
|
||||||
|
public static final String MG_CUSTOM_CR_CLICK_SEAT = "mg_custom_cr_click_seat";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2. 点击主播位或老板位通知 模型
|
||||||
|
*/
|
||||||
|
public static final class MGCustomCrClickSeat implements Serializable {
|
||||||
|
public int seatIndex; // 0~4一共5个麦位,0为老板位,1~4为四个面主播位
|
||||||
|
}
|
||||||
|
// endregion 3D语聊房
|
||||||
|
|
||||||
|
}
|
@ -10,6 +10,7 @@ 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.HtmlConfig;
|
import com.yunbao.common.HtmlConfig;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.bean.RedPacketListBean;
|
import com.yunbao.common.bean.RedPacketListBean;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
@ -69,10 +70,10 @@ public class RouteUtil {
|
|||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forwardSwSudGameActivity(String CreateSudRoom, boolean isAn, boolean isHome) {
|
public static void forwardSwSudGameActivity(String CreateSudRoom, boolean isActivityGame, boolean isHome) {
|
||||||
ARouter.getInstance().build(PATH_SudSwGameActivity)
|
ARouter.getInstance().build(PATH_SudSwGameActivity)
|
||||||
.withString("CreateSudRoom", CreateSudRoom)
|
.withString("CreateSudRoom", CreateSudRoom)
|
||||||
.withBoolean("CreateIsAn", isAn)
|
.withBoolean("isRandom", isActivityGame)
|
||||||
.withBoolean("CreateIsHome", isHome)
|
.withBoolean("CreateIsHome", isHome)
|
||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.yunbao.common.views;
|
package com.yunbao.common.views;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@ -19,6 +20,7 @@ import com.yunbao.common.R;
|
|||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.bean.SudRoomListModel;
|
import com.yunbao.common.bean.SudRoomListModel;
|
||||||
|
import com.yunbao.common.event.CheckCurrencyModel;
|
||||||
import com.yunbao.common.event.LiveOpenSudRoomEvent;
|
import com.yunbao.common.event.LiveOpenSudRoomEvent;
|
||||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||||
@ -28,10 +30,13 @@ import com.yunbao.common.http.HttpCallback;
|
|||||||
import com.yunbao.common.http.LiveHttpUtil;
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.RandomSudGameManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -42,7 +47,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
|||||||
private RoundedImageView avatarList1, avatarList2, avatarList3, avatarList4, avatarList5;
|
private RoundedImageView avatarList1, avatarList2, avatarList3, avatarList4, avatarList5;
|
||||||
private ImageView gifImageView;
|
private ImageView gifImageView;
|
||||||
private ImageView sex, game_icon, gold_coin;
|
private ImageView sex, game_icon, gold_coin;
|
||||||
|
private TextView activityTitle;
|
||||||
|
private View topLayout;
|
||||||
|
|
||||||
public SudGameListViewHolder(@NonNull View itemView) {
|
public SudGameListViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -60,6 +66,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
|||||||
avatarList5 = itemView.findViewById(R.id.avatar_list5);
|
avatarList5 = itemView.findViewById(R.id.avatar_list5);
|
||||||
gold_coin = itemView.findViewById(R.id.gold_coin);
|
gold_coin = itemView.findViewById(R.id.gold_coin);
|
||||||
sex = itemView.findViewById(R.id.sex);
|
sex = itemView.findViewById(R.id.sex);
|
||||||
|
activityTitle = itemView.findViewById(R.id.activityTitle);
|
||||||
|
topLayout = itemView.findViewById(R.id.topLayout);
|
||||||
avatarList1.setVisibility(View.GONE);
|
avatarList1.setVisibility(View.GONE);
|
||||||
avatarList2.setVisibility(View.GONE);
|
avatarList2.setVisibility(View.GONE);
|
||||||
avatarList3.setVisibility(View.GONE);
|
avatarList3.setVisibility(View.GONE);
|
||||||
@ -84,6 +92,25 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
|||||||
} else {
|
} else {
|
||||||
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin);
|
ImgLoader.display(itemView.getContext(), R.mipmap.gold_coin, gold_coin);
|
||||||
}
|
}
|
||||||
|
if (TextUtils.equals(model.getIsActivity(), "1")) {
|
||||||
|
gold_coin.setVisibility(View.GONE);
|
||||||
|
goldenBeanNumber.setText("");
|
||||||
|
activityTitle.setVisibility(View.VISIBLE);
|
||||||
|
topLayout.setBackgroundResource(R.mipmap.bg_game_list_activity_top);
|
||||||
|
if(WordUtil.isNewZh()){
|
||||||
|
activityTitle.setTextSize(14);
|
||||||
|
}else{
|
||||||
|
activityTitle.setTextSize(10);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
gold_coin.setVisibility(View.VISIBLE);
|
||||||
|
activityTitle.setVisibility(View.GONE);
|
||||||
|
if(isHome){
|
||||||
|
topLayout.setBackgroundResource(R.drawable.bg_home_sud_list_sill);
|
||||||
|
}else{
|
||||||
|
topLayout.setBackgroundResource(R.drawable.bg_live_sud_list_sill);
|
||||||
|
}
|
||||||
|
}
|
||||||
ImgLoader.display(itemView.getContext(), model.getSudgameicon(), game_icon);
|
ImgLoader.display(itemView.getContext(), model.getSudgameicon(), game_icon);
|
||||||
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.layout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.layout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
@Override
|
@Override
|
||||||
@ -99,80 +126,35 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
|||||||
}
|
}
|
||||||
Bus.get().post(new SudGameListRefreshEvent());
|
Bus.get().post(new SudGameListRefreshEvent());
|
||||||
} else {
|
} else {
|
||||||
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
if (TextUtils.equals(model.getIsActivity(), "1")) {
|
||||||
createSudRoomModel.setSudGameId(model.getSudGameId());
|
LiveNetManager.get(itemView.getContext())
|
||||||
createSudRoomModel.setSudGameRoomId(model.getSudGameRoomId());
|
.checkCurrency(new com.yunbao.common.http.base.HttpCallback<CheckCurrencyModel>() {
|
||||||
createSudRoomModel.setAvatar(model.getAvatar());
|
@Override
|
||||||
createSudRoomModel.setRoomName(model.getRoomName());
|
public void onSuccess(CheckCurrencyModel currencyModel) {
|
||||||
createSudRoomModel.setSudGameName(model.getSudGameName());
|
if (currencyModel.getZqTicketNumberInt() < 1) {
|
||||||
if (isHome) {
|
RandomSudGameManager.getManager().showNotActivityTicketDialog(itemView.getContext(), true, new DialogUitl.SimpleCallback2() {
|
||||||
if (TextUtils.equals(model.getLiveUid(), "0")) {
|
|
||||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
|
||||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
|
||||||
}else{
|
|
||||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
String yes = "是";
|
|
||||||
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
|
||||||
yes = "是";
|
|
||||||
} else {
|
|
||||||
yes = "Yes";
|
|
||||||
}
|
|
||||||
new XPopup.Builder(itemView.getContext())
|
|
||||||
.asCustom(new HintCustomPopup(itemView.getContext(),
|
|
||||||
itemView.getContext().getString(R.string.interactive_game_search_room_currently_live),
|
|
||||||
itemView.getContext().getString(R.string.interactive_game_search_room_broadcast_room))
|
|
||||||
.setLiveOpenOk(yes)
|
|
||||||
.setLiveOpenCancel(itemView.getContext().getString(R.string.interactive_game_search_room_bhe_game))
|
|
||||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSure() {
|
public void onCancelClick() {
|
||||||
LiveHttpUtil.getLiveInfo(model.getLiveUid() + "", new HttpCallback() {
|
toGame(model, isHome, currencyModel,true);
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
|
||||||
new LiveRoomCheckLivePresenter(itemView.getContext(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
|
||||||
@Override
|
|
||||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) {
|
|
||||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal),isSw);
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCheckError(String contextError) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
RouteUtil.forwardUserHome(itemView.getContext(), model.getLiveUid(), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCancel() {
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
if(CommonAppConfig.getInstance().getConfig().isSw()){
|
|
||||||
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
|
||||||
}else{
|
|
||||||
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel),true,isHome);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})).show();
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
toGame(model, isHome, currencyModel,true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
toGame(model, isHome, null,false);
|
||||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
|
|
||||||
Bus.get().post(new SudGameListDissMissEvent());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,4 +169,84 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void toGame(SudRoomListModel model, boolean isHome, CheckCurrencyModel currencyModel,boolean isActivity) {
|
||||||
|
|
||||||
|
|
||||||
|
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
|
||||||
|
createSudRoomModel.setSudGameId(model.getSudGameId());
|
||||||
|
createSudRoomModel.setSudGameRoomId(model.getSudGameRoomId());
|
||||||
|
createSudRoomModel.setAvatar(model.getAvatar());
|
||||||
|
createSudRoomModel.setRoomName(model.getRoomName());
|
||||||
|
createSudRoomModel.setSudGameName(model.getSudGameName());
|
||||||
|
if (isHome) {
|
||||||
|
if (TextUtils.equals(model.getLiveUid(), "0")) {
|
||||||
|
if (CommonAppConfig.getInstance().getConfig().isSw()) {
|
||||||
|
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel), isActivity, isHome);
|
||||||
|
} else {
|
||||||
|
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel), true, isHome);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String yes = "是";
|
||||||
|
if (IMLoginManager.get(itemView.getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
|
yes = "是";
|
||||||
|
} else {
|
||||||
|
yes = "Yes";
|
||||||
|
}
|
||||||
|
new XPopup.Builder(itemView.getContext())
|
||||||
|
.asCustom(new HintCustomPopup(itemView.getContext(),
|
||||||
|
itemView.getContext().getString(R.string.interactive_game_search_room_currently_live),
|
||||||
|
itemView.getContext().getString(R.string.interactive_game_search_room_broadcast_room))
|
||||||
|
.setLiveOpenOk(yes)
|
||||||
|
.setLiveOpenCancel(itemView.getContext().getString(R.string.interactive_game_search_room_bhe_game))
|
||||||
|
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSure() {
|
||||||
|
LiveHttpUtil.getLiveInfo(model.getLiveUid() + "", 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);
|
||||||
|
new LiveRoomCheckLivePresenter(itemView.getContext(), liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) {
|
||||||
|
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw);
|
||||||
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Bus.get().post(new LiveOpenSudRoomEvent().setCreateSudRoomModel(createSudRoomModel));
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCheckError(String contextError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
RouteUtil.forwardUserHome(itemView.getContext(), model.getLiveUid(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
if (CommonAppConfig.getInstance().getConfig().isSw()) {
|
||||||
|
RouteUtil.forwardSwSudGameActivity(new Gson().toJson(createSudRoomModel), true, isHome);
|
||||||
|
} else {
|
||||||
|
RouteUtil.forwardRySudGameActivity(new Gson().toJson(createSudRoomModel), true, isHome);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
|
||||||
|
Bus.get().post(new SudGameListDissMissEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,19 +2,30 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="45dp"
|
||||||
android:background="@mipmap/sub_bg"
|
android:background="@mipmap/sub_bg"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="68dp"
|
android:paddingTop="68dp"
|
||||||
android:paddingBottom="16dp"
|
android:paddingBottom="16dp">
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:layout_marginTop="45dp">
|
<TextView
|
||||||
|
android:id="@+id/activityGameAchievement"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="TextView" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/layoutUser"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -33,9 +44,9 @@
|
|||||||
android:id="@+id/sub_win_hat"
|
android:id="@+id/sub_win_hat"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
android:src="@mipmap/sub_win_hat"
|
android:src="@mipmap/sub_win_hat"
|
||||||
android:visibility="gone"
|
android:visibility="gone" />
|
||||||
android:layout_centerHorizontal="true"/>
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/sub_win_head"
|
android:id="@+id/sub_win_head"
|
||||||
@ -43,9 +54,9 @@
|
|||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="25dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_corner_radius="360dp"
|
|
||||||
app:riv_border_color="#FFFFDCB3"
|
app:riv_border_color="#FFFFDCB3"
|
||||||
app:riv_border_width="1dp"/>
|
app:riv_border_width="1dp"
|
||||||
|
app:riv_corner_radius="360dp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -54,23 +65,40 @@
|
|||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:gravity="center"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="center"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="用户昵称哈哈哈"/>
|
android:text="用户昵称哈哈哈"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/sub_win_score"
|
android:id="@+id/sub_win_score"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_gravity="center"
|
||||||
android:textColor="@color/white_60"
|
|
||||||
android:textSize="11sp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="+10000"/>
|
android:text="+10000"
|
||||||
|
android:textColor="@color/white_60"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/winActivityIcon"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:src="@mipmap/ic_game_activity_rank_coin"
|
||||||
|
android:layout_width="12dp"
|
||||||
|
android:layout_height="12dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
@ -80,7 +108,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:src="@mipmap/sub_vs"/>
|
android:src="@mipmap/sub_vs" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -92,12 +120,12 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<!-- <androidx.appcompat.widget.AppCompatImageView-->
|
<!-- <androidx.appcompat.widget.AppCompatImageView-->
|
||||||
<!-- android:id="@+id/sub_loss_hat"-->
|
<!-- android:id="@+id/sub_loss_hat"-->
|
||||||
<!-- android:layout_width="wrap_content"-->
|
<!-- android:layout_width="wrap_content"-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!-- android:layout_height="wrap_content"-->
|
||||||
<!-- android:src="@mipmap/sub_win_hat"-->
|
<!-- android:src="@mipmap/sub_win_hat"-->
|
||||||
<!-- android:layout_centerHorizontal="true"/>-->
|
<!-- android:layout_centerHorizontal="true"/>-->
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/sub_loss_head"
|
android:id="@+id/sub_loss_head"
|
||||||
@ -105,9 +133,9 @@
|
|||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="25dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_corner_radius="360dp"
|
|
||||||
app:riv_border_color="#FFFFDCB3"
|
app:riv_border_color="#FFFFDCB3"
|
||||||
app:riv_border_width="1dp"/>
|
app:riv_border_width="1dp"
|
||||||
|
app:riv_corner_radius="360dp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -116,23 +144,36 @@
|
|||||||
android:layout_width="80dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:gravity="center"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textSize="13sp"
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="center"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="用户昵称"/>
|
android:text="用户昵称"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/sub_loss_score"
|
android:id="@+id/sub_loss_score"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:textColor="@color/white_60"
|
|
||||||
android:textSize="11sp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="+10000"/>
|
android:text="+10000"
|
||||||
|
android:textColor="@color/white_60"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/lossActivityIcon"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:src="@mipmap/ic_game_activity_rank_coin"
|
||||||
|
android:layout_width="12dp"
|
||||||
|
android:layout_height="12dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
@ -142,32 +183,32 @@
|
|||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="40dp">
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginEnd="15dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/sub_leave"
|
android:id="@+id/sub_leave"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@mipmap/sub_leave_zh"/>
|
android:src="@mipmap/sub_leave_zh" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/sub_time"
|
android:id="@+id/sub_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:layout_marginTop="10dp"
|
||||||
android:textColor="#FF5B5B5B"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:text="10"
|
|
||||||
android:layout_marginEnd="30dp"
|
android:layout_marginEnd="30dp"
|
||||||
android:layout_marginTop="10dp"/>
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:text="10"
|
||||||
|
android:textColor="#FF5B5B5B"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -176,7 +217,7 @@
|
|||||||
android:id="@+id/sub_again"
|
android:id="@+id/sub_again"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:src="@mipmap/sub_again_zh"/>
|
android:src="@mipmap/sub_again_zh" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
@ -184,10 +225,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="14dp"
|
||||||
android:textSize="11sp"
|
android:singleLine="true"
|
||||||
android:textColor="@color/white_60"
|
|
||||||
android:text="@string/sub_admission_fee"
|
android:text="@string/sub_admission_fee"
|
||||||
android:singleLine="true"/>
|
android:textColor="@color/white_60"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
@ -1,178 +1,192 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/layout"
|
android:id="@+id/layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="88dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:background="@mipmap/background_home_sud_game_list"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="55dp"
|
|
||||||
android:layout_height="55dp"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="17dp">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/avatar"
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/btn_live"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_gravity="bottom|center_horizontal"
|
|
||||||
android:layout_marginEnd="3dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:src="@mipmap/icon_user_game_living"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/sex"
|
|
||||||
android:layout_width="10dp"
|
|
||||||
android:layout_height="10dp"
|
|
||||||
android:layout_gravity="bottom|end" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/linearLayout4"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
android:layout_marginTop="8dp"
|
||||||
android:id="@+id/room_name"
|
android:background="@mipmap/background_home_sud_game_list"
|
||||||
android:layout_width="150dp"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_height="wrap_content"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:layout_marginTop="10dp"
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:text="@string/interactive_game_create_room_name"
|
|
||||||
android:textColor="#000"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<View
|
<FrameLayout
|
||||||
android:layout_width="1dp"
|
android:layout_width="55dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="55dp"
|
||||||
android:layout_weight="1" />
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="17dp">
|
||||||
|
|
||||||
<TextView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/player_we_are"
|
android:id="@+id/avatar"
|
||||||
android:layout_width="150dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="50dp"
|
||||||
android:layout_gravity="bottom"
|
android:scaleType="centerCrop"
|
||||||
android:layout_marginBottom="5dp"
|
app:riv_oval="true" />
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/interactive_game_player_we_are"
|
|
||||||
android:textColor="#B3000000"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/player_we_are_2"
|
android:id="@+id/btn_live"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="36dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="14dp"
|
||||||
android:layout_marginEnd="3dp"
|
android:layout_gravity="bottom|center_horizontal"
|
||||||
android:layout_marginBottom="3dp"
|
android:layout_marginEnd="3dp"
|
||||||
android:ellipsize="end"
|
android:adjustViewBounds="true"
|
||||||
android:singleLine="true"
|
android:src="@mipmap/icon_user_game_living"
|
||||||
android:text="@string/interactive_game_player_we_are_2"
|
android:visibility="visible" />
|
||||||
android:textColor="#B3000000"
|
|
||||||
android:textSize="12sp" />
|
<ImageView
|
||||||
|
android:id="@+id/sex"
|
||||||
|
android:layout_width="10dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_gravity="bottom|end" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginStart="16dp"
|
||||||
android:gravity="center_vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/room_name"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/interactive_game_create_room_name"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_we_are"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/interactive_game_player_we_are"
|
||||||
|
android:textColor="#B3000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_we_are_2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="3dp"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/interactive_game_player_we_are_2"
|
||||||
|
android:textColor="#B3000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="79dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="20dp"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone">
|
android:layout_marginTop="6dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<LinearLayout
|
||||||
android:id="@+id/avatar_list1"
|
android:layout_width="79dp"
|
||||||
android:layout_width="20dp"
|
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:scaleType="centerCrop"
|
android:visibility="gone">
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list2"
|
android:id="@+id/avatar_list1"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:scaleType="centerCrop"
|
||||||
android:scaleType="centerCrop"
|
app:riv_oval="true" />
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list3"
|
android:id="@+id/avatar_list2"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:layout_marginStart="-6dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list4"
|
android:id="@+id/avatar_list3"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:layout_marginStart="-6dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list5"
|
android:id="@+id/avatar_list4"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="-6dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/avatar_list5"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="-6dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/avatar_list"
|
||||||
|
android:layout_width="76dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:visibility="gone" />
|
||||||
android:scaleType="centerCrop"
|
|
||||||
app:riv_oval="true" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/avatar_list"
|
|
||||||
android:layout_width="76dp"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
android:layout_marginEnd="3dp"
|
android:layout_marginTop="8dp"
|
||||||
android:orientation="vertical">
|
android:layout_marginEnd="4dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/topLayout"
|
||||||
android:layout_width="68dp"
|
android:layout_width="68dp"
|
||||||
android:layout_height="26dp"
|
android:layout_height="26dp"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:background="@drawable/bg_home_sud_list_sill"
|
android:background="@drawable/bg_home_sud_list_sill"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/golden_bean_number"
|
android:id="@+id/golden_bean_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:text="1000"
|
android:text="1"
|
||||||
android:textColor="#FF8000"
|
android:textColor="#FF8000"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@ -200,4 +214,21 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
|
android:id="@+id/activityTitle"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="-6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/game_list_activity_title"
|
||||||
|
android:textColor="#FDE888"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/linearLayout3"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/linearLayout4"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,164 +1,176 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/layout"
|
android:id="@+id/layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="88dp"
|
android:layout_height="88dp"
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="15dp"
|
|
||||||
android:background="@mipmap/background_sud_game_list"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="55dp"
|
|
||||||
android:layout_height="55dp"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="17dp">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/avatar"
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/btn_live"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_gravity="bottom|center_horizontal"
|
|
||||||
android:layout_marginEnd="3dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:src="@mipmap/icon_user_game_living"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/sex"
|
|
||||||
android:layout_width="10dp"
|
|
||||||
android:layout_height="10dp"
|
|
||||||
android:layout_gravity="bottom|end" />
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/linearLayout5"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_height="0dp"
|
||||||
android:orientation="vertical">
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:background="@mipmap/background_sud_game_list"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
<FrameLayout
|
||||||
android:id="@+id/room_name"
|
android:layout_width="55dp"
|
||||||
android:ellipsize="end"
|
android:layout_height="55dp"
|
||||||
android:layout_width="150dp"
|
android:layout_marginStart="10dp"
|
||||||
android:singleLine="true"
|
android:layout_marginTop="17dp">
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:text="@string/interactive_game_create_room_name"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/avatar"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<View
|
<ImageView
|
||||||
android:layout_width="1dp"
|
android:id="@+id/btn_live"
|
||||||
android:layout_height="0dp"
|
android:layout_width="36dp"
|
||||||
android:layout_weight="1" />
|
android:layout_height="14dp"
|
||||||
|
android:layout_gravity="bottom|center_horizontal"
|
||||||
|
android:layout_marginEnd="3dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@mipmap/icon_user_game_living"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/player_we_are"
|
android:id="@+id/sex"
|
||||||
android:layout_width="150dp"
|
android:layout_width="10dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="10dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom|end" />
|
||||||
android:layout_marginBottom="5dp"
|
</FrameLayout>
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/interactive_game_player_we_are"
|
|
||||||
android:textColor="#80ffffff"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/player_we_are_2"
|
|
||||||
android:layout_width="70dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="3dp"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/interactive_game_player_we_are_2"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginStart="16dp"
|
||||||
android:gravity="center_vertical"
|
android:orientation="vertical">
|
||||||
android:visibility="gone">
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/room_name"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/interactive_game_create_room_name"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_we_are"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/interactive_game_player_we_are"
|
||||||
|
android:textColor="#80ffffff"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_we_are_2"
|
||||||
|
android:layout_width="70dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="3dp"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/interactive_game_player_we_are_2"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="79dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="20dp">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<LinearLayout
|
||||||
android:id="@+id/avatar_list1"
|
android:layout_width="79dp"
|
||||||
android:layout_width="20dp"
|
android:layout_height="20dp">
|
||||||
android:layout_height="20dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list2"
|
android:id="@+id/avatar_list1"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:scaleType="centerCrop"
|
||||||
android:scaleType="centerCrop"
|
app:riv_oval="true" />
|
||||||
app:riv_oval="true" />
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list3"
|
android:id="@+id/avatar_list2"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:layout_marginStart="-6dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list4"
|
android:id="@+id/avatar_list3"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:layout_marginStart="-6dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/avatar_list5"
|
android:id="@+id/avatar_list4"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="-6dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
|
android:id="@+id/avatar_list5"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="-6dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:riv_oval="true" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/avatar_list"
|
||||||
|
android:layout_width="76dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_marginStart="-6dp"
|
android:visibility="gone" />
|
||||||
android:scaleType="centerCrop"
|
|
||||||
app:riv_oval="true" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/avatar_list"
|
|
||||||
android:layout_width="76dp"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:layout_marginTop="8dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/linearLayout5"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/topLayout"
|
||||||
android:layout_width="68dp"
|
android:layout_width="68dp"
|
||||||
android:layout_height="26dp"
|
android:layout_height="26dp"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
@ -197,4 +209,21 @@
|
|||||||
android:layout_marginEnd="5dp" />
|
android:layout_marginEnd="5dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/activityTitle"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="-10dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/game_list_activity_title"
|
||||||
|
android:textColor="#FDE888"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/linearLayout3"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/linearLayout5"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/linearLayout5"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
common/src/main/res/mipmap-xxhdpi/bg_game_list_activity_top.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/bg_game_list_activity_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_game_activity_rank_coin.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/ic_game_activity_rank_coin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/ic_game_ticket.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/ic_game_ticket.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
@ -1545,5 +1545,15 @@
|
|||||||
<string name="live_end_view_ban_reason">違規原因:</string>
|
<string name="live_end_view_ban_reason">違規原因:</string>
|
||||||
<string name="live_end_view_ban_content">處罰內容:</string>
|
<string name="live_end_view_ban_content">處罰內容:</string>
|
||||||
<string name="live_end_view_ban_timer">處罰時間:</string>
|
<string name="live_end_view_ban_timer">處罰時間:</string>
|
||||||
|
<string name="game_create_coid_ticket">門票</string>
|
||||||
|
<string name="game_list_activity_title">挑戰一桿清台,瓜分高額獎金</string>
|
||||||
|
<string name="game_dialog_activity_achievements_title">恭喜您本局完成</string>
|
||||||
|
<string name="game_dialog_activity_achievements_0">一桿清台</string>
|
||||||
|
<string name="game_dialog_activity_achievements_1">1連桿</string>
|
||||||
|
<string name="game_dialog_activity_achievements_2">2連桿</string>
|
||||||
|
<string name="game_dialog_activity_achievements_3">3連桿</string>
|
||||||
|
<string name="game_dialog_activity_achievements_4">4連桿</string>
|
||||||
|
<string name="game_dialog_activity_achievements_5">5連桿</string>
|
||||||
|
<string name="game_dialog_activity_achievements_6">6連桿</string>
|
||||||
|
<string name="game_dialog_activity_achievements_7">7連桿</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1554,4 +1554,15 @@
|
|||||||
<string name="live_end_view_ban_reason">Violation reasons:</string>
|
<string name="live_end_view_ban_reason">Violation reasons:</string>
|
||||||
<string name="live_end_view_ban_content">Penalty content:</string>
|
<string name="live_end_view_ban_content">Penalty content:</string>
|
||||||
<string name="live_end_view_ban_timer">Penalty time:</string>
|
<string name="live_end_view_ban_timer">Penalty time:</string>
|
||||||
|
<string name="game_create_coid_ticket">Ticket</string>
|
||||||
|
<string name="game_list_activity_title">Challenge One-shot clearance Share high bonuses</string>
|
||||||
|
<string name="game_dialog_activity_achievements_title">Your office has completed </string>
|
||||||
|
<string name="game_dialog_activity_achievements_0">One-shotclearance</string>
|
||||||
|
<string name="game_dialog_activity_achievements_1">1 Combo</string>
|
||||||
|
<string name="game_dialog_activity_achievements_2">2 Combo</string>
|
||||||
|
<string name="game_dialog_activity_achievements_3">3 Combo</string>
|
||||||
|
<string name="game_dialog_activity_achievements_4">4 Combo</string>
|
||||||
|
<string name="game_dialog_activity_achievements_5">5 Combo</string>
|
||||||
|
<string name="game_dialog_activity_achievements_6">6 Combo</string>
|
||||||
|
<string name="game_dialog_activity_achievements_7">7 Combo</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -4,7 +4,7 @@ ext {
|
|||||||
buildToolsVersion: "29.0.2",
|
buildToolsVersion: "29.0.2",
|
||||||
minSdkVersion : 23,
|
minSdkVersion : 23,
|
||||||
targetSdkVersion : 34,
|
targetSdkVersion : 34,
|
||||||
versionCode : 692,
|
versionCode : 693,
|
||||||
versionName : "6.8.0"
|
versionName : "6.8.0"
|
||||||
]
|
]
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
|
@ -27,12 +27,14 @@ import com.yunbao.common.R;
|
|||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.adapter.SudGameChatAdapter;
|
import com.yunbao.common.adapter.SudGameChatAdapter;
|
||||||
import com.yunbao.common.adapter.SudGameUserListAdapter;
|
import com.yunbao.common.adapter.SudGameUserListAdapter;
|
||||||
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||||
|
import com.yunbao.common.bean.SudActivityGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudGameChatImModel;
|
import com.yunbao.common.bean.SudGameChatImModel;
|
||||||
import com.yunbao.common.bean.SudGameInfoBean;
|
import com.yunbao.common.bean.SudGameInfoBean;
|
||||||
import com.yunbao.common.bean.SudGameScoreBean;
|
import com.yunbao.common.bean.SudGameScoreBean;
|
||||||
@ -49,6 +51,7 @@ import com.yunbao.common.glide.ImgLoader;
|
|||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.manager.RandomSudGameManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.GameSwMicManager;
|
import com.yunbao.common.manager.imrongcloud.GameSwMicManager;
|
||||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||||
import com.yunbao.common.sud.model.GameConfigModel;
|
import com.yunbao.common.sud.model.GameConfigModel;
|
||||||
@ -248,7 +251,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(isSw){
|
if (isSw) {
|
||||||
SWAuManager.get().exitChannelAll();
|
SWAuManager.get().exitChannelAll();
|
||||||
}
|
}
|
||||||
if (gameMicManager != null) {
|
if (gameMicManager != null) {
|
||||||
@ -261,14 +264,16 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private boolean isActivityGame;
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
isActivityGame = getIntent().getBooleanExtra("isRandom", false);
|
||||||
String createSudRoomJson = getIntent().getStringExtra("CreateSudRoom");
|
String createSudRoomJson = getIntent().getStringExtra("CreateSudRoom");
|
||||||
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
|
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
|
||||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||||
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),mContext);
|
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(), mContext);
|
||||||
|
|
||||||
gameContainer = findViewById(R.id.game_container);
|
gameContainer = findViewById(R.id.game_container);
|
||||||
roomName = findViewById(R.id.room_name);
|
roomName = findViewById(R.id.room_name);
|
||||||
@ -432,9 +437,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
|||||||
} else {
|
} else {
|
||||||
disable = true;
|
disable = true;
|
||||||
// 设置禁用麦克风采集
|
// 设置禁用麦克风采集
|
||||||
if(isSw){
|
if (isSw) {
|
||||||
SWAuManager.get().setMicAn(false);
|
SWAuManager.get().setMicAn(false);
|
||||||
}else{
|
} else {
|
||||||
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||||
}
|
}
|
||||||
ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat);
|
ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat);
|
||||||
@ -518,7 +523,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
|||||||
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
|
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
|
||||||
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
|
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
|
||||||
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
|
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
|
||||||
|
if (isActivityGame) {
|
||||||
|
sudGameDoubleDialog.setActivityGame();
|
||||||
|
}
|
||||||
//游戏结算结束
|
//游戏结算结束
|
||||||
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
||||||
//观察结算排名数据,点击跳过和再来一局不需要显示结算界面
|
//观察结算排名数据,点击跳过和再来一局不需要显示结算界面
|
||||||
@ -538,14 +545,21 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
|||||||
|
|
||||||
//加载弹窗消失监听,自动消失和点击跳过在这个监听中都不做处理
|
//加载弹窗消失监听,自动消失和点击跳过在这个监听中都不做处理
|
||||||
sudLoadDialog.setOnDismissListener(() -> {
|
sudLoadDialog.setOnDismissListener(() -> {
|
||||||
if (sudLoadDialog.getClickStatus() == 2){
|
if (sudLoadDialog.getClickStatus() == 2) {
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//通知活动游戏
|
||||||
|
if (isActivityGame) {
|
||||||
|
RandomSudGameManager.getManager().onInitGame(mCreateSudRoomModel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
||||||
|
if (isActivityGame) {
|
||||||
|
RandomSudGameManager.getManager().onGameState(event);
|
||||||
|
}
|
||||||
switch (event.getSudMGPMGState()) {
|
switch (event.getSudMGPMGState()) {
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||||
@ -589,15 +603,45 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
|||||||
//先获取用户信息再进行结算处理
|
//先获取用户信息再进行结算处理
|
||||||
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<SudGameInfoBean> data) {
|
public void onSuccess(List<SudGameInfoBean> infoBean) {
|
||||||
if (!data.isEmpty()){
|
if (!infoBean.isEmpty()) {
|
||||||
gameViewModel.setSudGameInfoBeanList(data);
|
System.out.println("结算,是否为游戏活动:"+isActivityGame);
|
||||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle());//结算游戏
|
if(isActivityGame) {
|
||||||
}else {
|
loadScore(infoBean, 3);
|
||||||
|
}else{
|
||||||
|
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||||
|
gameViewModel.sudGameRank(event.getMgCommonGameSettle(null));//结算游戏
|
||||||
|
}
|
||||||
|
} else {
|
||||||
ToastUtil.show(getString(R.string.net_error));
|
ToastUtil.show(getString(R.string.net_error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadScore(List<SudGameInfoBean> infoBean,int index) {
|
||||||
|
if(index==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LiveNetManager.get(mContext)
|
||||||
|
.ballClearanceTableGetResultScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<SudActivityGameInfoBean> data) {
|
||||||
|
if (data.isEmpty()) {
|
||||||
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
|
loadScore(infoBean,index-1);
|
||||||
|
}, 300);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gameViewModel.setSudGameInfoBeanList(infoBean);
|
||||||
|
gameViewModel.sudGameRank(event.getMgCommonGameSettle(data));//结算游戏
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
ToastUtil.show(error);
|
ToastUtil.show(error);
|
||||||
|
@ -263,7 +263,7 @@ public class BattlePassActivity extends AbsActivity {
|
|||||||
if (data.isBattlePassStatus()) {
|
if (data.isBattlePassStatus()) {
|
||||||
SpUtil.getInstance().removeValue("is_battle_pass_status");
|
SpUtil.getInstance().removeValue("is_battle_pass_status");
|
||||||
}
|
}
|
||||||
fragments.get(viewPager.getCurrentItem()).updateData();
|
// fragments.get(viewPager.getCurrentItem()).updateData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,9 +68,10 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
|||||||
AppManager.runDebugCode(new Runnable() {
|
AppManager.runDebugCode(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
new GiftWallDialog(mContext, IMLoginManager.get(mContext).getUserInfo().getId() + "",
|
/* new GiftWallDialog(mContext, IMLoginManager.get(mContext).getUserInfo().getId() + "",
|
||||||
IMLoginManager.get(mContext).getUserInfo().getUserNicename(), null
|
IMLoginManager.get(mContext).getUserInfo().getUserNicename(), null
|
||||||
, false).setFullWindows(true).setTab2(true).showDialog();
|
, false).setFullWindows(true).setTab2(true).showDialog();*/
|
||||||
|
RouteUtil.forwardBattlePass();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user