Giter Site home page Giter Site logo

multilevelexpandableindentablelistview's People

Contributors

defacto133 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multilevelexpandableindentablelistview's Issues

already expanded list

Is there any way to show list already expanded when view gets loaded?
In the current implementation, list gets expanded on clicking.
mAdapter = new MyAdapter(getActivity(), new View.OnClickListener() { @Override public void onClick(View v) { int position = mRecyclerView.getChildPosition(v); mAdapter.toggleGroup(position); } }); mRecyclerView.setAdapter(mAdapter);

Collapse/Expand Issue

As you can see from the images below, when I select an unexpanded item from a list the list collapses other root items first before I can expand any children.

http://imgur.com/ZhdWimr,IfhoLDg,M6KqMUv
http://imgur.com/ZhdWimr,IfhoLDg,M6KqMUv#1
http://imgur.com/ZhdWimr,IfhoLDg,M6KqMUv#2

What I'm doing in my code is
1. creating a hashmap of all the comments with their id as the key.
2. Iterating the list of comments and finding the parent of each item
and adding the current item as a child to that parent.
3. Getting all the top level comments and adding them to the adapter.

 public void loadComments(Submission detailedPost){
    this.post = detailedPost;
    root = TreeNode.root();
    lookup = new HashMap<String,Comment>();
    CommentNode commentRootNode = post.getComments();
    Iterable<CommentNode> iterableComments = commentRootNode.walkTree(TraversalMethod.PRE_ORDER);

    createNodeLookupMap(iterableComments);
    allocateChildrenToParentNodes();
    addTopLevelNodesToRoot();


}

public void createNodeLookupMap(Iterable<CommentNode> iterableComments){
    for (CommentNode node : iterableComments) {
        lookup.put(node.getComment().getFullName(), new Comment(node));
    }
}


public void allocateChildrenToParentNodes() {
    for (Map.Entry<String, Comment> entry : lookup.entrySet()) {
        Comment proposedParent;
        String entryParentId = entry.getValue().getCommentNode().getComment().getParentId();

        if(!entryParentId.equals(post.getFullName())){
            proposedParent = lookup.get(entryParentId);
            if(proposedParent != null) {
                proposedParent.addChild(entry.getValue());
            }
        }
    }
}

public void addTopLevelNodesToRoot(){
    List<Comment> comments = new ArrayList<Comment>();

    for (Map.Entry<String, Comment> entry : lookup.entrySet()) {
        // Get all the top level nodes and add them to the final list
        CommentNode node = entry.getValue().getCommentNode();
        if (node.isTopLevel()){
            comments.add(entry.getValue());
        }
    }
    commentsAdapter.addAll(comments);
    commentsAdapter.notifyDataSetChanged();
}

Getting demo to run, why is it so difficult. Readme needs an update.

Steps:

  1. Download gradle version required 2.1, using manual method as Android Studio is bad in that respect.
  2. Change runProguard false to minifyEnabled false in sampleapp/build.gradle and multilevelexpindlistview/build.gradle
  3. Library projects cannot set the ApplicationId, so have to remove that line from multilevelexpindlistview/build.gradle

Duplicate item after insert item

After I insert an item into the list a duplicate is popping up.
It's not necessarily the one I just inserted that is duplicated. It is usually further down the list.
Anyone else have this issue or have a fix?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.