[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-16 Thread Ali Chousein
Hi, thank you for the message. I came up with this approach as well. Finally I was happy to see a decent way of configuring the icons of an ExpandableListView. The trick lies in having a stateful Drawable for the group indicator. When I find time I'll post a code excerpt as well, because I

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-16 Thread Ali Chousein
TreKing, Maka, Thank you for your attention and messages during this discussion. I posted a very simple example showing a decent way (at least I believe that it's decent) of overriding the default icons of an ExpandableListView. I pasted the location below. Hopefully it will be useful for people

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-15 Thread Ali Chousein
TreKing, thank you for your messages so far. I won't give up for some more days and will try to make it work. If I find a way I'll share with the group as well, because as it seems many other people attempted doing what I try to do now and faced similar issues. -- You received this message

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-15 Thread Makas Tzavellas
Hi Ali, You need to create your icons as NinePathDrawable with the corners as stretchable areas so that only the transparent areas are stretched. Look at expander_ic_maximized.9.png in the Android source code to see how they did it. Makas On Mar 15, 2:26 pm, Ali Chousein ali.chous...@gmail.com

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-15 Thread Ali Chousein
Hi Maka, Thank you for your message. Stretching is not the main problem though. As I wrote above, changing the icon based on the state of a group is the main problem. Anyway, finally I could find some time to sit down to see this problem again. I'll investigate it for some more time. Hope to come

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-15 Thread Makas Tzavellas
To have different icons showing based on the the state of the group, such as expanded or collapse. You need to create an xml file in res/drawable to indicate such behavior and 2 different icons for each state. For example, create an XML called expandable_icon.xml an icon called expanded.9.png and

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-14 Thread Ali Chousein
Yes, I tried to use ExpandableListView.setIndicatorBounds but this affects the stretching only on the x-axis. I couldn't find any function to do stretching on the y-axis. Anyway, there is always the dirty trick of designing your icon accordingly, but if you care about clear design, choosing this

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-14 Thread Ali Chousein
Actually ExpandableListView.setGroupIndicator doesn't do the job either, because it changes the icon for all groups. If you want to override the icons for minimized and maximized states, the maximized group icon will be different than the rest of the groups. It's not possible to implement this

Re: [android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-14 Thread TreKing
Yeah, I actually haven't tried fiddling with the icons, I was just going off of what I saw in the docs. I know someone else on here was having a similar issue and it appears that the ExpandableListView was not designed to allow major controls over the icons. Sorry, don't know what else to tell

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-13 Thread Ali Chousein
Thanks that'll help. -- 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

[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-13 Thread Ali Chousein
Hi TreKing, The ExpandableListView.setGroupIndicator does the job indeed, except it stretches the new icon. Is there a way to disable this stretching? I find it a bit strange that stretching is the default behavior instead of displaying an icon in it's original size. Any feedback would be very

Re: [android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-13 Thread TreKing
On Sat, Mar 13, 2010 at 3:53 PM, Ali Chousein ali.chous...@gmail.comwrote: Is there a way to disable this stretching? Did you also set the bounds for the indicator? - TreKing - Chicago transit