summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-01-17 11:37:24 -0800
committerRomain Guy <romainguy@google.com>2011-01-17 11:37:24 -0800
commit875862e3ec85153553ce50acc02863ea0720ccb6 (patch)
tree0c6a3026668bb64919ab01171289488469279c93
parent7444da512680df0c52af39ea521e35adbe0c167d (diff)
downloadframeworks_base-875862e3ec85153553ce50acc02863ea0720ccb6.zip
frameworks_base-875862e3ec85153553ce50acc02863ea0720ccb6.tar.gz
frameworks_base-875862e3ec85153553ce50acc02863ea0720ccb6.tar.bz2
Prevent NPE when no indicator is specified.
Bug #3362349 Change-Id: Ie15ed9e31fdd4eb72a18471375d8937c50eb1802
-rw-r--r--core/java/android/widget/ExpandableListView.java7
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