Ripple touch effect

This code for effect on click like ripple. just copy this code and past on click place.

Code

android.graphics.drawable.RippleDrawable ripdr = new android.graphics.drawable.RippleDrawable(new android.content.res.ColorStateList(new int[][]{new int[]{}}, new int[]{ Color.GREEN}), new android.graphics.drawable.ColorDrawable(Color.WHITE), null);
button1.setBackground(ripdr);

Can i use this code for different types of click like textview button and etc.

Yes you can use this code anywhere in onclick listener method.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.