Using Kit Kat DatePicker on a Lollipop Device

I am trying to show DatePickerDialog in my applications. But I realized that the displayed DatePickerDialog depends on the phone OS. My question is how to show KitKat style DatePicker in Lollipop OS? I know this is possible because some applications, such as Facebook, use it.

This is what I want

Datepicker

+6
source share
2 answers

Try android:calendarViewShown="false" and android:datePickerMode="spinner" in the datepicker xml file. I believe the first applies to Kitkat and below, and datePickerMode refers to Lollipop.

+11
source

Finally, I solve this problem, you need to use the theme with

 <style name="Theme.Transparent" parent="@android:style/Theme.Holo.Light.Dialog"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:backgroundDimEnabled">true</item> </style> 

with

 android:calendarViewShown="false" android:datePickerMode="spinner" 

then it shows the kitkat version in lolipop phone if you need some email me anytime

@ aakash4un2me @ gmail.com

+1
source

Source: https://habr.com/ru/post/986114/


All Articles