I created my own dialog with a drop shadow, you can use it as your desire, at the first stage you need to create an Android form for shadow and dialog frames. Here is what I set ( dialog_frame_shadow.xml ):
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <padding android:bottom="5dp" android:left="5dp" android:right="5dp" android:top="5dp"/> <solid android:color="#44000000"/> <corners android:radius="5dp"/> </shape> </item> <item> <shape android:shape="rectangle"> <corners android:radius="5dp"/> <stroke android:color="#ff272727" android:width="2dp" /> <gradient android:angle="90" android:startColor="#ffa7a7a7" android:centerColor="#ff6a6a6a" android:endColor="#ffa7a7a7" android:type="linear"/> </shape> </item> </layer-list>
In the next step, you should change the topic of the dialogue as follows:
<style name="my_dialog_theme"> ... <item name="android:windowBackground">@drawable/dialog_frame_shadow</item> ... </style>
Now you're done, just create a new instance of the Dialog class and apply this theme to it (in the dialog constructor):
Dialog dialog = new Dialog(this, R.style.my_dialog_theme); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.mdialog); dialog.show();
Here is a screenshot:

source share