From 19556400415dc20f36d10c68d74a44f68b0e57d3 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 13 Nov 2019 23:40:29 +0200 Subject: [PATCH] invert if(!smth) {} else {} condition --- .../ui/activity/NewTransactionItemHolder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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: -- 2.39.5