fix 第一次进房PK进度指示器不对的问题
This commit is contained in:
@@ -150,6 +150,17 @@ public class PKBoardView extends RelativeLayout implements View.OnClickListener
|
||||
if (redTeamInfo != null) {
|
||||
tvRedTeamScore.setText(FormatUtils.formatPKValue(redTeamInfo.getScore()));
|
||||
}
|
||||
|
||||
if (redTeamInfo != null && blueTeamInfo != null) {
|
||||
long totalScore = redTeamInfo.getScore() + blueTeamInfo.getScore();
|
||||
if (totalScore > 0) {
|
||||
int percent = (int) ((float) redTeamInfo.getScore() / (float) totalScore * 100.0f);
|
||||
pbScore.setProgress(percent);
|
||||
} else {
|
||||
pbScore.setProgress(50);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
tvPkTimer.setText("未开始");
|
||||
if (!isTeamHaveMember(PKTeamInfo.TEAM_RED)) {
|
||||
|
Reference in New Issue
Block a user