]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java
fix IME hints for amount inputs
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / new_transaction / NewTransactionItemHolder.java
index 1725f91a64ae0c58ffc7ca5652db67007a7d1e3f..e4afc812aa0e35ae7dfd83d86f83ec64e76443b6 100644 (file)
@@ -264,16 +264,6 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                              ignoreFocusChanges = false;
                          }
                      });
-        adapter.model.getAccountCount()
-                     .observe(activity, count -> {
-                         final int adapterPosition = getAdapterPosition();
-                         final int layoutPosition = getLayoutPosition();
-
-                         if (adapterPosition == count)
-                             b.accountRowAccAmounts.setImeOptions(EditorInfo.IME_ACTION_DONE);
-                         else
-                             b.accountRowAccAmounts.setImeOptions(EditorInfo.IME_ACTION_NEXT);
-                     });
 
         Data.currencyGap.observe(activity,
                 hasGap -> updateCurrencyPositionAndPadding(Data.currencySymbolPosition.getValue(),
@@ -606,6 +596,9 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                         b.accountRowAccAmounts.setHint(amountHint);
                     }
 
+                    b.accountRowAccAmounts.setImeOptions(
+                            acc.isLast() ? EditorInfo.IME_ACTION_DONE : EditorInfo.IME_ACTION_NEXT);
+
                     setCurrencyString(acc.getCurrency());
                     b.accountRowAccAmounts.setText(
                             acc.isAmountSet() ? String.format("%4.2f", acc.getAmount()) : null);
@@ -616,6 +609,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                     b.ntrData.setVisibility(View.GONE);
                     b.ntrAccount.setVisibility(View.VISIBLE);
                     b.ntrPadding.setVisibility(View.GONE);
+
                     setEditable(true);
                 }
                 else {