Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Kit Kat DatePicker in Lollipop Device

I'm trying to show a DatePickerDialog in my apps. But I realized that the DatePickerDialog that show up depends on the phone OS. My question is how can I show KitKat style DatePicker in Lollipop OS? I know this is possible because some apps like Facebook is using it.

This is what I want

DatePicker

like image 696
Gabyola Lim Avatar asked Apr 28 '15 07:04

Gabyola Lim


2 Answers

Try android:calendarViewShown="false" and android:datePickerMode="spinner" in the datepicker xml. I believe the former is for Kitkat and below, while datePickerMode applies to Lollipop.

like image 65
Matter Cat Avatar answered Nov 15 '22 09:11

Matter Cat


Finally I resolve that problem , you need to use 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 kitkat version in lolipop phone if u need some some the mail me any time

@[email protected]

like image 1
Aakash Sharma Avatar answered Nov 15 '22 08:11

Aakash Sharma