saddi909 / tree-view-list-android Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/tree-view-list-android
License: BSD 2-Clause "Simplified" License
Automatically exported from code.google.com/p/tree-view-list-android
License: BSD 2-Clause "Simplified" License
In this example i expand expand one node, and again i want to expand another
node, that time previousy open node need be collapsed
1.how to achive this problem?
2.
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.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2013 at 11:42
If I add an expand 48*48 icon, the text will be indented 48. As
private void calculateIndentWidth() {
if (expandedDrawable != null) {
indentWidth = Math.max(getIndentWidth(),
expandedDrawable.getIntrinsicWidth());
}
if (collapsedDrawable != null) {
indentWidth = Math.max(getIndentWidth(),
collapsedDrawable.getIntrinsicWidth());
}
}
If I set indentWitdh inside the function, then it works as I think. Otherwise,
the interface setIndentWitdh seems not work either.
Original issue reported on code.google.com by [email protected]
on 3 Dec 2011 at 2:18
Hello, I think you have an error in the the AbstractTreeViewAdapter class. I
was getting a java.lang.ArrayIndexOutOfBoundsException.
When I would create a large tree, and scroll way down the list I would get the
exception. I found an article on stack overflow that seemed like the same
issue.
http://stackoverflow.com/questions/3017496/arrayadapter-and-listview-arrayindexo
utofboundsexception
I don't think it is good to override the getViewTypeCount() method in the way
that the AbstractTreeViewAdapter class is.
In my project I commented out this method, and It seemed to fix the Exception.
// @Override
// public int getViewTypeCount() {
// return numberOfLevels;
// }
I could be wrong but it seemed to help me. you might want to make a really big
tree to see if you get the same exception.
Original issue reported on code.google.com by [email protected]
on 18 Aug 2011 at 12:42
Do you plan providing a doc how to use this as library? I've managed to import
to my project but have no idea what to do next.
Original issue reported on code.google.com by [email protected]
on 7 Dec 2013 at 12:31
What steps will reproduce the problem?
1. set up emulator
a. limit processes to 1
b. immediate destroy activities
2. fire project to show sample with tree
3. minimize app [press home]
4. maximize
Now app throws NPE [attached to end of issue]
Tested on emulator with Android 4.0.3
Stacktrace with NPE:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{pl.polidea.treeview/pl.polidea.treeview.demo.TreeViewListDemo}:
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at pl.polidea.treeview.InMemoryTreeStateManager.registerDataSetObserver(InMemoryTreeStateManager.java:315)
at pl.polidea.treeview.AbstractTreeViewAdapter.registerDataSetObserver(AbstractTreeViewAdapter.java:100)
at android.widget.ListView.setAdapter(ListView.java:464)
at pl.polidea.treeview.TreeViewList.setAdapter(TreeViewList.java:92)
at pl.polidea.treeview.demo.TreeViewListDemo.setTreeAdapter(TreeViewListDemo.java:93)
at pl.polidea.treeview.demo.TreeViewListDemo.onCreate(TreeViewListDemo.java:76)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
Original issue reported on code.google.com by [email protected]
on 4 Jul 2013 at 9:46
Hi,
I want to modify the code so that there are no check boxes instead there are
just rows which can be clicked. Clicking on any of the rows should work same as
clicking of the check box.
Any suggestions on how to do this??
Thanks
Original issue reported on code.google.com by [email protected]
on 7 Jun 2011 at 6:01
To reproduce the problem, all you need to do is to add a treeview to a
fragment, and display the fragment.
When I click a tree node to expand/contract it, it will not register the event
before I try to scroll/touch another item/touch the item again.
Compiling to Android 4.0, targeting lower versions using ActionBarSherlock.
Does not work properly without ActionBarSherlock either. The demo app works on
my setup.
The expand/contract functions gets called, and updates the data. May it be
something with the ListView it expands?
Original issue reported on code.google.com by [email protected]
on 6 Sep 2012 at 1:04
addAfterChild(final T parent, final T newChild, final T afterChild),
when afterChild is not null, adds the new child before afterChald and not after.
As I understand it (I only looked at the code for this method so I don't know
if there is other implications) the line:
final InMemoryTreeNode<T> added = node.add(
index == -1 ? node.getChildrenListSize() : index, newChild,
visibility);
should be:
final InMemoryTreeNode<T> added = node.add(
index == -1 ? node.getChildrenListSize() : index+1, newChild,
visibility);
So the index of the added node will be 1 after 'afterChild' so it will appear
after.
Original issue reported on code.google.com by [email protected]
on 11 Jan 2012 at 12:40
how to keep expanded position for second and third level childs by default when
ever we click the first level?
with out clicking the econd level for third level childs
1.
2.
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.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2013 at 11:49
What steps will reproduce the problem?
1.build a tree with about 40 node
2.it take about 2 seconds.
3.every time the logcat out print : Creating the view a new,that is inflate the
layout xml consume too many time.So,why "Reusing the view" do not work.
What is the expected output? What do you see instead?
copy node or duplicate class to make fast,do not need inflate the layout xml
every time.
Original issue reported on code.google.com by [email protected]
on 7 Sep 2013 at 3:28
My treeview is big (500 nodes and more) and I have a problem saving it state
when screen orientation is changed. I use code from treeview demo in
onSaveInstanceState event:
outState.putSerializable("treeManager", manager);
Everything is ok while my tree is about 270 nodes or less. But when tree is
bigger, then I get StackOverflow error here. Where may be a problem?
Original issue reported on code.google.com by [email protected]
on 19 Feb 2012 at 6:56
To whom it may concern, I am attempting to include your project as a library in
my own. However, when I imported this project as a library into an otherwise
functioning, mostly empty test project, my test project errors.
Build project errors indicate that: Android requires source compatibility set
to 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project
Properties. tree-view-list-android: line 1 : Android ADT Problem.
However, when going to Fix Project Properties, another error of "An internal
error occurred during: "Fix Project Properties". Negative time." My OS is
Windows 8 and my minSDKversion is 8, targetSDKversion is 18. I would very much
like to use your project, but at the moment it seems unusable. Is there
anything I can do to resolve this issue?
Please let me know if you need any further information.
Thanks!
Original issue reported on code.google.com by [email protected]
on 7 Feb 2014 at 7:06
i run you code but have some mistakes
Original issue reported on code.google.com by [email protected]
on 24 Mar 2011 at 10:37
I think it would be helpful for users if you split the application part (the
demo Activity and the demo Adapter classes) into a separate application using
the base part as a used android library.
Users can fit this one better into their own projects.
Original issue reported on code.google.com by [email protected]
on 8 Sep 2011 at 11:22
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 [email protected]
on 22 Dec 2014 at 10:26
hello
how to download the project into eclipse from codes.google.com
Thanks
Original issue reported on code.google.com by [email protected]
on 21 Nov 2011 at 5:34
Hi,
I would like to save the state of the tree to handle runtime changes like
orientation. I can redraw the tree by adding all the nodes again by adding all
the nodes, but thats an overkill. Is it possible to save the state of the tree
and use that to redraw the tree.
thanks
Original issue reported on code.google.com by [email protected]
on 12 Aug 2011 at 11:42
Hello
I would like to use part from this project in my application so I would like to
add licence statement(New BSD Licence). What should be written instead of
<YEAR>, <OWNER> ?
Michal
Original issue reported on code.google.com by [email protected]
on 19 Dec 2011 at 2:26
What steps will reproduce the problem?
1.when i use it in fragment it cause issues
2.
3.
What is the expected output? What do you see instead?
i want to see list but it crash my app
What version of the product are you using? On what operating system?
i m using 4.1.1
Original issue reported on code.google.com by [email protected]
on 9 Aug 2012 at 7:44
AbstractTreeViewAdapter's getItem():
@Override
public Object getItem(final int position) {
return getItemId(position);
}
casts long to Object, while it should locate the proper T and cast T to Object .
Original issue reported on code.google.com by [email protected]
on 27 Jan 2013 at 7:09
What steps will reproduce the problem?
1.Creating a 2 level-deep tree (node within node within node)
2.Calling removeNodeRecursively, supplying the ID of the middle node ( the one
on level 1)
What is the expected output? What do you see instead?
Expected it to delete the node and it's children correctly
Original issue reported on code.google.com by [email protected]
on 29 May 2011 at 5:24
Thank you for exelent treeview.
In my tree-view nodes have 4 different states - 2 collapsed and 2 expanded
depending on external reasons. Currently I can use only 2 drawable for
indicator states, but if AbstractTreeViewAdapter.getDrawable would be protected
instead of private, I'd have an ability to set needed image in appopriate
moment (when node have been clicked) in my TreeAdapter.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2012 at 7:19
What steps will reproduce the problem?
1.After invoke TreeBuilder.clear
2.using sequentiallyAddNextNode and so on to build another tree.
3.get NodeNotInTreeException
I trace the code,found the bug,here is the path,
that is ,just reset lastAddedId to null in TreeBuilder.clear().
pl.polidea.treeview.TreeBuilder
public void clear() {
manager.clear();
+ lastAddedId = null;
}
Original issue reported on code.google.com by [email protected]
on 7 Sep 2013 at 4:48
I keep getting this exception:
android.content.res.Resources$NotFoundException: File
res/drawable-xhdpi/list_selector_background.xml from drawable resource ID
#0x7f020004
I've tried copying the list_selector_background.xml file into every drawable
folder (hdpi.mdpi...)) and it gave me the same exception.
This one came up with only the drawable folder contains the xml files. please
advice thanks!
Original issue reported on code.google.com by [email protected]
on 18 Jun 2012 at 9:07
hi
i use the tree view with different ItemView's and most works really fine, but
on scrolling sometimes the wrong View for the Item is displayed and some items
below are displayed displaced
have you got a testproject using complex Object and not "only" an Long Array as
DataSource?
thx & best regards
Original issue reported on code.google.com by [email protected]
on 21 Aug 2011 at 1:19
i don't know how will i get source code from this link
Original issue reported on code.google.com by [email protected]
on 6 Nov 2013 at 11:50
I did some changes to the SimpleAdapter to allow checkboxes in all nodes, later
I was trying to implement the following logic:
If user clicks on checkbox located in some node with children the adapter needs
to check recursively the checkboxes in its child nodes or vice versa. I didn't
find the right approach to get the right implementation.
Thanks in advance. Denis
Original issue reported on code.google.com by [email protected]
on 22 May 2013 at 9:54
Hi,
i have a tree view which looks like this
Root
|
+-- Node 1
| +-- Leaf 1 with Checkbox
| +-- Leaf 2 with Checkbox
| +-- Leaf 3 with Checkbox
|
+-- Node 2
| +-- Leaf 1 with Checkbox
| +-- Leaf 2 with Checkbox
Now i want to set Leaf 3 disabled (also the Checkbox), if Leaf 1 and 2 are
selected.
The idea behind it is that i want to only allow to select a limited number of
leafs per node.
How would i do this?
Thanks for your help,
Frank
Original issue reported on code.google.com by [email protected]
on 2 Apr 2011 at 9:31
What steps will reproduce the problem?
1.I am able to create tree using this library but if i am deleting last node
from the tree & again adding one node its giving exception.
2.
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.
Original issue reported on code.google.com by [email protected]
on 20 May 2013 at 10:34
What steps will reproduce the problem?
1. Add more than one node with the same name.
What is the expected output? What do you see instead?
If the nodes were under different parents I would expect no problem.
What version of the product are you using? On what operating system?
29April2012
Please provide any additional information below.
If you add two nodes of the same name, the second node will fail, regardless of
if the node exists under another parent. I would expect repeat names under
different parents to be acceptable.
I'm looking into fixing this now.
Original issue reported on code.google.com by [email protected]
on 1 Aug 2012 at 8:54
Hi ..
I want to create tree-view-list for that i have reffed the code from http://code.google.com/p/tree-view-list-android/ ...
But i am getting errors.I have attached logcat file along with three classes.
please Help Me.
Thanks
Original issue reported on code.google.com by [email protected]
on 10 Apr 2012 at 7:53
Attachments:
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 [email protected]
on 21 Aug 2012 at 9:43
Hi,
I 'm adding the tree view list to a tablelayout. The tree is placed inside a
tablerow. And the next row has couple of buttons. When the screen first
appears the tree is in collapsed state. When i expand the tree my buttons
disappear. Any ideas why that would happen?
thanks for your time
Original issue reported on code.google.com by [email protected]
on 5 Jul 2011 at 11:46
What steps will reproduce the problem?
1. change the Node to be a class that contains 2 arrays
2. The ID at TreeBuilder<T> is defined as T and is not working with the current
code
What is the expected output? What do you see instead?
that the functions will be able to handel complex Node.
What version of the product are you using? On what operating system?
Android
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 2 Feb 2012 at 1:08
It would be great to add maven support.
But it will need to separate lib/demo sources.
You can get Sherlock ActionBar library for example
Original issue reported on code.google.com by [email protected]
on 14 Nov 2013 at 1:23
What steps will reproduce the problem?
1.I use removeNodeRecursively, but this remove my node at all.
How to remove all children, but not parent node??
Original issue reported on code.google.com by [email protected]
on 26 May 2014 at 11:46
Would be really helpful to Maven, Ant+Ivy, Gradle users if the dev team
deployed the release jars to Maven Central.
It's easy to setup and do (I've done it many times), let me know if I can help
accomplish this.
Original issue reported on code.google.com by [email protected]
on 21 Oct 2011 at 8:46
What steps will reproduce the problem?
1. Placing the TreeViewList in a layout
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Android
Please provide any additional information below.
The error is shown in a screenshot
Original issue reported on code.google.com by [email protected]
on 30 Oct 2012 at 10:13
Attachments:
What steps will reproduce the problem?
1. Import the tree-view-list-android project into eclipse
2. Project fails to compile
3. the variable "previousSibling is declared "final" at
InMemoryTreeStateManager:242, and then assigned at InMemoryTreeStateManager:247
What is the expected output? What do you see instead?
variable should not ve final
What version of the product are you using? On what operating system?
Eclipse Juno, OS X 10.6.8, Mac Java 6
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 17 Nov 2012 at 9:31
What steps will reproduce the problem?
If I extend the AbstractTreeViewAdapter with String Ids instead of Long as in
your example, Eclipse will not compile my Adapter.
What is the expected output? What do you see instead?
The method "public long getItemId(int position)" must be implemented as a
Method of android.widget.Adapter. The javadoc of the latter interface expect a
kind of a row id as long.
If I use Strings as id I don't know how to implement this. The example
SimpleStandardAdapter from the demo takes the Long (nice coincidence, but not
requirable).
Is there a better solution for me?
Original issue reported on code.google.com by [email protected]
on 8 Sep 2011 at 11:18
Hi,
I was wondering how do i implement smooth scrollable list. The tree currently
only handles trackball.
Thanks
Original issue reported on code.google.com by [email protected]
on 6 Aug 2011 at 3:32
The example you provide is difficult to understand.
Could you create a proper usage documentation?
Original issue reported on code.google.com by [email protected]
on 8 Jan 2014 at 3:50
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 [email protected]
on 14 Feb 2012 at 4:45
What steps will reproduce the problem?
1. Build a tree
2. Call treebuilder.clear();
3. Try to build another tree, you will get an exception
What version of the product are you using? On what operating system?
last version
Please provide any additional information below.
Adding this two lines to the clear() method of the TreeBuilder will fix the
problem:
lastAddedId = null;
lastLevel = -1;
Original issue reported on code.google.com by [email protected]
on 25 May 2013 at 9:02
I write my adapter extending AbstractTreeViewAdapter and my custom layout for
tree's nodes with a textview and an imageview.
I execute on emulator, but when select an item (or collapse) it throws an
ArrayIndexOutOfBoundException at
android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:3572).
I try the versions 1.6, 2.1, 2.3.3 of Android but with same result.
I attach my adapter, custom layout and bean.
Thanks.
Original issue reported on code.google.com by [email protected]
on 21 Jun 2011 at 2:22
Attachments:
I was wondering how can i indent the expandable icons. I want the expandable
icon to be indented if it also has children.
I tried modifying the populateTreeItem()in abstractreeviewadapter and indent
the image if its at level >1 and has children..but that didnt work.
Thanks
Original issue reported on code.google.com by [email protected]
on 9 Aug 2011 at 5:18
All integration of this code is working so smooth but i have a long branches
tree which is not fitting on screen. Tree is getting wrapped in multiple row so
i need to implement a horizontal scroll. Can you tell me how it could be done?
Original issue reported on code.google.com by [email protected]
on 20 Sep 2012 at 7:25
It is not indented as the homepage shows. Please see the attachment.
Original issue reported on code.google.com by [email protected]
on 3 Dec 2011 at 2:27
Attachments:
How can I put the tree-view-list indicator (the + and -) to the right? It's now
on the left.
I've tried to change "tree_list_item_wrapper.xml" but then I get these errors:
java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to
android.widget.LinearLayout
at
pl.polidea.treeview.AbstractTreeViewAdapter.populateTreeItem(AbstractTreeViewAda
pter.java:236)
at
pl.polidea.treeview.AbstractTreeViewAdapter.getView(AbstractTreeViewAdapter.java
:171)
at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
Original issue reported on code.google.com by [email protected]
on 20 Oct 2013 at 10:09
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.