Datepicker dialog without calendar visualization in lollipop [spinner mode]?

DatePickerDialog uses the dialog theme specified by your activity theme. This is a fully-specified theme, which means you need to re-specify any attributes — such as the date picker style — that you’ve set in your activity theme.

<style name="MyAppTheme" parent="android:Theme.Material">
    <item name="android:dialogTheme">@style/MyDialogTheme</item>
    <item name="android:datePickerStyle">@style/MyDatePicker</item>
</style>

<style name="MyDialogTheme" parent="android:Theme.Material.Dialog">
    <item name="android:datePickerStyle">@style/MyDatePicker</item>
</style>

<style name="MyDatePicker" parent="android:Widget.Material.DatePicker">
    <item name="android:datePickerMode">spinner</item>
</style>

Note: Due to Issue 222208, this will not work in Android N / API 24. It has already been fixed in the platform for the next release. There is no workaround available for API 24 devices.

Leave a Comment