Skip to content

Instantly share code, notes, and snippets.

@kishandonga
Created June 13, 2020 07:08
Show Gist options
  • Save kishandonga/d1727ff54dff4f8499bf1eb9e736865b to your computer and use it in GitHub Desktop.
Save kishandonga/d1727ff54dff4f8499bf1eb9e736865b to your computer and use it in GitHub Desktop.
Drop Shadow using drawable as like CardView
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#00bbbdcb" />
<corners android:radius="25dp" />
</shape>
</item>
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#05bbbdcb" />
<corners android:radius="25dp" />
</shape>
</item>
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#0abbbdcb" />
<corners android:radius="25dp" />
</shape>
</item>
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#0fbbbdcb" />
<corners android:radius="25dp" />
</shape>
</item>
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<solid android:color="#14bbbdcb" />
<corners android:radius="25dp" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<solid android:color="@android:color/white" />
<corners android:radius="25dp" />
</shape>
</item>
</layer-list>
@kishandonga
Copy link
Author

Got output as like this

Screenshot 2020-06-13 at 12 37 27 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment