From 0fa224a099da7c2a0e2ad4cb7db8a7391de9be15 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 3 May 2019 19:11:38 +0300 Subject: [PATCH] drop remnants of hollow transaction list item --- .../net/ktnx/mobileledger/model/TransactionListItem.java | 5 +---- .../ui/transaction_list/TransactionListAdapter.java | 8 -------- .../ui/transaction_list/TransactionListViewModel.java | 3 +-- .../ui/transaction_list/TransactionRowHolder.java | 2 -- app/src/main/res/layout/transaction_list_row.xml | 6 ------ 5 files changed, 2 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/model/TransactionListItem.java b/app/src/main/java/net/ktnx/mobileledger/model/TransactionListItem.java index 75cae3be..e24647f2 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/TransactionListItem.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/TransactionListItem.java @@ -27,9 +27,6 @@ public class TransactionListItem { private boolean monthShown; private LedgerTransaction transaction; private boolean odd; - public TransactionListItem() { - this.type = Type.TRAILER; - } public TransactionListItem(Date date, boolean monthShown) { this.type = Type.DELIMITER; this.date = date; @@ -56,5 +53,5 @@ public class TransactionListItem { public boolean isOdd() { return odd; } - public enum Type {TRANSACTION, DELIMITER, TRAILER} + public enum Type {TRANSACTION, DELIMITER} } diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java index a15ab0f6..49249686 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java @@ -65,7 +65,6 @@ public class TransactionListAdapter extends RecyclerView.Adapter= Data.transactions.size() + 1) return null; - if (position == Data.transactions.size()) return new TransactionListItem(); + if (position >= Data.transactions.size()) return null; return Data.transactions.get(position); } } diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionRowHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionRowHolder.java index c6331a09..c76dbcc7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionRowHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionRowHolder.java @@ -35,7 +35,6 @@ class TransactionRowHolder extends RecyclerView.ViewHolder { CardView vTransaction; TextView tvDelimiterMonth, tvDelimiterDate; View vDelimiterLine, vDelimiterThick; - View vTrailer; public TransactionRowHolder(@NonNull View itemView) { super(itemView); this.row = itemView.findViewById(R.id.transaction_row); @@ -47,6 +46,5 @@ class TransactionRowHolder extends RecyclerView.ViewHolder { this.tvDelimiterMonth = itemView.findViewById(R.id.transaction_delimiter_month); this.vDelimiterLine = itemView.findViewById(R.id.transaction_delimiter_line); this.vDelimiterThick = itemView.findViewById(R.id.transaction_delimiter_thick); - this.vTrailer = itemView.findViewById(R.id.transaction_list_trailer); } } diff --git a/app/src/main/res/layout/transaction_list_row.xml b/app/src/main/res/layout/transaction_list_row.xml index 6fd70e34..5e398e7d 100644 --- a/app/src/main/res/layout/transaction_list_row.xml +++ b/app/src/main/res/layout/transaction_list_row.xml @@ -205,10 +205,4 @@ - \ No newline at end of file -- 2.39.5