OSDN Git Service

Fixed issue where GradientDrawable would fail inflation
authorNader Jawad <njawad@google.com>
Wed, 1 May 2019 18:17:20 +0000 (11:17 -0700)
committerNader Jawad <njawad@google.com>
Wed, 1 May 2019 18:59:55 +0000 (11:59 -0700)
commitde546a48686f3467a5023beafa6acaaca7e5d753
tree7770df94b7411ad8e3f9bdd6c13b132ae4463dbe
parentae05e55db5c789d0d50963f69e6459cfa4aebbf9
Fixed issue where GradientDrawable would fail inflation
with invalid angle parameters

Previously, GradientDrawable would fail xml parsing if
an angle measurement was not a multiple of 45 and the type
of gradient is linear. Restore the original behavior to only
verify the angle measurement only if the type is linear
instead of verifying this requirement for all gradient types.

Removed restriction that radii must be non-negative as
subsequent logic in GradientDrawable already clamps the radius
to valid parameters.

Bug: 130309904
Test: Updated tests in CtsGradientDrawableTest
Change-Id: Ib1b3a0bb80639ddc00be7e630c62e781dfa6d9cf
graphics/java/android/graphics/drawable/GradientDrawable.java