Android Ripple: How Do Other Apps Make Their Ripple So Transparent Without Affecting The Original Colour Of The View
When you look at other apps like yPlan or Google Play Store, their ripple effect on buttons is like a light grey or black that does not change the colour of the whole button. I wa
Solution 1:
<?xml version="1.0" encoding="utf-8"?>
<!--Use an almost transparent color for the ripple itself-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#22000000">
<!--Use this to define the shape of the ripple effect (rectangle, oval, ring or line). The color specified here isn't used anyway-->
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#000000" />
</shape>
</item>
<!--This is the background for your button-->
<item>
<!--Use the shape you want here-->
<shape android:shape="rectangle">
<!--Use the solid tag to define the background color you want (here yellow)-->
<solid android:color="#ffff00"/>
<!--Use the stroke tag for a border-->
<stroke android:width="1dp" android:color="#ffff00"/>
</shape>
</item>
</ripple>
Post a Comment for "Android Ripple: How Do Other Apps Make Their Ripple So Transparent Without Affecting The Original Colour Of The View"