Fix RippleDrawable alpha

Alpha was being double-applied by being
both handled in the shader and applied
by the Paint. So change the Paint to not
apply the alpha since the shader does it.

Fixes: 272375156
Test: looked at ripples in dark & light theme, verified no visual change
Change-Id: I6ca4d32a7a5735ce8ec418014d0318c29dd3c8bf
This commit is contained in:
John Reck
2023-05-18 18:10:26 -04:00
parent f11d33ba2c
commit f0c528ab6e
2 changed files with 5 additions and 4 deletions

View File

@@ -72,9 +72,9 @@
<item name="secondary_content_alpha_material_dark" format="float" type="dimen">.7</item>
<item name="secondary_content_alpha_material_light" format="float" type="dimen">0.60</item>
<item name="highlight_alpha_material_light" format="float" type="dimen">0.5</item>
<item name="highlight_alpha_material_dark" format="float" type="dimen">0.5</item>
<item name="highlight_alpha_material_colored" format="float" type="dimen">0.10</item>
<item name="highlight_alpha_material_light" format="float" type="dimen">0.20</item>
<item name="highlight_alpha_material_dark" format="float" type="dimen">0.20</item>
<item name="highlight_alpha_material_colored" format="float" type="dimen">0.20</item>
<!-- Primary & accent colors -->
<eat-comment />

View File

@@ -1013,7 +1013,8 @@ public class RippleDrawable extends LayerDrawable {
}
p.setShader(shader);
p.setColorFilter(null);
p.setColor(color);
// Alpha is handled by the shader (and color is a no-op because there's a shader)
p.setColor(0xFF000000);
return properties;
}