I cannot use Lollipop elevation
property because I need to target devices from API 18.
I need to place a shadow on the right and left side of a view.
This is what I tried so far :
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<item>
<shape >
<!-- set the shadow color here -->
<stroke
android:width="2dp"
android:color="#7000" />
<!-- setting the thickness of shadow (positive value will give shadow on that side) -->
<padding
android:bottom="0dp"
android:left="2dp"
android:right="2dp"
android:top="0dp" />
<corners android:radius="3dp" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<solid android:color="@color/salmon" />
<corners android:radius="3dp" />
</shape>
</item>
</layer-list>
I tried adding gradients
in the first item, but it spreads from left to right which is not what I am looking fo. Is there a way to isolate two unique gradients for each side ?
This is what I am trying to do :