To create a beautiful android view and to make a user-interactive UI, you have to use the ripple effect on any kind of view in Android. By using the ripple effect a user can feel like he is actually clicking the view or the layout. Now there are many ways to add a ripple effect to your view, and for that, you can use any 3rd party library like Material Ripple and Ripple Effect. But why to increase the app size and complexity in the first place when you can create the same effect with an XML file and with a few lines of codes.
Today I’m going to show you how it’s done. Below here is the XML file.
In the above code, you can set your color in the color.xml file according to preference. Change colorPrimary with the background color you want to use and change colorPrimaryDark with the color you want to click effect to be. You can also set the corner radius and make the view a perfect circle.
You can also create something crazy background like Instagram background gradient color like this.
Here is the code to create this kind of background.