6.8.0:小游戏结算界面,观众视角修改
This commit is contained in:
parent
a0f3f246a6
commit
0ea92c00a2
@ -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<SudSettleBean> settleBeans = new ArrayList<>();
|
||||
private boolean containMe;
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
@ -89,46 +90,60 @@ public class SudGameDoubleDialog extends AbsDialogCenterPopupWindow{
|
||||
sortByWinNum(settleBeans);
|
||||
SudSettleBean sudSettleBean1 = settleBeans.get(0); // 第一名
|
||||
SudSettleBean sudSettleBean2 = settleBeans.get(1); // 第二名
|
||||
checkMe(sudSettleBean1.getUid(),sudSettleBean2.getUid());//判断这场对局是不是包含自己
|
||||
|
||||
// 检查是否是当前用户
|
||||
boolean isFirstMe = CommonAppConfig.getInstance().getUid().equals(sudSettleBean1.getUid());
|
||||
boolean isDraw = sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num();
|
||||
boolean isZh = WordUtil.isNewZh();
|
||||
|
||||
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);
|
||||
}
|
||||
} 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());
|
||||
if (sudSettleBean1.getWin_num()>0){
|
||||
sub_win_score.setText("+"+sudSettleBean1.getWin_num());
|
||||
}else {
|
||||
sub_win_score.setText(String.valueOf(sudSettleBean1.getWin_num()));
|
||||
}
|
||||
|
||||
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 (sudSettleBean1.getWin_num() == sudSettleBean2.getWin_num()){
|
||||
if (isDraw) {
|
||||
// 平局
|
||||
if (WordUtil.isNewZh()){
|
||||
sub_title.setImageResource(R.mipmap.sub_draw_zh);
|
||||
}else {
|
||||
sub_title.setImageResource(R.mipmap.sub_draw_en);
|
||||
}
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMe(String id1,String id2){
|
||||
containMe = CommonAppConfig.getInstance().getUid().equals(id1) || CommonAppConfig.getInstance().getUid().equals(id2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user