Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To override the DatePicker format the best bet would be to override one of its constructors with a slight edit to the original code. You can edit the ViewGroup in code for you but I'd seriously consider not doing it that way.</p> <ol> <li>Create class LocalizedDatePicker</li> <li>Override <a href="http://developer.android.com/reference/android/widget/DatePicker.html#DatePicker%28android.content.Context,%20android.util.AttributeSet,%20int%29" rel="nofollow">public DatePicker (Context context, AttributeSet attrs, int defStyle)</a> <a href="http://developer.android.com/reference/android/widget/DatePicker.html#DatePicker(android.content.Context" rel="nofollow">http://developer.android.com/reference/android/widget/DatePicker.html#DatePicker(android.content.Context</a>, android.util.AttributeSet, int)</li> <li>Copy the code from the <a href="https://android.googlesource.com/platform/frameworks/base/+/HEAD/core/java/android/widget/DatePicker.java" rel="nofollow">original DatePicker constructor</a> (you may need to select a different branch after some testing, I have linked the head)</li> <li>Override methods that call reorderSpinners() to remove that call.</li> <li>Replace line <code>inflater.inflate(R.layout.date_picker, this, true);</code> with <code>inflater.inflate(my.package.R.layout.localized_date_picker, this, true);</code></li> <li>Copy the original date_picker.xml layout to your local resource localized_date_picker.xml</li> <li>Edit the file for the desired order, since you're editing this please respect the localization of other places and keep a copy of the original in your global layout folder and put the localized_date_picker.xml in your region specific folder. Since the system's layout is Month Day Year people in other places may expect that order.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload