How to create custom groupIndicator for ExpandableListView group

Published by Igor Khrupin on

Here is tutorial How to create custon groupIndicator for ExpandableListView in Andriod.
Here is screenshot:

To do it you need:

1. Create 9-patch images for normal and expanded state
2. Create selector with this 9-patch images

<selector xmlns:android="">
    <item android:state_expanded="true" android:drawable="@drawable/group_indicator_expanded" />
    <item android:drawable="@drawable/group_indicator" />

3. Set this selector as groupIndicator for ExpandableListView

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
    android:orientation="vertical" >
        android:groupIndicator="@drawable/group_indicator_selector" >

That’s all.

Here you can download the source code of sample Android project

Download it from github

1 Comment

blackhat unlimited proxies · 22 August, 2012 at 14:03

Helpful information. Lucky me I discovered your web site accidentally, and I am surprised why this accident did not came about earlier! I bookmarked it.

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.