Android L ripple touch effect on shape?

<RelativeLayout
 android:foreground="?android:attr/selectableItemBackground">
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
</RelativeLayout>

enter image description here


This is with ripple and layer-list.

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorRipple">
<item>
    <layer-list>
        <item>
            <shape android:shape="rectangle">
                <solid android:color="#349F37" />
                <corners android:radius="6dp" />
                <stroke
                    android:width="2dp"
                    android:color="#50E751" />
            </shape>
        </item>
    </layer-list>
</item>

</ripple>

Try that one:

ripple.xml

<?xml version="1.0" encoding="utf-8"?>
<ripple android:color="@color/COLOR_WHILE_PRESSING" xmlns:android="http://schemas.android.com/apk/res/android">
 <item android:drawable="@drawable/background"></item>
</ripple>

background.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
 <solid android:color="@color/BACKGROUND_COLOR" />
 <corners android:radius="6dp" />
</shape>

Or maybe this post will help you: Android L FAB Button shadow

I explained there, how to implement the new FAB button, I also used the outline for that.