From: Damyan Ivanov Date: Sun, 17 Nov 2019 17:20:27 +0000 (+0200) Subject: NT setData(): expand ? : to an if, always set hint X-Git-Tag: v0.11.0~55 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=58206e7dc27c7b7aee008a7f1ac21b5a9e6658a9;p=mobile-ledger.git NT setData(): expand ? : to an if, always set hint --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java index 1d323a5b..e515690a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java @@ -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);