diff options
| author | 2014-08-16 01:10:41 +0000 | |
|---|---|---|
| committer | 2014-08-15 21:23:40 +0000 | |
| commit | 7ca0bb5d4dea54940be71adf1de536ba177c16c8 (patch) | |
| tree | d89c450ab47a29e1cf66e2bd4b500a49edabc44c /graphics/java/android | |
| parent | 6a2f703fed3d88086aa25edd8617c19564fa8d91 (diff) | |
| parent | 34a14f967ab6c88829c9a36ce6e909c47b3ee398 (diff) | |
Merge "Better handling of unresolved theme attributes" into lmp-dev
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/drawable/RippleDrawable.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java index ea9f7320d024..0447e1770179 100644 --- a/graphics/java/android/graphics/drawable/RippleDrawable.java +++ b/graphics/java/android/graphics/drawable/RippleDrawable.java @@ -395,8 +395,12 @@ public class RippleDrawable extends LayerDrawable { mState.mColor = color; } - // If we're not waiting on a theme, verify required attributes. - if (state.mTouchThemeAttrs == null && mState.mColor == null) { + verifyRequiredAttributes(a); + } + + private void verifyRequiredAttributes(TypedArray a) throws XmlPullParserException { + if (mState.mColor == null && (mState.mTouchThemeAttrs == null + || mState.mTouchThemeAttrs[R.styleable.RippleDrawable_color] == 0)) { throw new XmlPullParserException(a.getPositionDescription() + ": <ripple> requires a valid color attribute"); } @@ -891,7 +895,7 @@ public class RippleDrawable extends LayerDrawable { static class RippleState extends LayerState { int[] mTouchThemeAttrs; - ColorStateList mColor = null; + ColorStateList mColor = ColorStateList.valueOf(Color.MAGENTA); int mMaxRadius = RADIUS_AUTO; public RippleState(RippleState orig, RippleDrawable owner, Resources res) { |