Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for fully recursive lists (expansion, collapsing, and update) #397

Merged
merged 4 commits into from
Jun 30, 2017

Conversation

gwailoTr0n5000
Copy link
Contributor

Code added to support full recursion, returning all nested subchildren that are expanded and thus appropriate counts for expansion and collapse.

Pedro added 4 commits June 21, 2017 12:25
…item positions will be checked for nested expansion during update.
…e into account recursive expansions at previous subitems.
…h is not necessary since the method already traverses recursively through subitems as expansions occur. Cleaned up comments and removed unused variable.
Copy link
Owner

@davideas davideas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make those changes.

@@ -4945,7 +4976,7 @@ private RestoreInfo getPendingRemovedItem(T item) {
* @since 5.0.0-b1
*/
private void createRestoreSubItemInfo(IExpandable expandable, T item) {
List<T> siblings = getExpandableList(expandable);
List<T> siblings = getExpandableList(expandable, true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this call should return only direct siblings, so the parameter should be false.
Because when restoring deleted items in restoreDeletedItems(), the position is relative to the parent when addSubItem() is called there.

for(int index = 0; index < subPosition; index++) {
T tempSubItem = subItems.get(index);
// Check whether item is also expandable, and expanded
if(this.isExpandable(tempSubItem) && ((IExpandable) tempSubItem).isExpanded()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When isExpanded() is called isExpandable() is checked internally too.

// Add the current subitem
subItems.add(subItem);
// If expandable, expanded, and of non-zero size, recursively add sub-subItems
if(this.isExpandable(subItem) &&
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, isExpandable() can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants