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

Fix a bug that ExpandableGroup#getPosition returns wrong index #231

Merged
merged 2 commits into from Dec 4, 2018

Conversation

CORDEA
Copy link
Contributor

@CORDEA CORDEA commented Nov 21, 2018

Currently, ExpandableGroup#getPosition returns the same value (0) for parent item and nonexistent item.

@Test
public void testGetHeaderPosition() throws Exception {
    ExpandableGroup expandableGroup = new ExpandableGroup(parent);
    assertEquals(0, expandableGroup.getPosition(parent)); // parent position
    Section notAddedSection = new Section();
    assertEquals(0, expandableGroup.getPosition(notAddedSection)); // nonexistent item position
}

But Section and UpdatingGroup seems to return -1 when target group does not exist, so I want to make ExpandableGroup the same behavior. This makes it clear that 0 is a parent item and -1 is a nonexistent item.

Please try to consider this ;)

@lisawray
Copy link
Owner

lisawray commented Dec 4, 2018

Seems reasonable!

@lisawray lisawray merged commit 2a16db2 into lisawray:master Dec 4, 2018
@CORDEA CORDEA deleted the fix/expandable-group-wrong-index branch December 4, 2018 08:43
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.

None yet

2 participants