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
This change introduces helper methods to `MonthAdapter` to allow callers to identify days that are enabled according to the `CalendarConstraints`.
PiperOrigin-RevId: 826466043
Refactored so that each thumb is an individual drawable, so that they can change width independently. Plus, with this change a custom thumb drawable no longer changes its width when pressed.
PiperOrigin-RevId: 822162251
Previously, Up/Down arrow keys navigated focus instead of changing the slider value. This change updates keyboard handling so all D-Pad keys modify the slider value: Up/Down increment/decrement the value, and Left/Right increment/decrement based on layout direction.
PiperOrigin-RevId: 821593460
Refactors Slider/RangeSlider keyboard navigation for a more intuitive and accessible experience, removing the need to press ENTER to toggle between navigation and value adjustment modes.
With this change:
- Arrow keys (+/-/=/DPAD) always adjust the value of the focused thumb.
- TAB and Shift+TAB always navigate focus between thumbs.
This simplifies event handling by ensuring `activeThumbIdx` stays synchronized with `focusedThumbIdx` during keyboard input.
Also fixes regressions in `SliderTouchTest` by preventing `onFocusChanged` logic (now conditioned on `activeThumbIdx == -1`) from incorrectly overriding thumb selection during touch events.
PiperOrigin-RevId: 816168251
When clearing the hour or minute field in keyboard input mode, screen readers would incorrectly announce the previous value instead of announcing that the field is blank.
This is fixed by updating the `AccessibilityDelegateCompat` to read `editText.getText()` directly in `onInitializeAccessibilityNodeInfo`, ensuring it always reports the most current text value to accessibility services.
As part of this fix, the delegate is now created once and reused. This is a performance improvement that avoids creating a new delegate object each time the text content changes.
PiperOrigin-RevId: 814635548
Added a check for `shouldCalculatePath()` before recalculating the fill and stroke paths during drawing. This prevents unnecessary path calculations when the shape is not visible or doesn't need path updates.
PiperOrigin-RevId: 814298357