From f020d744dfba9d442dac80ce4ed1699babdbbe3b Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 7 Mar 2021 11:43:16 +0200 Subject: [PATCH] note focused item changed when item is moved --- .../mobileledger/ui/new_transaction/NewTransactionModel.java | 5 +++++ 1 file changed, 5 insertions(+) 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 d092be21..68839e0a 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 @@ -348,6 +348,11 @@ public class NewTransactionModel extends ViewModel { List newList = shallowCopyList(); Item item = newList.remove(fromIndex); newList.add(toIndex, item); + + FocusInfo fi = focusInfo.getValue(); + if (fi != null && fi.position == fromIndex) + noteFocusChanged(toIndex, fi.element); + items.setValue(newList); // same count, same submittable state } void moveItemLast(List list, int index) { -- 2.39.5