From dfe6ac5dc9a45dc987031d2e45a1fa044452e2dd Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 15 Dec 2018 19:38:02 +0000 Subject: [PATCH] show accounts and amounts in the transaction list still looks very ugly and needs further work --- .../ktnx/mobileledger/TransactionListAdapter.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java b/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java index f190efcd..4b8a8708 100644 --- a/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java @@ -47,7 +47,19 @@ class TransactionListAdapter Resources rm = ctx.getResources(); holder.tvDescription.setText(String.format("%s\n%s", tr.getDescription(), tr.getDate())); -// holder.tableAccounts.setText(acc.getAmountsString()); + TableLayout tbl = holder.row.findViewById(R.id.transaction_row_acc_amounts); + tbl.removeAllViews(); + for (Iterator it = tr.getItemsIterator(); it.hasNext(); ) { + LedgerTransactionItem acc = it.next(); + TableRow row = new TableRow(holder.row.getContext()); + TextView child = new TextView(ctx); + child.setText(acc.getShortAccountName()); + row.addView(child); + child = new TextView(ctx); + child.setText(acc.toString()); + row.addView(child); + tbl.addView(row); + } if (position % 2 == 0) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) holder.row -- 2.39.5