use of se.oort.diplicity.apigen.GameResult in project android-diplicity by zond.
the class GameActivity method showGameResults.
public void showGameResults() {
setVisibility(View.GONE, R.id.solo_winner_label, R.id.solo_winner, R.id.dias_members_label, R.id.dias_members, R.id.nmr_game_members_label, R.id.nmr_game_members, R.id.eliminated_members_label, R.id.eliminated_members);
hideAllExcept(R.id.game_results_view);
final ScrollView gameResultsView = (ScrollView) findViewById(R.id.game_results_view);
gameResultsView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
flickFrameLayout.onTouchEvent(motionEvent);
gameResultsView.onTouchEvent(motionEvent);
return true;
}
});
if (game.Finished) {
handleReq(gameResultService.GameResultLoad(game.ID), new Sendable<SingleContainer<GameResult>>() {
@Override
public void send(SingleContainer<GameResult> gameResultSingleContainer) {
MemberListPopulater populater = new MemberListPopulater();
if (gameResultSingleContainer.Properties.SoloWinnerUser != null && !gameResultSingleContainer.Properties.SoloWinnerUser.equals("")) {
populater.populate(R.id.solo_winner, Arrays.asList(gameResultSingleContainer.Properties.SoloWinnerUser));
setVisibility(View.VISIBLE, R.id.solo_winner, R.id.solo_winner_label);
}
if (gameResultSingleContainer.Properties.DIASUsers != null) {
populater.populate(R.id.dias_members, gameResultSingleContainer.Properties.DIASUsers);
setVisibility(View.VISIBLE, R.id.dias_members, R.id.dias_members_label);
}
if (gameResultSingleContainer.Properties.EliminatedUsers != null) {
populater.populate(R.id.eliminated_members, gameResultSingleContainer.Properties.EliminatedUsers);
setVisibility(View.VISIBLE, R.id.eliminated_members, R.id.eliminated_members_label);
}
if (gameResultSingleContainer.Properties.NMRUsers != null) {
populater.populate(R.id.nmr_game_members, gameResultSingleContainer.Properties.NMRUsers);
setVisibility(View.VISIBLE, R.id.nmr_game_members, R.id.nmr_game_members_label);
}
if (gameResultSingleContainer.Properties.Scores != null) {
((MemberTable) findViewById(R.id.scored_members)).setScores(gameResultSingleContainer.Properties.Scores);
populater.populate(R.id.scored_members, gameResultSingleContainer.Properties.AllUsers);
setVisibility(View.VISIBLE, R.id.scored_members, R.id.scored_members_label);
}
}
}, getResources().getString(R.string.loading_game_result));
}
}
Aggregations