]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix traversing children when starring/un-starring accounts
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 10 Jan 2019 21:37:23 +0000 (21:37 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 10 Jan 2019 21:37:23 +0000 (21:37 +0000)
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);