]> git.ktnx.net Git - mobile-ledger.git/commitdiff
debug++
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 10 Nov 2019 17:48:22 +0000 (19:48 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 10 Nov 2019 17:48:22 +0000 (19:48 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java

index 81487af661a1f4b7dcc9c9539f1991755c32eba8..d051fe006a085da605433fc6302ab1bd4d2bef6d 100644 (file)
@@ -171,7 +171,26 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
             }
         };
         accountCountObserver = count -> {
-            if (getAdapterPosition() == count) tvAmount.setImeOptions(EditorInfo.IME_ACTION_DONE);
+            final int adapterPosition = getAdapterPosition();
+            final int layoutPosition = getLayoutPosition();
+            Logger.debug("holder",
+                    String.format(Locale.US, "count=%d; pos=%d, layoutPos=%d [%s]", count,
+                            adapterPosition, layoutPosition, item.getType()
+                                                                 .toString()
+                                                                 .concat(item.getType() ==
+                                                                         NewTransactionModel.ItemType.transactionRow
+                                                                         ? String.format(Locale.US,
+                                                                         "'%s'=%s",
+                                                                         item.getAccount()
+                                                                             .getAccountName(),
+                                                                         item.getAccount()
+                                                                             .isAmountSet()
+                                                                         ? String.format(Locale.US,
+                                                                                 "%.2f",
+                                                                                 item.getAccount()
+                                                                                     .getAmount())
+                                                                         : "unset") : "")));
+            if (adapterPosition == count) tvAmount.setImeOptions(EditorInfo.IME_ACTION_DONE);
             else tvAmount.setImeOptions(EditorInfo.IME_ACTION_NEXT);
         };
     }