Skip to content

Commit

Permalink
Excluded games with score of 0 from stats, fixed match play display
Browse files Browse the repository at this point in the history
Fixes #86, fixes #87
  • Loading branch information
autoreleasefool committed Sep 24, 2015
1 parent 82f654c commit 05e65d3
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,10 @@ protected List<?>[] doInBackground(Byte... statsToLoad) {
}
}

short gameScore = cursor.getShort(cursor.getColumnIndex(Contract.GameEntry.COLUMN_SCORE));
boolean gameIsManual = (cursor.getInt(cursor.getColumnIndex(
Contract.GameEntry.COLUMN_IS_MANUAL)) == 1);
if (gameIsManual) {
if (gameIsManual || gameScore == 0) {
cursor.moveToNext();
continue;
}
Expand Down Expand Up @@ -731,13 +732,15 @@ private void setGeneralAndDetailedStatValues(
int totalMatchPlayGames = 0;
for (int stat : statValues[mStatsMatch])
totalMatchPlayGames += stat;
for (byte i = 0; i < statValues[mStatsMatch].length; i++)
listStatNamesAndValues.get(mStatsMatch).set(i, Pair.create(
listStatNamesAndValues.get(mStatsMatch).get(i).first,
decimalFormat.format(
statValues[mStatsMatch][i] / (double) totalMatchPlayGames * 100)
+ "% [" + statValues[mStatsMatch][i] + "/" + totalMatchPlayGames
+ "]"));
if (totalMatchPlayGames > 0) {
for (byte i = 0; i < statValues[mStatsMatch].length; i++)
listStatNamesAndValues.get(mStatsMatch).set(i, Pair.create(
listStatNamesAndValues.get(mStatsMatch).get(i).first,
decimalFormat.format(
statValues[mStatsMatch][i] / (double) totalMatchPlayGames * 100)
+ "% [" + statValues[mStatsMatch][i] + "/" + totalMatchPlayGames
+ "]"));
}

for (byte i = 0; i < statValues[mStatsOverall].length; i++)
listStatNamesAndValues.get(mStatsOverall).set(i, Pair.create(
Expand Down

0 comments on commit 05e65d3

Please sign in to comment.