You can use android.support.v7.widget.CardView.
Maybe is not the perfect solution but for me is working on what I want. So, for example this is the trick I use on my app ... on an rectangular shape and I am pleased of the result.
private View.OnTouchListener touch = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
final android.support.v7.widget.CardView card_view = (android.support.v7.widget.CardView) ((View) v.getParent()).findViewById(R.id.card_view);
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
card_view.setCardElevation(6);
card_view.setScaleX(1.007f);
card_view.setScaleY(1.007f);
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
card_view.setCardElevation(3);
card_view.setScaleX(1f);
card_view.setScaleY(1f);
break;
}
return false;
}
};
In xml file I use:
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
card_view:cardCornerRadius="2dp"
card_view:cardMaxElevation="6dp"
card_view:cardElevation="3dp">