X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fnew_transaction%2FNewTransactionItemHolder.java;h=3b69110a7c99cb8f75dc41e16e42c3a32f3e0da9;hb=728e2e597258e913891038ae72c2bd71dae850f6;hp=c6232d167f7e303af4d93be2222354918727cc36;hpb=a0508ea0def0c4c6400626f26517d8e69631ff15;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java index c6232d16..3b69110a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java @@ -230,12 +230,12 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder if (showCurrency) { b.currency.setVisibility(View.VISIBLE); b.currencyButton.setVisibility(View.VISIBLE); - b.currency.setText(mProfile.getDefaultCommodity()); + setCurrencyString(mProfile.getDefaultCommodity()); } else { b.currency.setVisibility(View.GONE); b.currencyButton.setVisibility(View.GONE); - b.currency.setText(null); + setCurrencyString(null); } }); @@ -436,7 +436,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder private void setCurrencyString(String currency) { @ColorInt int textColor = b.dummyText.getTextColors() .getDefaultColor(); - if ((currency == null) || currency.isEmpty()) { + if (TextUtils.isEmpty(currency)) { b.currency.setText(R.string.currency_symbol); int alpha = (textColor >> 24) & 0xff; alpha = alpha * 3 / 4; @@ -626,9 +626,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder try { b.accountRowAccName.setAdapter(null); b.accountRowAccName.setText(incomingAccountName); - if (b.accountRowAccName.hasFocus()) - b.accountRowAccName.setSelection( - acc.getAccountNameCursorPosition()); + b.accountRowAccName.setSelection(acc.getAccountNameCursorPosition()); } finally { b.accountRowAccName.setAdapter(a);