- newList.add(new LedgerTransaction(transaction_id));
- Log.d("UTT", String.format("got transaction %d", transaction_id));
+ String dateString = cursor.getString(1);
+ Calendar date = Globals.parseLedgerDateAsCalendar(dateString);
+
+ if (!lastDateString.equals(dateString)) {
+ boolean showMonth =
+ (date.get(Calendar.MONTH) != lastDate.get(Calendar.MONTH)) ||
+ (date.get(Calendar.YEAR) != lastDate.get(Calendar.YEAR));
+ newList.add(new TransactionListItem(date.getTime(), showMonth));
+ }
+ newList.add(
+ new TransactionListItem(new LedgerTransaction(transaction_id), odd));
+// debug("UTT", String.format("got transaction %d", transaction_id));
+
+ lastDate = date;
+ lastDateString = dateString;
+ odd = !odd;