TDD 10 - split list and cumulative
This commit is contained in:
parent
9177307c37
commit
fcf8569b1e
1 changed files with 16 additions and 2 deletions
|
@ -336,6 +336,8 @@ public class TDDStatsActivity extends Activity {
|
||||||
double weighted05 = 0d;
|
double weighted05 = 0d;
|
||||||
double weighted07 = 0d;
|
double weighted07 = 0d;
|
||||||
|
|
||||||
|
|
||||||
|
//TDD table
|
||||||
for (TDD record : historyList) {
|
for (TDD record : historyList) {
|
||||||
double tdd = record.getTotal();
|
double tdd = record.getTotal();
|
||||||
|
|
||||||
|
@ -386,8 +388,20 @@ public class TDDStatsActivity extends Activity {
|
||||||
TableLayout.LayoutParams.MATCH_PARENT,
|
TableLayout.LayoutParams.MATCH_PARENT,
|
||||||
TableLayout.LayoutParams.WRAP_CONTENT));
|
TableLayout.LayoutParams.WRAP_CONTENT));
|
||||||
|
|
||||||
sum = sum + tdd;
|
|
||||||
i++;
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
//cumulative TDDs
|
||||||
|
for (TDD record : historyList) {
|
||||||
|
if(!historyList.isEmpty() && df.format(new Date(record.date)).equals(df.format(new Date()))) {
|
||||||
|
//Today should not be included
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
|
||||||
|
sum = sum + record.getTotal();
|
||||||
|
|
||||||
// Create the cumtable row
|
// Create the cumtable row
|
||||||
TableRow ctr = new TableRow(TDDStatsActivity.this);
|
TableRow ctr = new TableRow(TDDStatsActivity.this);
|
||||||
|
@ -430,7 +444,7 @@ public class TDDStatsActivity extends Activity {
|
||||||
tl.setBackgroundColor(Color.TRANSPARENT);
|
tl.setBackgroundColor(Color.TRANSPARENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) {
|
if(!historyList.isEmpty() && df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) {
|
||||||
//Today should not be included
|
//Today should not be included
|
||||||
historyList.remove(0);
|
historyList.remove(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue