I've been fighting with styling on ExpandableListView as well (an area
that could use some improvement in a future release).

The problem with the current implementation is in the selector element
for the group expander.  It can be found in expander_group.xml and
looks like this:

<selector xmlns:android="http://schemas.android.com/apk/res/android";>
    <item
        android:state_expanded="true"
        android:drawable="@drawable/expander_ic_maximized" />
    <item
        android:drawable="@drawable/expander_ic_minimized" />
</selector>

The problem is that it lacks a state for empty.  The code and
attributes support it (state_empty) but it isn't defined in here.
Here are the hypothetical (completely untested) steps you could use to
achieve this:

- Grab the existing expander_group.xml and put it into your drawable
directory.
- Modify it to include a section for the empty state with no image.
Something like this:
    <item android:state_empty="true" android:drawable="@drawable/
empty"/>
- Modify your ExpandableListView element and set the group indicator
to be your private expander_group.xml

Let us know how it works out.  For myself, I need even more control so
I'm about to move to the "roll my own" stage.


On Feb 22, 8:35 pm, ls02 <[email protected]> wrote:
> setGroupIndicator will set ALL groups indicator. What I need is to
> remove expandable arrow only from those items that have no chidren.
>
> On Feb 22, 8:53 pm, TreKing <[email protected]> wrote:
>
> > On Mon, Feb 22, 2010 at 5:19 PM, ls02 <[email protected]> wrote:
> > > How do I remove expandable arrow from some of the items in
> > > ExpandableListView?
>
> > Have you tried the setViewIndicator() function?
>
> > > Also is there way to customize this arrow, move it
> > > to another place in the item?
>
> > Haven't tried it but the documentation has indicatorLeft and indicatorRight
> > xml attributes that are supposed to be for the left and right bounds of the
> > icon.
>
> > ---------------------------------------------------------------------------­----------------------
> > TreKing - Chicago transit tracking app for Android-powered 
> > deviceshttp://sites.google.com/site/rezmobileapps/treking

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to