Fix issue with xml GradientDrawables consuming both resources
and parameters provided by the Theme leading to array size mismatch exceptions being thrown. GradientDrawable#updateGradientDrawableGradient is invoked multiple times during xml inflation, once with the attributes provided in the xml and another with attributes provided in the Theme. However, if parameters come from both the xml resources and the theme, when theme attributes are applied it can partially squash previously applied values. In the case of gradients this can lead to a previously initialized positions array with floating point offsets for color positions being applied but not overriden with theme attributes that only include a portion of the attribute values leading to exceptions being thrown as the colors and positions arrays are not of the same size Bug: 112122447 Test: Created test of xml inflation of GradientDrawables both with and without theme attributes Change-Id: Ie4183e2304677d30b6faef1cdc5c1be27ef9edd4
Loading
Please register or sign in to comment