Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3721038
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:25:11+00:00 2026-05-19T05:25:11+00:00

I’m working on an app that involves and ExpandableListView. We should like to replace

  • 0

I’m working on an app that involves and ExpandableListView. We should like to replace the groupIndicator with one of our own choosing.

I created a spec for the indicator that would show a different png depending on the state of the selector (expanded or not expanded)

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/arrow_down" android:state_expanded="true"/>
    <item android:drawable="@drawable/arrow_right"/>    
</selector>

I then set up my layout xml to use:

(Note that childDivider is a one pixel tall png rather than a color because setting that to a color seems to be bugged)

This works, except that our icon is stretched out vertically. That makes sense, because we just created a 25×25 icon and hoped for the best. I’m trying to figure out the dimensions of the native icon so that I can match it, but that’s where I run into trouble.

Digging through the source code (ExpandableListView.java) I found that, by default, the class will use com.android.internal.R.styleable.ExpandableListView_groupIndicator. So I have an id, but no icon yet.

I’d love to be able to do:

Bitmap image = BitmapFactory.decodeResource(this.getResources(), com.android.internal.R.styleable.ExpandableListView_groupIndicator);
        imWidth = image.getWidth();
        imHeight = image.getHeight();

But as the “internal” suggests, it’s not visible to me in user space.

I also found getIndicate() in ExpandableListView.java, but it is private, so I can’t get to that either.

I’m quite new to diving into the platform source code, and I don’t know how else to track down that image. Can anyone help me out?

Edit: Thanks CommonsWare. To spell out the rest for anyone else looking:

android:drawable/expander_group is defined in /frameworks/base/core/res/res/drawable/expander_group.xml.
expander_group.xml mentions that it uses @drawable/expander_ic_maximized and @drawable/expander_ic_minimized.
Those drawables can be found in /frameworks/base/core/res/res/drawable/expander_ic_maximized.9.png and /frameworks/base/core/res/res/drawable/expander_ic_minimized.9.png, among other places for specific densities and such. The “9” explains why the default icons don’t have distortion problems – they’re patch-9 graphics. The density-agnostic versions of the icons are 34px by 38px.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:25:12+00:00Added an answer on May 19, 2026 at 5:25 am

    base.git‘s core/res/res/values/styles.xml defines com.android.internal.R.styleable.ExpandableListView_groupIndicator as android:drawable/expander_group. That is a StateListDrawable in your SDK’s copy of the resources. The underlying PNGs are of varying sizes based upon density.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.