This change introduces pending states for icon and icon size. When a width animation is active, calls to setIcon and setIconSize are deferred and applied only after the animation completes, preventing layout conflicts.
PiperOrigin-RevId: 840343132
The gap between the thumb and track is now calculated on the fly for each thumb, considering whether the thumb is currently pressed.
PiperOrigin-RevId: 839683792
On D-Pad controlled devices like Android TV, pressing up or down on a focused horizontal slider would change its value instead of moving focus to an adjacent UI element. This trapped users in the slider.
This CL fixes the focus trap by removing the key handlers for DPAD_UP and DPAD_DOWN, allowing the Android system to handle focus navigation as expected.
PiperOrigin-RevId: 837044072
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