]> git.ktnx.net Git - mobile-ledger.git/commitdiff
NT setData(): expand ? : to an if, always set hint
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 17 Nov 2019 17:20:27 +0000 (19:20 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 17 Nov 2019 17:20:27 +0000 (19:20 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java

index 1d323a5b705476d30d0e5392b04c5eb970dc2991..e515690a0ef8586cab11550c8fc6fd35a1573be9 100644 (file)
@@ -368,8 +368,14 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                 case transactionRow:
                     LedgerTransactionAccount acc = item.getAccount();
                     tvAccount.setText(acc.getAccountName());
-                    tvAmount.setText(
-                            acc.isAmountSet() ? String.format("%1.2f", acc.getAmount()) : "");
+                    if (acc.isAmountSet()) {
+                        tvAmount.setText(String.format("%1.2f", acc.getAmount()));
+                    }
+                    else {
+                        tvAmount.setText("");
+//                        tvAmount.setHint(R.string.zero_amount);
+                    }
+                    tvAmount.setHint(item.getAmountHint());
                     lHead.setVisibility(View.GONE);
                     lAccount.setVisibility(View.VISIBLE);
                     lPadding.setVisibility(View.GONE);