0

I implemented date picker in my project from here: https://developer.android.com/guide/topics/ui/controls/pickers

The problem is, this date picker is in the format of regular calendar, and it takes a long time to choose faraway dates. In my app this kind of action is going to be performed all the time.

So, my question is, is there a possibility to change this calendar-like form to something faster? For example like in the picture below.

Picture of date picker i would like to make

Arkadiusz
  • 15
  • 8

3 Answers3

0

check that library: https://github.com/florent37/SingleDateAndTimePicker

I've used it some time ago and it did almost exactly what you're looking for ;)

If it doesn't fit your needs, you can look for more 'iOS style date pickers' for Android, for example in this SO post:

ios like date/time picker for android platform

Edit:

It seems that this picker is Holo Light style and is achievable with this piece of code:

DatePickerDialog datepickerdialog = new DatePickerDialog(getActivity(),
     AlertDialog.THEME_HOLO_LIGHT,this,year,month,day);

But you need to check that on your own because they might be deprecated or not working with other themes.

Mariusz Brona
  • 1,549
  • 10
  • 12
0

Did you check this for Material Design?

Here is its documentation and code.

0

The DatePicker widget in Android has an attribute called android:datePickerMode that has a calendar option and a spinner option.

You can use the spinner option to get the appearance of the DatePicker you are after.

  • How can I apply it to my program? It seems to me like an XML attribute, but I dont have XML file with calendar in my project. – Arkadiusz Jun 19 '20 at 21:53
  • If you want to show a DatePicker widget in your fragment or activity you can alter the layout resource for your fragment or activity and add the DatePicker widget as an XML element. Then on the DatePicker XML element you can add an XML attribute for the date picker mode to set it to appear as a spinner. – Learn to Droid Jun 20 '20 at 04:28