diff options
author | Romain Guy <romainguy@google.com> | 2011-01-17 11:35:55 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-17 11:35:55 -0800 |
commit | bee8ec2538c75797d9704617411f831945c8da54 (patch) | |
tree | 835fd47d2a3c5be418682a5e274ee9822e1e58dd | |
parent | 424300f3e4840bd06a1dbc22a25350c0589e3f89 (diff) | |
parent | 875862e3ec85153553ce50acc02863ea0720ccb6 (diff) | |
download | frameworks_base-bee8ec2538c75797d9704617411f831945c8da54.zip frameworks_base-bee8ec2538c75797d9704617411f831945c8da54.tar.gz frameworks_base-bee8ec2538c75797d9704617411f831945c8da54.tar.bz2 |
Merge "Prevent NPE when no indicator is specified. Bug #3362349" into honeycomb
-rw-r--r-- | core/java/android/widget/ExpandableListView.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/widget/ExpandableListView.java b/core/java/android/widget/ExpandableListView.java index 472a335..8279ee5 100644 --- a/core/java/android/widget/ExpandableListView.java +++ b/core/java/android/widget/ExpandableListView.java @@ -211,7 +211,7 @@ public class ExpandableListView extends ListView { .getDimensionPixelSize(com.android.internal.R.styleable.ExpandableListView_indicatorLeft, 0); mIndicatorRight = a .getDimensionPixelSize(com.android.internal.R.styleable.ExpandableListView_indicatorRight, 0); - if (mIndicatorRight == 0) { + if (mIndicatorRight == 0 && mGroupIndicator != null) { mIndicatorRight = mIndicatorLeft + mGroupIndicator.getIntrinsicWidth(); } mChildIndicatorLeft = a.getDimensionPixelSize( @@ -1022,8 +1022,11 @@ public class ExpandableListView extends ListView { */ public void setGroupIndicator(Drawable groupIndicator) { mGroupIndicator = groupIndicator; + if (mIndicatorRight == 0 && mGroupIndicator != null) { + mIndicatorRight = mIndicatorLeft + mGroupIndicator.getIntrinsicWidth(); + } } - + /** * Sets the drawing bounds for the indicators (at minimum, the group indicator * is affected by this; the child indicator is affected by this if the |