pafra88 / tree-view-list-android

Automatically exported from code.google.com/p/tree-view-list-android
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Bug fix #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. getPreviousSibling in InMemoryTreeStateManager
previousSibling is never set.

Suggest adding previousSibling = child.getId();
as follows:

    public synchronized T getPreviousSibling(final T id) {
        final T parent = getParent(id);
        final InMemoryTreeNode<T> parentNode = getNodeFromTreeOrThrowAllowRoot(parent);
        T previousSibling = null;
        for (final InMemoryTreeNode<T> child : parentNode.getChildren()) {
            if (child.getId().equals(id)) {
                return previousSibling;
            }
            //added this line
            previousSibling = child.getId();
        }
        return null;
    }

Original issue reported on code.google.com by mddavid...@gmail.com on 21 Aug 2012 at 9:43

GoogleCodeExporter commented 9 years ago
Thanks a lot! It's fixed now. Stupid mistake :(

Original comment by ja...@potiuk.com on 21 Aug 2012 at 9:48