From 7a908a83d216844fd20dc318cd532dabdeb337bb Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 13 Nov 2019 21:43:41 +0200 Subject: [PATCH] New transaction: fix clearing the single negative amount broken after ReecyclerView migration --- .../activity/NewTransactionItemsAdapter.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java index 21752a44..6844b6ce 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java @@ -21,7 +21,6 @@ import android.database.Cursor; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.LinearLayout; -import android.widget.TableRow; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; @@ -139,7 +138,8 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter accounts = tr.getAccounts(); - TableRow firstNegative = null; + NewTransactionModel.Item firstNegative = null; + boolean singleNegative = false; int negativeCount = 0; for (int i = 0; i < accounts.size(); i++) { LedgerTransactionAccount acc = accounts.get(i); @@ -152,12 +152,28 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter