Loading core/java/android/content/res/Resources.java +7 −1 Original line number Diff line number Diff line Loading @@ -715,7 +715,13 @@ public class Resources { * @see #getDrawable(int, Theme) */ public Drawable getDrawable(int id) throws NotFoundException { return getDrawable(id, null); final Drawable d = getDrawable(id, null); if (d.canApplyTheme()) { Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme " + "attributes! Consider using Resources.getDrawable(int, Theme) or " + "Context.getDrawable(int).", new RuntimeException()); } return d; } /** Loading graphics/java/android/graphics/drawable/RippleDrawable.java +7 −3 Original line number Diff line number Diff line Loading @@ -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"); } Loading Loading @@ -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) { Loading Loading
core/java/android/content/res/Resources.java +7 −1 Original line number Diff line number Diff line Loading @@ -715,7 +715,13 @@ public class Resources { * @see #getDrawable(int, Theme) */ public Drawable getDrawable(int id) throws NotFoundException { return getDrawable(id, null); final Drawable d = getDrawable(id, null); if (d.canApplyTheme()) { Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme " + "attributes! Consider using Resources.getDrawable(int, Theme) or " + "Context.getDrawable(int).", new RuntimeException()); } return d; } /** Loading
graphics/java/android/graphics/drawable/RippleDrawable.java +7 −3 Original line number Diff line number Diff line Loading @@ -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"); } Loading Loading @@ -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) { Loading