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

using addRelation method of TreeBuilder shouldnt require to use the level number in the adapter. #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.using the method addRelation of TreeBuilder
2.Not providing a level number
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.
Should the adapter need the level number if you're using the refered 
method???imagine a list of persons, where there's a parent field with reference 
to said person shouldnt the method return the level number as its building the 
list?

Original issue reported on code.google.com by joao.ro...@gmail.com on 14 Feb 2012 at 4:45

GoogleCodeExporter commented 9 years ago
It's not needed. The ID is recorded in the TreeManager (builder is there only 
to make tree building easier, manager is there to keep the actual tree). You 
call manager.getLevel(id) or manger.getNodeInfo(id) in case you need more 
information after adding the node.

Original comment by jarek.po...@polidea.pl on 14 Feb 2012 at 7:35

GoogleCodeExporter commented 9 years ago
Im not following, the demo SimpleStandardAdapter class constructor takes the 
LEVEL_NUMBER which represents the tree max level value am i right??? 

private static final int LEVEL_NUMBER = 4;
simpleAdapter = new SimpleStandardAdapter(this, selected, manager,
                LEVEL_NUMBER);

So going by this, and what you're saying, i can build the tree without the 
TreeBuilder class? with the InMemoryTreeManager class??
My case is i have a list of say Person objects and each object might have 
another Person reference to the Parent. So im just having difficulty in how do 
i build the tree if i dont know the level size of it.

regards,

Original comment by joao.ro...@gmail.com on 14 Feb 2012 at 10:44

GoogleCodeExporter commented 9 years ago
It's not good for unknown number of levels. Anyhow tree view is bad on mobile, 
for more than 2-3 levels. You should make list navigation instead and show only 
one level at a time.

Original comment by jarek.po...@polidea.pl on 14 Feb 2012 at 11:18

GoogleCodeExporter commented 9 years ago
That's what i suspected but do you know where can i start searching about the 
use of lists to show one level at a time, i assume you only use on activity and 
listview for this system.

regards.

Original comment by joao.ro...@gmail.com on 15 Feb 2012 at 12:06

GoogleCodeExporter commented 9 years ago
I guess you have to write it  yourself.

Original comment by jarek.po...@polidea.pl on 15 Feb 2012 at 12:11