Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the width of ExpandableListView's group indicator drawable on Android?

If I use the default group indicator (not setting a new one), how can I know the padding width for the layout of groupview?

So can let my layout won't overlap with the group indicator.

Is that possible? Because I can't find a method to getGroupIndicator. Or I must have to set a new one that I know its size.

like image 611
shiami Avatar asked Jan 22 '11 07:01

shiami


2 Answers

I found the attribute here:

android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
like image 71
shiami Avatar answered Nov 03 '22 00:11

shiami


Or you can use reflection:

Field field_mIndicatorRight = listView.getClass().getDeclaredField("mIndicatorRight");
field_mIndicatorRight.setAccessible(true);
int mIndicatorRight = (Integer) field_mIndicatorRight.get(listView);
like image 40
draw Avatar answered Nov 03 '22 00:11

draw