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

Indicator on the right #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 DutchSp...@gmail.com on 20 Oct 2013 at 10:09

GoogleCodeExporter commented 9 years ago
good idea, but you probably stayed with the old ids - you changed the layout 
names. The frames/linear layout are retrieved by id so you need to have 
treeview_list_item_image_layout as LinearLayour and treeview_list_item_frame as 
FrameLayout. Note. The library is not really maintained any more (so you are on 
your own if you want to make modifications like that). Also the tree is not 
really good mobile control. You should rethink if you want to use it - rather 
than that try to read the new http://developer.android.com/design/index.html 
Android Guidelines. And use standard controls instead or at least standard 
approach. Tree view is bad usability pattern. 

Original comment by ja...@potiuk.com on 20 Oct 2013 at 4:58

GoogleCodeExporter commented 9 years ago
I've already treeview_list_item_image_layout as LinearLayour and 
treeview_list_item_frame as FrameLayout but I get the same error. (It think 
this is a inflate error or something else)

This is the content of tree_list_item_wrapper.xml (or see screenshot):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <FrameLayout android:id="@+id/treeview_list_item_frame" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:layout_weight="1">
    </FrameLayout>
    <LinearLayout android:id="@+id/treeview_list_item_image_layout" android:layout_width="80dip"
        android:layout_height="fill_parent" android:gravity="right|center_vertical">
        <ImageView android:id="@+id/treeview_list_item_image" android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:src="@android:drawable/arrow_down_float" >
        </ImageView>
    </LinearLayout>
</LinearLayout>

Original comment by DutchSp...@gmail.com on 20 Oct 2013 at 6:23

Attachments:

GoogleCodeExporter commented 9 years ago
I think simply the old xml is used. You need to replace it in the library 
rather than add. Again - please try to understand the code and debug it - I 
don't have time to debug the deprecated project (see the main page of the 
project). If you choose to use treeview - you are on your own, sorry. 

Original comment by ja...@potiuk.com on 20 Oct 2013 at 6:28

GoogleCodeExporter commented 9 years ago
You were right I've replaced it (and it's working now). What is then a good 
alternative for a tree view with more then 3 levels?

Last question: the padding is now gone, how to get the padding back before the 
text? (see screenshot)

Original comment by DutchSp...@gmail.com on 20 Oct 2013 at 6:58

Attachments: