10 Commits

Author SHA1 Message Date
Material Design Team
757f9f3db1 [DatePicker][A11y] Fix TAB keyboard trap and add DPAD month navigation.
This change fixes a keyboard trap in MaterialDatePicker where the TAB key focus was stuck within the month grid. TAB navigation is now limited to the days within the current month, allowing focus to move out of the picker.

For navigating between months, this change introduces DPAD (left/right arrow key) navigation. When on the first or last valid day of the month, the arrow keys will navigate to the previous or next month.

This CL also prevents keyboard focus from landing on disabled dates. Since GridView does not natively support skipping disabled items, custom logic has been added to find and focus on the nearest valid day during keyboard navigation.

Finally, a bug that caused focus to incorrectly jump to a previous, non-visible month during TAB navigation has been fixed. This was caused by RecyclerView's view-recycling mechanism. The solution ensures that only the currently visible month is focusable, preventing focus from moving to off-screen months.

PiperOrigin-RevId: 834271529
2025-11-19 08:41:58 -08:00
dsn5ft
bca0f2ea8e [MaterialDatePicker] Add support for decorating day views and a demo for circle indicators
Resolves https://github.com/material-components/material-components-android/issues/2854

PiperOrigin-RevId: 463608089
2022-07-28 17:39:54 -04:00
conradchen
62e89933d6 [DatePicker] Fix wrong month title with certain months
The issue is caused by failing to correctly take the daylight saving time into account - internally we use UTC time to represent dates, however when generating month titles we try to calculate the time difference of the UTC time and the local time, which can result in off-by-one errors when the first day of the month is also the first day of the daylight saving time, e.g., April 1, 1979 in Poland.

Fixes this by always using UTC time to generate month titles. Also clears the relevant implementation for a little bit since context is actually not required when we only need to format years and months.

Resolves https://github.com/material-components/material-components-android/issues/1935

PiperOrigin-RevId: 413505587
2021-12-01 19:08:56 -05:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
dniz
98c7cd15ee [DatePicker] Fixed formatting of year month date pattern for year selection dropdown
PiperOrigin-RevId: 334616659
2020-09-30 17:00:29 -04:00
Material Design Team
b12c5c5b00 [DatePicker] Speed up calendar performance by only updating certain views when a day is clicked, instead of recreating and redrawing all of them.
PiperOrigin-RevId: 325850735
2020-08-11 14:39:26 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
ldjesper
cdcccfbc5c Fix missing ok and cancel in landscape MaterialDatePicker
We make the middle pane scrollable in cases where things just will not fit

PiperOrigin-RevId: 268301091
2019-09-12 14:01:19 -04:00
ldjesper
d78d93577f Remove Month from the public API
PiperOrigin-RevId: 268242042
2019-09-12 13:57:19 -04:00
ldjesper
72d54c653c Change picker package to com.google.android.material.datepicker
PiperOrigin-RevId: 267004501
2019-09-04 18:07:59 -04:00