From: Damyan Ivanov Date: Thu, 11 Mar 2021 07:48:43 +0000 (+0000) Subject: minimize flicker when applying templated transaction too X-Git-Tag: v0.17.0~2 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=38a70bbc9effabacaadd63b6fc7eba81592e0c5d;p=mobile-ledger.git minimize flicker when applying templated transaction too --- 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 9539476d..7333561c 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 @@ -260,6 +260,7 @@ public class NewTransactionModel extends ViewModel { if (Misc.emptyIsNull(transactionComment) != null) head.setComment(transactionComment); + Item.resetIdDispenser(); List newItems = new ArrayList<>(); newItems.add(head); @@ -299,7 +300,7 @@ public class NewTransactionModel extends ViewModel { newItems.add(accRow); } - new Handler(Looper.getMainLooper()).post(() -> setItems(newItems)); + new Handler(Looper.getMainLooper()).post(() -> replaceItems(newItems)); }); } private int extractIntFromMatches(MatchResult m, Integer group, Integer literal) {