]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryViewModel.java
fix traversing children when starring/un-starring accounts
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryViewModel.java
index dd7f0327634ef90d2ebbd01fe6453bad71b9c80c..32e719e707d1f8e9bdd95fe91753511421439920 100644 (file)
@@ -156,8 +156,7 @@ class AccountSummaryAdapter extends RecyclerView.Adapter<AccountSummaryAdapter.L
     void toggleChildrenOf(LedgerAccount parent, boolean hiddenToBe, int parentPosition) {
         int i = parentPosition + 1;
         for (LedgerAccount acc : Data.accounts.get()) {
-            String acc_parent = acc.getParentName();
-            if ((acc_parent != null) && acc.getParentName().equals(parent.getName())) {
+            if (acc.getName().startsWith(parent.getName() + ":")) {
                 acc.setHiddenToBe(hiddenToBe);
                 notifyItemChanged(i);
                 toggleChildrenOf(acc, hiddenToBe, i);