i want to add shadow effect in alert dialog box . i want this type of shadow effect in my dialog box here i post 3 files first is style.xml second is theme.java or third file is demo_bg.xml file.i already try like that
Style.xml
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/bg_color</item>
<item name="android:textColorPrimary">@color/colorBlack</item>
<item name="android:background">@drawable/demo_bg</item>
</style>
theme.java
final AlertDialog.Builder builder =
new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
builder.setMessage(R.string.wsdialogdata);
builder.setPositiveButton("START", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent ii = new Intent(WelcomeFromActivity.this, Question1Activity.class);
startActivity(ii);
}
});
builder.show();
demo_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<!-- SHADOW LAYER -->
<item android:left="2dp" android:top="2dp">
<shape>
<solid android:color="#66000000" />
<corners android:radius="35dip" />
</shape>
</item>
<!-- CONTENT LAYER -->
<item android:bottom="4dp" android:right="4dp">
<shape>
<solid android:color="@color/btn_fb" />
<corners android:radius="40dip" />
</shape>
</item>
</layer-list>
</item>
</selector>