From b8e535a8ce182cda0b860105f7d22b7bc9d62067 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 21 Dec 2018 18:50:44 +0000 Subject: [PATCH] separate view for transaction date, bold description --- .../mobileledger/TransactionListAdapter.java | 7 +++-- .../main/res/layout/transaction_list_row.xml | 31 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java b/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java index 65ef6db6..a6842e27 100644 --- a/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/TransactionListAdapter.java @@ -53,8 +53,8 @@ class TransactionListAdapter try (SQLiteDatabase db = MLDB.getReadableDatabase(ctx)) { tr.loadData(db); - holder.tvDescription - .setText(String.format("%s\t%s", tr.getDescription(), tr.getDate())); + holder.tvDescription.setText(tr.getDescription()); + holder.tvDate.setText(tr.getDate()); int rowIndex = 0; for (LedgerTransactionAccount acc : tr.getAccounts()) { @@ -120,13 +120,14 @@ class TransactionListAdapter return transactions.size(); } class TransactionRowHolder extends RecyclerView.ViewHolder { - TextView tvDescription; + TextView tvDescription, tvDate; LinearLayout tableAccounts; ConstraintLayout row; public TransactionRowHolder(@NonNull View itemView) { super(itemView); this.row = (ConstraintLayout) itemView; this.tvDescription = itemView.findViewById(R.id.transaction_row_description); + this.tvDate = itemView.findViewById(R.id.transaction_row_date); this.tableAccounts = itemView.findViewById(R.id.transaction_row_acc_amounts); } } diff --git a/app/src/main/res/layout/transaction_list_row.xml b/app/src/main/res/layout/transaction_list_row.xml index e35c331b..692e554b 100644 --- a/app/src/main/res/layout/transaction_list_row.xml +++ b/app/src/main/res/layout/transaction_list_row.xml @@ -32,14 +32,31 @@ - + android:orientation="horizontal" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"> + + + + +