marinat / 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

In tree view list, treeNodeInfo.isWithChildren() method is not working properly #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
I am using tree-view-list demo inside Navigation drawer with four level depth 
and it works with charm until i use this method named 
"treeNodeInfo.isWithChildren();".

Above method does not give correct output. According to my functionality, if 
child node is clicked then close navigation drawer and do task w.r.t. that 
child item using "treeNodeInfo.isWithChildren();" method but it gives false 
output means close navigation drawer instead of it is parent not and obviously 
that is not expected.

    @Override
    public View updateView(View view, TreeNodeInfo<CategoryVO> treeNodeInfo) {
        LinearLayout viewLayout = (LinearLayout) view;
        TextView descriptionView = (TextView) viewLayout
                .findViewById(R.id.demo_list_item_description);
        TextView levelView = (TextView) viewLayout
                .findViewById(R.id.demo_list_item_level);
        final CategoryVO category = treeNodeInfo.getId();
        descriptionView.setText(category.getName());
        descriptionView.setTag(category);
        levelView.setText(Integer.toString(treeNodeInfo.getLevel()));
        if(!treeNodeInfo.isWithChildren()){
            drawerLayout.closeDrawers();
        }
        return viewLayout;
    }

Original issue reported on code.google.com by kothari....@gmail.com on 22 Dec 2014 at 10:26