]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java
check if transaction is submittable after applying a template
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / new_transaction / NewTransactionModel.java
index da09fd89a3818dcb9835bf3f96643b792d891d98..d0b99f3d558c4106238b5747dd1e94fecc826995 100644 (file)
@@ -18,6 +18,8 @@
 package net.ktnx.mobileledger.ui.new_transaction;
 
 import android.annotation.SuppressLint;
+import android.os.Handler;
+import android.os.Looper;
 import android.text.TextUtils;
 
 import androidx.annotation.NonNull;
@@ -276,7 +278,7 @@ public class NewTransactionModel extends ViewModel {
                   newItems.add(accRow);
               }
 
-              items.postValue(newItems);
+              new Handler(Looper.getMainLooper()).post(() -> setItems(newItems));
           });
     }
     private int extractIntFromMatches(MatchResult m, Integer group, Integer literal) {
@@ -1035,7 +1037,7 @@ public class NewTransactionModel extends ViewModel {
         private boolean amountSet;
         private boolean amountValid = true;
         private FocusedElement focusedElement = FocusedElement.Account;
-        private boolean amountHintIsSet = false;
+        private boolean amountHintIsSet = true;
         private boolean isLast = false;
         public TransactionAccount(TransactionAccount origin) {
             id = origin.id;