diff --git a/app/src/google_online/google-services.json b/app/src/google_online/google-services.json index 989be3f53..4f9023d32 100644 --- a/app/src/google_online/google-services.json +++ b/app/src/google_online/google-services.json @@ -13,6 +13,14 @@ } }, "oauth_client": [ + { + "client_id": "822566078854-8c7698l64j66ijng9bq799o5qvbguhdo.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.newpdlive.sy", + "certificate_hash": "e059b937bfa49d58f40fddee4c7463e03e2aae47" + } + }, { "client_id": "822566078854-9cej31ie42tgjeimdk691gmvkavrooa7.apps.googleusercontent.com", "client_type": 1, diff --git a/app/src/google_test/google-services.json b/app/src/google_test/google-services.json index 989be3f53..4f9023d32 100644 --- a/app/src/google_test/google-services.json +++ b/app/src/google_test/google-services.json @@ -13,6 +13,14 @@ } }, "oauth_client": [ + { + "client_id": "822566078854-8c7698l64j66ijng9bq799o5qvbguhdo.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.newpdlive.sy", + "certificate_hash": "e059b937bfa49d58f40fddee4c7463e03e2aae47" + } + }, { "client_id": "822566078854-9cej31ie42tgjeimdk691gmvkavrooa7.apps.googleusercontent.com", "client_type": 1, diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 4397e9546..9069a94f4 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -372,7 +372,7 @@ public class AppContext extends CommonAppContext { }); }).setUncaughtCrashHandler((t, e) -> { - Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息 + Log.e("ApplicationError", "子线程异常"); e.printStackTrace(); }).register(this); } diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java b/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java index ffe5b4399..641cab94d 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java @@ -110,6 +110,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow { sub_loss_name.setVisibility(View.VISIBLE); winActivityIcon.setVisibility(View.VISIBLE); lossActivityIcon.setVisibility(View.VISIBLE); + boolean isFirstMe=false; if (settleBeans.size() == 2) { sortByWinNum(settleBeans); SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名 @@ -118,8 +119,8 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow { LogUtils.e("第一名:" + sudSettleBean1.getNick_name()); LogUtils.e("第二名:" + sudSettleBean2.getNick_name()); // 检查是否是当前用户 - boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid()); - boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num(); + isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid()); + boolean isDraw = sudSettleBean1.getRank() == sudSettleBean2.getRank(); boolean isZh = WordUtil.isNewZh(); String myUid = CommonAppConfig.getInstance().getUid(); LogUtils.e("isFirstMe:" + isFirstMe); @@ -137,8 +138,8 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow { if (isActivityGame) { Map 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"))); + //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; @@ -182,7 +183,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow { if (isActivityGame) { Map map = showActivityGameScore(); if (!map.isEmpty()) { - isDraw = map.get("win").intValue() == map.get("loss").intValue(); + // isDraw = map.get("win").intValue() == map.get("loss").intValue(); } } else { sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num())); @@ -208,14 +209,40 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow { } System.out.println("是否为活动游戏" + isActivityGame + " 成就内容:" + gameSettle.achievement); if (isActivityGame) { - //TODO 败者没显示成就 if (!StringUtil.isEmpty(gameSettle.achievement)) { + if(!isFirstMe){ + switch (gameSettle.achievementValue) { + case 1: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_1); + break; + case 2: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_2); + break; + case 3: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_3); + break; + case 4: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_4); + break; + case 5: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_5); + break; + case 6: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_6); + break; + case 7: + gameSettle.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_7); + break; + } + } 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); + }else{ + activityGameAchievement.setVisibility(View.GONE); } if (sub_loss_score.getVisibility() == View.VISIBLE) { lossActivityIcon.setVisibility(View.VISIBLE); @@ -295,14 +322,17 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow { } } Collections.sort(list, (bean1, bean2) -> { - return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序 + //return Integer.compare(bean2.getWin_num(), bean1.getWin_num()); // 从大到小排序 + return bean1.getRank()-bean2.getRank(); // 从大到小排序 }); LogUtils.e("排序后=====>" + settleBeans); } private void destroyDialog() { dismiss(); - countDownTimer.cancel(); + if(countDownTimer!=null) { + countDownTimer.cancel(); + } countDownTimer = null; } diff --git a/common/src/main/java/com/yunbao/common/manager/RandomSudGameManager.java b/common/src/main/java/com/yunbao/common/manager/RandomSudGameManager.java index e42b95309..369ff77a5 100644 --- a/common/src/main/java/com/yunbao/common/manager/RandomSudGameManager.java +++ b/common/src/main/java/com/yunbao/common/manager/RandomSudGameManager.java @@ -2,9 +2,6 @@ package com.yunbao.common.manager; import android.app.Dialog; import android.content.Context; -import android.content.DialogInterface; -import android.os.Handler; -import android.os.Looper; import android.text.Spannable; import android.text.SpannableString; import android.text.TextUtils; @@ -16,7 +13,6 @@ import com.yunbao.common.R; import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.bean.BallClearanceTableJoinRoomBean; import com.yunbao.common.bean.CreateSudRoomModel; -import com.yunbao.common.bean.SudGameRoomInfoBean; import com.yunbao.common.event.CheckCurrencyModel; import com.yunbao.common.event.CheckRemainingBalanceEvent; import com.yunbao.common.http.base.HttpCallback; @@ -28,7 +24,6 @@ import com.yunbao.common.sud.QuickStartGameViewModel; import com.yunbao.common.sud.state.SudMGPMGState; import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.DialogUitl; -import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; @@ -39,7 +34,6 @@ public class RandomSudGameManager { private static RandomSudGameManager manager; private AbsRandomGameManager gameManager; private CreateSudRoomModel sudRoomModel; - private QuickStartGameViewModel gameViewModel; private boolean isRandom = false; public static RandomSudGameManager getManager() { @@ -81,14 +75,16 @@ public class RandomSudGameManager { } private void createRoom(Context mContext) { - if(gameManager!=null){ - gameManager.randomCreateRoom(mContext, new OnItemClickListener() { - @Override - public void onItemClick(CreateSudRoomModel bean, int position) { - start(bean, true, true); - } - }); + if(gameManager==null){ + gameManager = new BilliardsRandomManager(); + gameManager.setRandom(isRandom); } + gameManager.randomCreateRoom(mContext, new OnItemClickListener() { + @Override + public void onItemClick(CreateSudRoomModel bean, int position) { + start(bean, true, true); + } + }); } public void reset() { @@ -247,7 +243,6 @@ public class RandomSudGameManager { } public void setGameViewModel(QuickStartGameViewModel gameViewModel) { - this.gameManager = gameManager; if (gameManager != null) { gameManager.setGameViewModel(gameViewModel); } diff --git a/common/src/main/java/com/yunbao/common/manager/game/BilliardsRandomManager.java b/common/src/main/java/com/yunbao/common/manager/game/BilliardsRandomManager.java index 163c698c6..fe94ccbc9 100644 --- a/common/src/main/java/com/yunbao/common/manager/game/BilliardsRandomManager.java +++ b/common/src/main/java/com/yunbao/common/manager/game/BilliardsRandomManager.java @@ -185,6 +185,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager { @Override public void onGameMGCommonGameBilliardsHitState(SudMGPMGState.MGCommonGameBilliardsHitState model) { + LogUtils.e("uid:"+model.uid,"state:"+model.state); if (Integer.parseInt(model.uid) == IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo().getId()) { if (isOneOverForMy == -1) { isOneOverForMy = 1; @@ -220,6 +221,7 @@ public class BilliardsRandomManager extends AbsRandomGameManager { @Override public boolean onGameMGCommonGameSettle(SudMGPMGState.MGCommonGameSettle model) { System.out.println("游戏结束 :" + isOneOverForMy + "|" + comboNumberForMy); + model.achievementValue=comboNumberForMy; if (isOneOverForMy == 1 && comboNumberForMy > 1) { model.achievement = WordUtil.getNewString(R.string.game_dialog_activity_achievements_0); } else if (comboNumberForMy > 0) { diff --git a/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java b/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java index 742f9e8bb..464276ab6 100644 --- a/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java +++ b/common/src/main/java/com/yunbao/common/sud/state/SudMGPMGState.java @@ -195,6 +195,7 @@ public class SudMGPMGState implements Serializable { public List activityGameInfoBean; public List sudSettleBeans; public String achievement; + public int achievementValue; @Override public String toString() { return "MGCommonGameSettle{" + diff --git a/common/src/main/res/layout/view_live_system_message.xml b/common/src/main/res/layout/view_live_system_message.xml index f2e2924b1..6430b2b53 100644 --- a/common/src/main/res/layout/view_live_system_message.xml +++ b/common/src/main/res/layout/view_live_system_message.xml @@ -7,37 +7,40 @@ app:cardBackgroundColor="@color/white" app:cardCornerRadius="15dp" app:cardElevation="0dp"> - + - + android:textSize="17sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/time_text" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + android:textSize="13sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + - + - - + > + + + + + + + -