import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
- List<LedgerAccount> accounts = Data.accounts.get();
- if (position < accounts.size()) {
- LedgerAccount acc = accounts.get(position);
+ if (position < Data.accounts.size()) {
+ LedgerAccount acc = Data.accounts.get(position);
- for (LedgerAccount acc : Data.accounts.get()) acc.setHiddenByStarToBe(acc.isHiddenByStar());
+ for (int i = 0; i < Data.accounts.size(); i++ ) {
+ LedgerAccount acc = Data.accounts.get(i);
+ acc.setHiddenByStarToBe(acc.isHiddenByStar());
+ }
acc.toggleHiddenToBe();
toggleChildrenOf(acc, acc.isHiddenByStarToBe(), position);
notifyItemChanged(position);
}
void toggleChildrenOf(LedgerAccount parent, boolean hiddenToBe, int parentPosition) {
int i = parentPosition + 1;
acc.toggleHiddenToBe();
toggleChildrenOf(acc, acc.isHiddenByStarToBe(), position);
notifyItemChanged(position);
}
void toggleChildrenOf(LedgerAccount parent, boolean hiddenToBe, int parentPosition) {
int i = parentPosition + 1;