]> git.ktnx.net Git - mobile-ledger.git/commitdiff
drop remnants of hollow transaction list item
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 3 May 2019 16:11:38 +0000 (19:11 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 3 May 2019 16:11:38 +0000 (19:11 +0300)
app/src/main/java/net/ktnx/mobileledger/model/TransactionListItem.java
app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java
app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java
app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionRowHolder.java
app/src/main/res/layout/transaction_list_row.xml

index 75cae3be1eb4fe7944e584f4ffc7b1a197c45a81..e24647f22361205d6cd63b477873f2ad45deb8ca 100644 (file)
@@ -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}
 }
index a15ab0f6c68c18220db79d4ef0a3c17c2799ea5d..49249686bae889dae4d5714ad5d50498f53beb32 100644 (file)
@@ -65,7 +65,6 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
             case TRANSACTION:
                 holder.vTransaction.setVisibility(View.VISIBLE);
                 holder.vDelimiter.setVisibility(View.GONE);
-                holder.vTrailer.setVisibility(View.GONE);
                 LedgerTransaction tr = item.getTransaction();
 
                 //        debug("transactions", String.format("Filling position %d with %d accounts", position,
@@ -86,7 +85,6 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
             case DELIMITER:
                 Date date = item.getDate();
                 holder.vTransaction.setVisibility(View.GONE);
-                holder.vTrailer.setVisibility(View.GONE);
                 holder.vDelimiter.setVisibility(View.VISIBLE);
                 holder.tvDelimiterDate.setText(DateFormat.getDateInstance().format(date));
                 if (item.isMonthShown()) {
@@ -105,12 +103,6 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
                     holder.vDelimiterLine.setVisibility(View.VISIBLE);
                     holder.vDelimiterThick.setVisibility(View.GONE);
                 }
-                break;
-            case TRAILER:
-                holder.vTransaction.setVisibility(View.GONE);
-                holder.vTrailer.setVisibility(View.VISIBLE);
-                holder.vDelimiter.setVisibility(View.GONE);
-
                 break;
         }
     }
index bd53c2d812e99de09e9c829044bbf49b4aa957f6..ef93d6436b4be23b148f82c8193810dc18c391e4 100644 (file)
@@ -41,8 +41,7 @@ public class TransactionListViewModel extends ViewModel {
     public static TransactionListItem getTransactionListItem(int position) {
         if (Data.transactions == null) return null;
         try(LockHolder lh = Data.transactions.lockForReading()) {
-            if (position >= 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);
         }
     }
index c6331a09800d03b6ad0fc65f1ae84ce8ef46c814..c76dbcc7ff4c900435c2c754af50e17fb377d773 100644 (file)
@@ -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);
     }
 }
index 6fd70e349db795b634d5ef1c4e63590a37308b25..5e398e7dcb80cf64a0c58f014a40dae1cd63e659 100644 (file)
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 
-    <view
-        android:id="@+id/transaction_list_trailer"
-        class="androidx.constraintlayout.widget.Placeholder"
-        id="@+id/view"
-        android:layout_width="match_parent"
-        android:layout_height="80dp" />
 </androidx.appcompat.widget.ContentFrameLayout>
\ No newline at end of file