I add datepicker to my application but my problem the shadow for the dialog have white background , use Android 21 for compile .
please help me to remove white background ...

I had the same problem,
First Solution I have done :
I end up giving this theme in the DatePickerDialog builder. What's important is the windowBackground set to transparent.
<style name="Theme.Yp.DatePicker" parent="@android:style/Widget.DeviceDefault.DatePicker">
<item name="android:textColor">@color/color_accent</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:gravity">center</item>
</style>
Second and Final Solution :
I finished by using the DatePickerDialog.THEME_DEVICE_DEFAULT_LIGHT that works just fine. We didn't use a lot of styling so it was ok.
You have a "bug" in your themes.xml or styles.xml material design support library is not working properly with dialogs.
So remove the specific dialog code or separate it in different versions.
Trying to explain a little bit further.
Generally when we extend the original application theme we have an themes.xml and/or styles.xml files under the values folder. In there code you will find something like these:
Application theme:
<style name="MyTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<!-- ... other styling values ... -->
<!-- Dialog attributes -->
<item name="dialogTheme">@style/MyTheme.Dialog</item>
<!-- AlertDialog attributes -->
<item name="alertDialogTheme">@style/MyTheme.Dialog</item>
<!-- ... other styling values ... -->
</style>
Custom dialog theme:
<style name="MyTheme.Dialog" parent="@style/Theme.AppCompat.Light.Dialog">
<!-- some styling values here -->
</style>
What needs customization is the parent of the MyTheme.Dialog this Theme.AppCompat.Light.Dialog does not work properly for all android versions it may work for Lollipop but does not work for KitKat, or the opposite.
values-v21 and define the parent of the dialog accordingly, so that it work for both versions.You can apply some other workarounds regarding the customization of the style, in order for this to work.
If you would like further research, or theme customization ideas take a look at the source of android theme.xml here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With