From 92846565ae94144ea1423be61c37e5a7b1a920fa Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 2 Mar 2021 18:57:24 +0200 Subject: [PATCH] check if transaction is submittable after applying a template --- .../mobileledger/ui/new_transaction/NewTransactionModel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index b22bcc14..d0b99f3d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -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) { -- 2.39.2