import net.ktnx.mobileledger.ui.transaction_list.TransactionListFragment;
import net.ktnx.mobileledger.ui.transaction_list.TransactionListViewModel;
import net.ktnx.mobileledger.utils.Colors;
+import net.ktnx.mobileledger.utils.LockHolder;
import net.ktnx.mobileledger.utils.MLDB;
import java.lang.ref.WeakReference;
// removing all child accounts from the view
int start = -1, count = 0;
+ try (LockHolder lh = Data.accounts.lockForWriting()) {
for (int i = 0; i < Data.accounts.size(); i++) {
if (acc.isParentOf(Data.accounts.get(i))) {
// Log.d("accounts", String.format("Found a child '%s' at position %d",
mAccountSummaryFragment.modelAdapter
.notifyItemRangeRemoved(start, count);
+ }
}
}
else {
animator.rotationBy(-180);
List<LedgerAccount> children =
Data.profile.get().loadVisibleChildAccountsOf(acc);
+ try (LockHolder lh = Data.accounts.lockForWriting()) {
int parentPos = Data.accounts.indexOf(acc);
if (parentPos != -1) {
// may have disappeared in a concurrent refresh operation
mAccountSummaryFragment.modelAdapter
.notifyItemRangeInserted(parentPos + 1, children.size());
}
+ }
}
break;
case R.id.account_row_acc_amounts: