Loading graphics/java/android/graphics/drawable/BitmapDrawable.java +15 −0 Original line number Diff line number Diff line Loading @@ -706,9 +706,23 @@ public class BitmapDrawable extends Drawable { final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.BitmapDrawable); updateStateFromTypedArray(a); verifyState(a); a.recycle(); } /** * Ensures all required attributes are set. * * @throws XmlPullParserException if any required attributes are missing */ private void verifyState(TypedArray a) throws XmlPullParserException { final BitmapState state = mBitmapState; if (state.mBitmap == null) { throw new XmlPullParserException(a.getPositionDescription() + ": <bitmap> requires a valid src attribute"); } } /** * Updates the constant state from the values in the typed array. */ Loading Loading @@ -912,6 +926,7 @@ public class BitmapDrawable extends Drawable { */ private BitmapDrawable(BitmapState state, Resources res, Theme theme) { if (theme != null && state.canApplyTheme()) { // If we need to apply a theme, implicitly mutate. mBitmapState = new BitmapState(state); applyTheme(theme); } else { Loading graphics/java/android/graphics/drawable/GradientDrawable.java +4 −1 Original line number Diff line number Diff line Loading @@ -1662,9 +1662,12 @@ public class GradientDrawable extends Drawable { * @param theme Theme to apply to the drawable */ private GradientDrawable(GradientState state, Theme theme) { mGradientState = new GradientState(state); if (theme != null && state.canApplyTheme()) { // If we need to apply a theme, implicitly mutate. mGradientState = new GradientState(state); applyTheme(theme); } else { mGradientState = state; } initializeWithState(state); Loading graphics/java/android/graphics/drawable/NinePatchDrawable.java +1 −0 Original line number Diff line number Diff line Loading @@ -659,6 +659,7 @@ public class NinePatchDrawable extends Drawable { */ private NinePatchDrawable(NinePatchState state, Resources res, Theme theme) { if (theme != null && state.canApplyTheme()) { // If we need to apply a theme, implicitly mutate. mNinePatchState = new NinePatchState(state); applyTheme(theme); } else { Loading Loading
graphics/java/android/graphics/drawable/BitmapDrawable.java +15 −0 Original line number Diff line number Diff line Loading @@ -706,9 +706,23 @@ public class BitmapDrawable extends Drawable { final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.BitmapDrawable); updateStateFromTypedArray(a); verifyState(a); a.recycle(); } /** * Ensures all required attributes are set. * * @throws XmlPullParserException if any required attributes are missing */ private void verifyState(TypedArray a) throws XmlPullParserException { final BitmapState state = mBitmapState; if (state.mBitmap == null) { throw new XmlPullParserException(a.getPositionDescription() + ": <bitmap> requires a valid src attribute"); } } /** * Updates the constant state from the values in the typed array. */ Loading Loading @@ -912,6 +926,7 @@ public class BitmapDrawable extends Drawable { */ private BitmapDrawable(BitmapState state, Resources res, Theme theme) { if (theme != null && state.canApplyTheme()) { // If we need to apply a theme, implicitly mutate. mBitmapState = new BitmapState(state); applyTheme(theme); } else { Loading
graphics/java/android/graphics/drawable/GradientDrawable.java +4 −1 Original line number Diff line number Diff line Loading @@ -1662,9 +1662,12 @@ public class GradientDrawable extends Drawable { * @param theme Theme to apply to the drawable */ private GradientDrawable(GradientState state, Theme theme) { mGradientState = new GradientState(state); if (theme != null && state.canApplyTheme()) { // If we need to apply a theme, implicitly mutate. mGradientState = new GradientState(state); applyTheme(theme); } else { mGradientState = state; } initializeWithState(state); Loading
graphics/java/android/graphics/drawable/NinePatchDrawable.java +1 −0 Original line number Diff line number Diff line Loading @@ -659,6 +659,7 @@ public class NinePatchDrawable extends Drawable { */ private NinePatchDrawable(NinePatchState state, Resources res, Theme theme) { if (theme != null && state.canApplyTheme()) { // If we need to apply a theme, implicitly mutate. mNinePatchState = new NinePatchState(state); applyTheme(theme); } else { Loading