Search code examples
androiddatepickerlocaledate-format

Android DatePicker components order


I made a custom DatePicker that extends the android DatePicker UI component. I needed this to make possible the visibility option for each DatePicker's view component(day,month and year). I made this possible by hiding the views from DatePicker by its index.

I get the index of each component by getting the date format order like this DateFormat.getDateFormatOrder(context) , this returns a char array like {m, d, y} so I can get the order of the DatePicker components and hide them..

The problem I run into is that on some devices the DatePicker position its components by the selected locale of the user and not by the selected date format.

How can I get the DatePicker's components order? Or how I can figure out that DatePicker will position its components by locale or date format?

Note that I am developing this on Android API level 2.1++ and I would prefer not to make my own DatePicker so I can preserve the android DialogPicker UI theme.

Thank you!


Solution

  • And unfortunately the answer is: I had to develop my own DatePicker and now everything works fine