From: Damyan Ivanov Date: Sun, 15 Mar 2020 05:51:04 +0000 (+0200) Subject: NT: show currency selection trigger only in a transaction row X-Git-Tag: v0.12.0~67 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=5dd947c640d975082c5aa05328fa75bc6ac852fb;p=mobile-ledger.git NT: show currency selection trigger only in a transaction row not in the header/padding (these would throw on setCurrency(null) call) --- 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 d7017e21..37506c04 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 @@ -356,13 +356,15 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder currencyObserver = this::setCurrency; showCurrencyObserver = showCurrency -> { - if (showCurrency) { - tvCurrency.setVisibility(View.VISIBLE); - } - else { - tvCurrency.setVisibility(View.GONE); - setCurrencyString(null); - } + if (item.getType() == ItemType.transactionRow) { + if (showCurrency) { + tvCurrency.setVisibility(View.VISIBLE); + } + else { + tvCurrency.setVisibility(View.GONE); + item.setCurrency(null); + } + } }; } private void updateCurrencyPositionAndPadding(Currency.Position position, boolean hasGap) {