From 0ea92c00a2604d148c0bd1fe296578834c4bdd98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=89=8D=E5=8D=AB?= <2298122580@qq.com> Date: Thu, 18 Jul 2024 17:31:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?6.8.0:=E5=B0=8F=E6=B8=B8=E6=88=8F=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E7=95=8C=E9=9D=A2,=E8=A7=82=E4=BC=97=E8=A7=86?= =?UTF-8?q?=E8=A7=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dialog/SudGameDoubleDialog.java | 83 +++++++++++-------- 1 file changed, 49 insertions(+), 34 deletions(-) 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 96aefe35c..e79374df3 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameDoubleDialog.java @@ -43,6 +43,7 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{ private AppCompatTextView sub_win_name,sub_win_score,sub_loss_name,sub_loss_score,sub_time; private CountDownTimer countDownTimer; private List settleBeans = new ArrayList<>(); + private boolean containMe; @Override public void buildDialog(XPopup.Builder builder) { @@ -89,48 +90,62 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{ sortByWinNum(settleBeans); SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名 SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名 + checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己 - ImgLoader.display(mContext,sudSettleBean1.getAvatar_url(),sub_win_head); - ImgLoader.display(mContext,sudSettleBean2.getAvatar_url(),sub_loss_head); - sub_win_name.setText(sudSettleBean1.getNick_name()); - sub_loss_name.setText(sudSettleBean2.getNick_name()); - if (sudSettleBean1.getWin_num()>0){ - sub_win_score.setText("+"+sudSettleBean1.getWin_num()); - }else { - sub_win_score.setText(String.valueOf(sudSettleBean1.getWin_num())); - } - sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num())); + // 检查是否是当前用户 + boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid()); + boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num(); + boolean isZh = WordUtil.isNewZh(); - if (sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num()){ - //平局 - if (WordUtil.isNewZh()){ - sub_title.setImageResource(R.mipmap.sub_draw_zh); - }else { - sub_title.setImageResource(R.mipmap.sub_draw_en); + if (containMe) { + // 当前用户在游戏中 + SudSettleBean winBean = isFirstMe ? sudSettleBean1 : sudSettleBean2; + SudSettleBean lossBean = isFirstMe ? sudSettleBean2 : sudSettleBean1; + + ImgLoader.display(mContext, winBean.getAvatar_url(), sub_win_head); + ImgLoader.display(mContext, lossBean.getAvatar_url(), sub_loss_head); + sub_win_name.setText(winBean.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) { + // 平局 + sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en); + sub_win_hat.setVisibility(View.GONE); + } else { + // 胜利或失败 + sub_title.setImageResource(isZh ? (isFirstMe ? R.mipmap.sub_win_zh : R.mipmap.sub_loss_zh) : (isFirstMe ? R.mipmap.sub_win_en : R.mipmap.sub_loss_en)); + sub_win_hat.setVisibility(View.VISIBLE); } - sub_win_hat.setVisibility(View.GONE); - }else { - //有胜负 - sub_win_hat.setVisibility(View.VISIBLE); - if (CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid())){ - //本人胜利 - if (WordUtil.isNewZh()){ - sub_title.setImageResource(R.mipmap.sub_win_zh); - }else { - sub_title.setImageResource(R.mipmap.sub_win_en); - } - }else { - //本人失败 - if (WordUtil.isNewZh()){ - sub_title.setImageResource(R.mipmap.sub_loss_zh); - }else { - sub_title.setImageResource(R.mipmap.sub_loss_en); - } + } else { + // 当前用户不在游戏中 + ImgLoader.display(mContext, sudSettleBean1.getAvatar_url(), sub_win_head); + ImgLoader.display(mContext, sudSettleBean2.getAvatar_url(), sub_loss_head); + sub_win_name.setText(sudSettleBean1.getNick_name()); + sub_loss_name.setText(sudSettleBean2.getNick_name()); + + sub_win_score.setText(sudSettleBean1.getWin_num() > 0 ? "+" + sudSettleBean1.getWin_num() : String.valueOf(sudSettleBean1.getWin_num())); + sub_loss_score.setText(String.valueOf(sudSettleBean2.getWin_num())); + + if (isDraw) { + // 平局 + sub_title.setImageResource(isZh ? R.mipmap.sub_draw_zh : R.mipmap.sub_draw_en); + sub_win_hat.setVisibility(View.GONE); + } else { + // 非当前用户的胜利 + sub_title.setImageResource(isZh ? R.mipmap.sub_win_zh : R.mipmap.sub_win_en); + sub_win_hat.setVisibility(View.VISIBLE); } } } } + private void checkMe(String id1,String id2){ + containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2); + } + @Override protected void onShow() { super.onShow(); From cf245b0df8ed90143486bf51ec2021c0a287f382 Mon Sep 17 00:00:00 2001 From: gongduoxiang Date: Thu, 18 Jul 2024 18:19:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9C=89=E4=BA=9B=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=9A=84=E4=B8=9C=E8=A5=BF=E4=B8=8D=E5=8E=BB=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6f233b2b9..660a19276 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,6 +24,6 @@ android.nonTransitiveRClass=false systemProp.http.proxyHost=127.0.0.1 systemProp.https.proxyHost=127.0.0.1 -systemProp.https.proxyPort=10809 -systemProp.http.proxyPort=10809 +systemProp.https.proxyPort=7890 +systemProp.http.proxyPort=7890 android.enableR8.fullMode=true \ No newline at end of file