sketchub icon

ImageView Ripple Effect

EMOAKKI
33 Likes
4 Comments
446 Downloads

What's new

Anyone can easily add ripple effect on image view.

Code Provide in Description & Please give us a like ❤

Note - Replace #B0BEC5 with #YourRippleColorCode

Screenshots

About

This is a Image ripple effect project. In this project I delivered a demo that how to add ripple click effect on image view.

Credit - SK GOYAL(EMOAKKI)

Note that this shows a semi-transparent color on top of the image when the item is selected (for devices with version older than Android 5.0). You can remove it if you don't want it.

Codes - //inject this code in image view android:foreground="@drawable/ripple" android:clickable="true"

//code for file ripple.xml (it should be in Resources/drawable/ripple.xml) <?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android&quot;&gt; <item android:state_pressed="true"> <shape android:shape="rectangle"> <solid android:color="#B0BEC5"/> </shape> </item> <item> <shape android:shape="rectangle"> <solid android:color="@android:color/transparent"/> </shape> </item> </selector>

//code for file ripple.xml (it should be in Resources/drawable-v21/ripple.xml) <?xml version="1.0" encoding="UTF-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android&quot; android:color="#B0BEC5"/>

©2024 Sketchub | User Policy