[android-developers] Re: ExpandableListView question

2010-11-08 Thread BuckeyeDroid
Thanks for the response. Can you provide how you implemented this? I
could not find it in your other posts.

Thanks

On Nov 5, 10:51 am, Bret Foreman bret.fore...@gmail.com wrote:
 I just finished implementing something like this. It was not easy.
 ExpandableListView has a few bugs which you will have to code around.
 I've filed one of the bugs in b.android.com, along with a work-around,
 and I've posted the details of another bug in the forum, also
 including a work-around. Just search for my name associated with
 ExpandableListView  and you'll find them.

 On Nov 5, 9:43 am, BuckeyeDroid bill.schric...@gmail.com wrote:

  Is it possible for the child of an ExpandableListView also be a
  parent? For example, I need something like the following:

  ParentA
    ChildA
    ChildB
  ParentB
    ChildC
      GrandchildA??
      GrandchildB??
  ParentC

  Any thoughts, examples, or suggestions are greatly appreciated.

  Bill



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: ExpandableListView question

2010-11-08 Thread Bret Foreman
I fill the Child View position with a vertical LinearLayout. The top
row of that layout is a horizontal LinearLayout with two Views, the
expand/collapse icon and the name of the child. The lower rows of the
vertical LinearLayout are the 3rd level items. You will find that text
selection is broken in ExpandableListView so you'll need to implement
that yourself by overriding onDraw in the TextView. You will also find
that onTouch is broken, which means you'll have to implement your own
onTouch highlighting.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: ExpandableListView question

2010-11-05 Thread Bret Foreman
I just finished implementing something like this. It was not easy.
ExpandableListView has a few bugs which you will have to code around.
I've filed one of the bugs in b.android.com, along with a work-around,
and I've posted the details of another bug in the forum, also
including a work-around. Just search for my name associated with
ExpandableListView  and you'll find them.

On Nov 5, 9:43 am, BuckeyeDroid bill.schric...@gmail.com wrote:
 Is it possible for the child of an ExpandableListView also be a
 parent? For example, I need something like the following:

 ParentA
   ChildA
   ChildB
 ParentB
   ChildC
     GrandchildA??
     GrandchildB??
 ParentC

 Any thoughts, examples, or suggestions are greatly appreciated.

 Bill

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: ExpandableListView question

2010-09-21 Thread dashman
thanks for the response.

in my getChildView() method of my adapter, i have:

View v;
if (convertView == null) {
v = newChildView(isLastChild, parent);
} else {
v = convertView;
}

1. i would imagine newChildView would create the default layout - i
have
to create the different layout manually?

2. convertView can be a view with either type - right? how do i know
what
type it is.



On Sep 20, 10:02 pm, TreKing treking...@gmail.com wrote:
 On Mon, Sep 20, 2010 at 8:17 PM, dashman erjdri...@gmail.com wrote:
  is that possible - i.e. a ELV with different layouts for a group view.

 Sure. The View returned for a group (or it's children) is determined by you
 in the adapter. You can return whatever you want depending on your current
 needs.

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: ExpandableListView question

2010-09-21 Thread Brion Emde
I'm interested in this discussion also. I had this exact problem and
put it on hold for a while with a workaround. I decided that I would
probably need a child view that is a superset of all the desired group
views and that I would set the visibility of the child view components
as I determined the group of the child view to be rendered.

I had also been thinking that for the database that represents the
various groups, I would use the Ruby on Rails pattern of combining all
the child objects into a single table, with a group_id, keyed off of
the id of the GroupName.

This would work because the data that I was going to be dealing with
were actually related, in an inheritance sense, so I could get away
with it.

Were my groups to represent biological trees, with wildly different
member components between groups, I'd have to rethink that approach.

On Sep 21, 2:15 am, dashman erjdri...@gmail.com wrote:
 thanks for the response.

 in my getChildView() method of my adapter, i have:

                 View v;
             if (convertView == null) {
                     v = newChildView(isLastChild, parent);
             } else {
                     v = convertView;
             }

 1. i would imagine newChildView would create the default layout - i
 have
 to create the different layout manually?

 2. convertView can be a view with either type - right? how do i know
 what
 type it is.

 On Sep 20, 10:02 pm, TreKing treking...@gmail.com wrote:



  On Mon, Sep 20, 2010 at 8:17 PM, dashman erjdri...@gmail.com wrote:
   is that possible - i.e. a ELV with different layouts for a group view.

  Sure. The View returned for a group (or it's children) is determined by you
  in the adapter. You can return whatever you want depending on your current
  needs.

  --- 
  --
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: ExpandableListView question

2010-09-21 Thread TreKing
On Tue, Sep 21, 2010 at 1:15 AM, dashman erjdri...@gmail.com wrote:

 1. i would imagine newChildView would create the default layout - i have
 to create the different layout manually?


Yes - you would create whatever you needed based on the current group /
child position or whatever else determines your specific views, I guess.


 2. convertView can be a view with either type - right? how do i know what
 type it is.\


Good question. I was running under the assumption that you could do
something like this:
http://developer.android.com/reference/android/widget/Adapter.html#getItemViewType%28int%29

But that's apparently limited to ListAdapter, which is surprising.
You could do some hackiness where you shove some ID in the view as a Tag or
something.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: ExpandableListView question

2010-09-21 Thread dashman

thanks for the responses.

i decided to go with 1 layout for the children - i just change the
background color for the different types.

and yes since convertView can be any child previously used, you
have to explicitly set the background color on every getChildView()
call.

right now the layout has 2 text rows - ideally i don't need the second
row of text for certain child types.

i set the visibility to the 2nd row text views to GONE - but the first
row (now only row) still is not vertically centered

i've got the gravity of the 1st row textview to CENTER_VERTICAL but
it's still not centered.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en