I want to add ripple effect to the ImageView / ImageButton in notification on Android Lollipop. I saw that this is possible on Google Play Music. However solution that I was using with other views does not work with notifications.
I've created RippleDrawable in drawable-v21
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#33000000">
</ripple>
And set this drawable as background of ImageView
<ImageView android:id="@+id/notification_play_button"
tools:src="@drawable/av_play_over_video"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@drawable/button_selector_semi_black"
/>
But it simply does not work. Do you have any ideas how to achieve this effect?
I guess you used "RemoteViews" to customized your notification layout.
Try to add "android:background="@android:color/transparent"
in your customized layout's view group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With