Skip to content

Commit f8b38ca

Browse files
authored
use fully opaque ripple mask (#6099)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1208671518894266/task/1210251609451213?focus=true ### Description Uses a fully opaque (100% alpha) color for the ripple mask. The actual color doesn't matter, but devices handle the alpha channel differently: - On tested devices, a 0% alpha mask makes the ripple effect invisible. - On tested Pixels, any alpha > 0% applies the ripple color correctly. - On tested Samsungs, the ripple alpha is affected by both the mask and the ripple color alpha, summing them up and causing unexpected results. To ensure consistent ripple visibility across devices, always use a fully opaque mask.
1 parent d31784d commit f8b38ca

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

common/common-ui/src/main/res/drawable/selectable_item_experimental_background.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@
1717
android:color="?daxColorControlFillPrimary">
1818
<item android:id="@android:id/mask">
1919
<shape android:shape="rectangle">
20-
<solid android:color="?attr/daxColorControlFillPrimary" />
20+
<!--
21+
Use a fully opaque (100% alpha) color for the mask.
22+
23+
The actual color doesn't matter, but devices handle the alpha channel differently:
24+
- On tested devices, a 0% alpha mask makes the ripple effect invisible.
25+
- On tested Pixels, any alpha > 0% applies the ripple color correctly.
26+
- On tested Samsungs, the ripple alpha is affected by both the mask and the ripple color alpha,
27+
summing them up and causing unexpected results.
28+
29+
To ensure consistent ripple visibility across devices, always use a fully opaque mask.
30+
-->
31+
<solid android:color="#FF000000" />
2132
<corners android:radius="14dp" />
2233
</shape>
2334
</item>

0 commit comments

Comments
 (0)