]> git.ktnx.net Git - mobile-ledger.git/commitdiff
minimize flicker when applying templated transaction too
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 11 Mar 2021 07:48:43 +0000 (07:48 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 11 Mar 2021 07:48:43 +0000 (07:48 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java

index 9539476d77f063e3e7239e95591831b7a64c4052..7333561c5b52f129a77fe0eefb03de50a2d2c002 100644 (file)
@@ -260,6 +260,7 @@ public class NewTransactionModel extends ViewModel {
         if (Misc.emptyIsNull(transactionComment) != null)
             head.setComment(transactionComment);
 
+        Item.resetIdDispenser();
         List<Item> 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) {