From: Damyan Ivanov Date: Wed, 13 Nov 2019 21:40:29 +0000 (+0200) Subject: invert if(!smth) {} else {} condition X-Git-Tag: v0.11.0~63 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=19556400415dc20f36d10c68d74a44f68b0e57d3;p=mobile-ledger.git invert if(!smth) {} else {} condition --- 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 c455a014..82403a87 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 @@ -300,7 +300,11 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder String amount = String.valueOf(tvAmount.getText()); amount = amount.trim(); - if (!amount.isEmpty()) { + if (amount.isEmpty()) { + item.getAccount() + .resetAmount(); + } + else { try { amount = amount.replace(decimalSeparator, decimalDot); item.getAccount() @@ -315,9 +319,6 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder .resetAmount(); } } - else - item.getAccount() - .resetAmount(); break; case bottomFiller: