diff options
| author | 2017-02-23 23:13:55 +0000 | |
|---|---|---|
| committer | 2017-02-23 23:14:00 +0000 | |
| commit | 339dc75d46035f711d8bfee6b0425975c020f311 (patch) | |
| tree | 6e8befc3e2c198924945ae47b336f390f2313cf5 | |
| parent | 1b0f1568d927e2a6ac05db5f1b7a1a8c6b520113 (diff) | |
| parent | 766b9b255bd9db10f22ddf81c8168085224c7e59 (diff) | |
Merge "Fix ColorStateList bug."
| -rw-r--r-- | core/java/android/content/res/ColorStateList.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java index 273522a94af3..a46db06ebdc0 100644 --- a/core/java/android/content/res/ColorStateList.java +++ b/core/java/android/content/res/ColorStateList.java @@ -508,8 +508,8 @@ public class ColorStateList extends ComplexColor implements Parcelable { } /** - * Indicates whether this color state list contains more than one state spec - * and will change color based on state. + * Indicates whether this color state list contains at least one state spec + * and the first spec is not empty (e.g. match-all). * * @return True if this color state list changes color based on state, false * otherwise. @@ -517,7 +517,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { */ @Override public boolean isStateful() { - return mStateSpecs.length > 1; + return mStateSpecs.length >= 1 && mStateSpecs[0].length > 0; } /** |