6.8.0:谷歌内购版本升级,小游戏结算界面优化
This commit is contained in:
@@ -4,6 +4,7 @@ import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -33,8 +34,13 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SudGameChatImModel;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.dialog.SudGameDoubleDialog;
|
||||
import com.yunbao.common.dialog.SudGameMultipleDialog;
|
||||
import com.yunbao.common.dialog.SudGameInputPopupWindow;
|
||||
import com.yunbao.common.dialog.SudLoadDialog;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.SubGameEvent;
|
||||
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||
@@ -44,7 +50,6 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.GameRyMicManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.SudMGPAPPState;
|
||||
@@ -93,6 +98,9 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
private ProcessResultUtil mProcessResultUtil;
|
||||
private List<String> muteUser = new ArrayList<>();
|
||||
private boolean imOff;
|
||||
private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗
|
||||
private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗
|
||||
private SudLoadDialog sudLoadDialog;//加载弹窗
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -227,7 +235,8 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
|
||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
|
||||
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),mContext);
|
||||
gameContainer = findViewById(R.id.game_container);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
roomNumber = findViewById(R.id.room_number);
|
||||
@@ -428,6 +437,7 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.gameSettle.hide = true;//是否隐藏结算界面(false: 显示; true: 隐藏,默认为 false)
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
@@ -453,7 +463,33 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
gameViewRectModel.bottom = DpUtil.dp2px(155);
|
||||
gameViewModel.gameViewRectModel = gameViewRectModel;
|
||||
|
||||
//初始化结算弹窗
|
||||
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
|
||||
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
|
||||
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
|
||||
|
||||
//游戏结算结束
|
||||
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
||||
if (sudLoadDialog.getClickStatus() == 0) {
|
||||
sudLoadDialog.dismiss();
|
||||
if (gameViewModel.getSudGameScoreBean().getGame_mode() == 1) {
|
||||
//双人游戏
|
||||
sudGameDoubleDialog.setSudSettleList(sudSettleBeans);
|
||||
sudGameDoubleDialog.showDialog();
|
||||
} else {
|
||||
//多人游戏
|
||||
sudGameMultipleDialog.setSudSettleList(sudSettleBeans);
|
||||
sudGameMultipleDialog.showDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//加载弹窗监听
|
||||
sudLoadDialog.setOnDismissListener(() -> {
|
||||
if (sudLoadDialog.getClickStatus() == 2){
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -461,12 +497,14 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
|
||||
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
//获取筹码信息,检查是否足够
|
||||
LiveNetManager.get(mContext).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameScoreBean>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (TextUtils.equals(String.valueOf(data.getGoldenBeanRemainingBalance()), "1")) {
|
||||
public void onSuccess(SudGameScoreBean data) {
|
||||
if (data.getGolden_bean_remaining_balance() == 1) {
|
||||
gameViewModel.setSudGameScoreBean(data);
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfReady(event.getSubReady());
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
@@ -491,9 +529,31 @@ public class SudRyGameActivity extends AbsActivity implements GameRyMicManager.M
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
//结算状态
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
sudLoadDialog.setClickStatus(0);
|
||||
sudLoadDialog.setDouble(gameViewModel.getSudGameScoreBean().getGame_mode());
|
||||
sudLoadDialog.showDialog();
|
||||
//获取用户信息
|
||||
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudGameInfoBean> data) {
|
||||
if (!data.isEmpty()){
|
||||
gameViewModel.setSudGameInfoBeanList(data);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle());
|
||||
}else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
//点击开始游戏
|
||||
LiveNetManager.get(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||
HttpCallback<CheckRemainingBalance>() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -16,6 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
@@ -32,10 +34,16 @@ import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SudGameChatImModel;
|
||||
import com.yunbao.common.bean.SudGameInfoBean;
|
||||
import com.yunbao.common.bean.SudGameScoreBean;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.bean.SudSettleBean;
|
||||
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||
import com.yunbao.common.dialog.SudGameDoubleDialog;
|
||||
import com.yunbao.common.dialog.SudGameMultipleDialog;
|
||||
import com.yunbao.common.dialog.SudGameInputPopupWindow;
|
||||
import com.yunbao.common.dialog.SudLoadDialog;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.LiveFloatEvent;
|
||||
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -70,7 +78,6 @@ import cn.rongcloud.rtc.api.RCRTCRemoteUser;
|
||||
import cn.rongcloud.rtc.api.RCRTCRoom;
|
||||
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
|
||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||
import io.agora.beautyapi.faceunity.agora.LiveFloatView;
|
||||
import io.agora.beautyapi.faceunity.agora.SWAuManager;
|
||||
import io.rong.imlib.IRongCoreCallback;
|
||||
import io.rong.imlib.IRongCoreEnum;
|
||||
@@ -96,6 +103,9 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
private List<String> muteUser = new ArrayList<>();
|
||||
private boolean imOff;
|
||||
private boolean isSw = CommonAppConfig.getInstance().getConfig().isSw();
|
||||
private SudGameDoubleDialog sudGameDoubleDialog;//双人游戏弹窗
|
||||
private SudGameMultipleDialog sudGameMultipleDialog;//多人游戏弹窗
|
||||
private SudLoadDialog sudLoadDialog;//加载弹窗
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -257,6 +267,8 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
|
||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
//第二次进入时,viewmodel数据丢失,所以初始化时直接获取
|
||||
gameViewModel.getScore(mCreateSudRoomModel.getSudGameRoomId(),mContext);
|
||||
|
||||
gameContainer = findViewById(R.id.game_container);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
@@ -476,6 +488,7 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.gameSettle.hide = true;//是否隐藏结算界面(false: 显示; true: 隐藏,默认为 false)
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
@@ -501,7 +514,34 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
gameViewRectModel.bottom = DpUtil.dp2px(155);
|
||||
gameViewModel.gameViewRectModel = gameViewRectModel;
|
||||
|
||||
//初始化结算弹窗
|
||||
sudGameDoubleDialog = new SudGameDoubleDialog(this);//双人游戏
|
||||
sudGameMultipleDialog = new SudGameMultipleDialog(this);//多人游戏
|
||||
sudLoadDialog = new SudLoadDialog(this);//加载弹窗
|
||||
|
||||
//游戏结算结束
|
||||
gameViewModel.listMutableLiveData.observe(this, sudSettleBeans -> {
|
||||
//观察结算排名数据,点击跳过和再来一局不需要显示结算界面
|
||||
if (sudLoadDialog.getClickStatus() == 0) {
|
||||
sudLoadDialog.dismiss();
|
||||
if (gameViewModel.getSudGameScoreBean().getGame_mode() == 1) {
|
||||
//双人游戏
|
||||
sudGameDoubleDialog.setSudSettleList(sudSettleBeans);
|
||||
sudGameDoubleDialog.showDialog();
|
||||
} else {
|
||||
//多人游戏
|
||||
sudGameMultipleDialog.setSudSettleList(sudSettleBeans);
|
||||
sudGameMultipleDialog.showDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//加载弹窗消失监听,自动消失和点击跳过在这个监听中都不做处理
|
||||
sudLoadDialog.setOnDismissListener(() -> {
|
||||
if (sudLoadDialog.getClickStatus() == 2){
|
||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN).setSubReady(false));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -509,12 +549,14 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
|
||||
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
//获取筹码信息,检查是否足够
|
||||
LiveNetManager.get(mContext).getScore(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<SudGameScoreBean>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (TextUtils.equals(String.valueOf(data.getGoldenBeanRemainingBalance()), "1")) {
|
||||
public void onSuccess(SudGameScoreBean data) {
|
||||
if (data.getGolden_bean_remaining_balance() == 1) {
|
||||
gameViewModel.setSudGameScoreBean(data);
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfReady(event.getSubReady());
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
@@ -539,9 +581,31 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
//结算状态
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
sudLoadDialog.setClickStatus(0);
|
||||
sudLoadDialog.setDouble(gameViewModel.getSudGameScoreBean().getGame_mode());
|
||||
sudLoadDialog.showDialog();
|
||||
//先获取用户信息再进行结算处理
|
||||
LiveNetManager.get(mContext).getSudGameInfo(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<List<SudGameInfoBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudGameInfoBean> data) {
|
||||
if (!data.isEmpty()){
|
||||
gameViewModel.setSudGameInfoBeanList(data);
|
||||
gameViewModel.sudGameRank(event.getMgCommonGameSettle());//结算游戏
|
||||
}else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
//点击开始游戏
|
||||
LiveNetManager.get(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(), mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
|
||||
Reference in New Issue
Block a user