3688 Commits

Author SHA1 Message Date
hunterstich
71f014fa41 [Snackbar] Added optional close icon
PiperOrigin-RevId: 845256053
2025-12-17 14:23:55 +00:00
rightnao
d5934ee5ba [Lists] Support skipping the open swipe state so clients can go straight to the primary action
PiperOrigin-RevId: 843871144
2025-12-15 13:55:28 +00:00
rightnao
75f0a4e812 [Lists] Add getSwipeState method and demo, and refactored to set necessary swipe elements before drag so they are available for programmatic swipes
PiperOrigin-RevId: 842819821
2025-12-12 12:43:12 +00:00
pekingme
f86cedd44a [Button] Defer icon changes during width animation in MaterialButton.
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
2025-12-08 14:24:26 +00:00
Material Design Team
0b669dab7d [Slider] Adjust thumb-track gap only for the pressed thumb
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
2025-12-04 16:46:53 +00:00
rightnao
50bca3279a [Lists] Updates to styles
PiperOrigin-RevId: 837253230
2025-12-02 15:15:27 +00:00
Material Design Team
7fc1c4ff14 [Slider][A11y] Fix D-Pad focus trap on horizontal sliders.
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
2025-12-02 15:14:33 +00:00
rightnao
1dbfdd74d5 [Lists] Make SwipeableListItem and RevealableListItem public and add swipe state callback
PiperOrigin-RevId: 836752108
2025-12-02 15:05:54 +00:00
Material Design Team
dcd9898640 [DatePicker] Cache isFullscreen state in MaterialCalendar
PiperOrigin-RevId: 836142198
2025-11-24 12:44:22 -08:00
rightnao
93ae7307a0 [Lists] Add styles and theme overlays for material icon buttons inside lists
PiperOrigin-RevId: 834834478
2025-11-24 12:43:02 -08:00
rightnao
6310274b72 [List][Catalog] Address a11y issues
PiperOrigin-RevId: 834524481
2025-11-24 12:42:08 -08:00
Material Design Team
0153138811 [FloatingActionButton] Allow collapsed size to be set.
PiperOrigin-RevId: 834422708
2025-11-24 12:41:08 -08:00
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
rightnao
32e9fb21b2 [Lists] Add attr for min child width
PiperOrigin-RevId: 833521355
2025-11-19 08:39:17 -08:00
rightnao
f30777111e [SearchView] Make SearchView root unfocusable
PiperOrigin-RevId: 833520163
2025-11-19 08:30:34 -08:00
rightnao
176e92d3c3 [Lists] Support RTL swiping
PiperOrigin-RevId: 833469324
2025-11-19 08:29:02 -08:00
rightnao
3e5a7fdb44 [Lists] Added onSwipeStateChanged callback, drawable swiped state for ListCardView, and alpha changes to swiped view as it reaches the swipe-to-action state
PiperOrigin-RevId: 833409689
2025-11-17 21:09:21 +00:00
rightnao
3c1a61c3dd [Lists] Add styles for control elements in lists
PiperOrigin-RevId: 832010671
2025-11-17 21:08:16 +00:00
rightnao
69e9676e48 [Lists] Re-measure intrinsic width when measure specs change
PiperOrigin-RevId: 832002199
2025-11-17 21:07:11 +00:00
rightnao
692bd113ad [Lists] Add more optional styles and update demos to show more variety of sample list content
PiperOrigin-RevId: 831979827
2025-11-17 21:05:48 +00:00
rightnao
235e8cfe71 Automated g4 rollback of changelist 816428327
PiperOrigin-RevId: 831030528
2025-11-17 21:04:30 +00:00
rightnao
0e1724824a [NavigationView] Set navigation menu item's a11y role description so it doesn't default to 'radio button' due to being checkable
PiperOrigin-RevId: 830619106
2025-11-11 18:49:41 +00:00
pekingme
9a8272d9c1 [Shape] Updated isRoundRectCornerMorph and pathDirty logic in MaterialShapeDrawable
PiperOrigin-RevId: 829468349
2025-11-07 17:58:47 +00:00
rightnao
07a3be50c2 [Lists] Add swipe for action state
PiperOrigin-RevId: 828603206
2025-11-07 17:57:33 +00:00
Material Design Team
2e04704341 [Internal change] Removed references to the AndroidJdkLibsChecker Error Prone check
PiperOrigin-RevId: 828144964
2025-11-07 17:56:28 +00:00
leticiars
c4d19f6f7d [Slider] Fix ACTION_CANCEL motion touch event handling so that the slider resets its state if a cancel happens. Also don't let slider update incorrectly when a touch event may be overlapping with back gesture inset areas, as the back event takes precedence.
PiperOrigin-RevId: 828106972
2025-11-07 17:51:26 +00:00
pekingme
90a8043ad3 [Shape] Code format.
PiperOrigin-RevId: 828094095
2025-11-07 17:49:44 +00:00
pekingme
ea9d25050c [Shape] Always skip corner morph animation on bounds change in MaterialShapeDrawable.
PiperOrigin-RevId: 827536893
2025-11-07 17:48:18 +00:00
Material Design Team
a207114c60 [DatePicker] Add MonthAdapter helpers for finding enabled days
This change introduces helper methods to `MonthAdapter` to allow callers to identify days that are enabled according to the `CalendarConstraints`.

PiperOrigin-RevId: 826466043
2025-10-31 21:09:45 +00:00
pekingme
3b971c9fe9 [TopAppBar] Updated ripple color on actions in M3 toolbar.
PiperOrigin-RevId: 826228085
2025-10-31 21:08:35 +00:00
pekingme
dc98ca0335 [Button] Fixed width morph with contents change.
PiperOrigin-RevId: 825101222
2025-10-31 21:07:33 +00:00
leticiars
5c73d7a928 [BottomAppBar][a11y] Remove special key shortcut and keyboard navigation cluster for bottom app bar for correct keyboard navigation a11y.
PiperOrigin-RevId: 822720920
2025-10-31 19:00:44 +00:00
pfthomas
6c4db77711 [MaterialTimePicker] Use ViewCompat.performHapticFeedback
Resolves https://github.com/material-components/material-components-android/issues/4948

PiperOrigin-RevId: 822672441
2025-10-31 18:48:11 +00:00
rightnao
1e6a8b758b [Lists] Add dependency to androidx.customview for ViewDragHelper and added swiped states + settling
PiperOrigin-RevId: 822221345
2025-10-22 16:15:36 +00:00
Material Design Team
98031c4159 [Color] Internal cleanup
PiperOrigin-RevId: 822188550
2025-10-22 16:14:41 +00:00
leticiars
1bf522fbbf [Slider][a11y] Change thumb width when it's keyboard focused.
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
2025-10-22 16:08:15 +00:00
pekingme
3482899045 [Shape] Fixed MaterialShapeDrawable#isRoundRect to use state-aware shape appearance.
PiperOrigin-RevId: 822156263
2025-10-22 16:04:30 +00:00
dsn5ft
cf35db5320 [i18n] Update item_view_role_description translation
PiperOrigin-RevId: 821662917
2025-10-22 16:03:19 +00:00
Material Design Team
aa623f0fac [Slider][A11y] Fix slider D-Pad keys to modify value instead of focus
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
2025-10-20 14:53:21 +00:00
rightnao
a5be0f7eed [Lists] Fix issue where the first drag may have not clamped to the end properly since originalContentLeft is 0
PiperOrigin-RevId: 820474927
2025-10-20 14:52:34 +00:00
leticiars
ce092fa5dd [Slider] Only one value label should be shown at a time for the range slider (except for the mode where the labels are always visible).
PiperOrigin-RevId: 819785653
2025-10-20 14:51:18 +00:00
rightnao
400d695bc5 [Lists] Add ListItemRevealLayout, ListItemCardView, and relevant interfaces to introduce swiping in ListItemLayout
PiperOrigin-RevId: 818827578
2025-10-14 19:02:04 +00:00
pekingme
04c849e2ce [Shape] Internal feature.
PiperOrigin-RevId: 818748582
2025-10-14 19:00:54 +00:00
rightnao
32362922af [Lists] Add ViewDragHelper
PiperOrigin-RevId: 818740364
2025-10-14 18:59:39 +00:00
rightnao
4e4e8f3388 [BottomSheet] Add support for Nested Scrolling with multiple nested scroll children.
PiperOrigin-RevId: 817350806
2025-10-10 19:10:21 +00:00
Material Design Team
54be28bd3d Automated g4 rollback of changelist 817143878
PiperOrigin-RevId: 817183622
2025-10-10 19:09:47 +00:00
Gaëtan Muller
41311caffc [Snackbar] Remove TODOs about Robolectric shadows
Resolves https://github.com/material-components/material-components-android/pull/4735

  - 0f6faacc5cae8272a5b4c72f8c7ff243db1642d9 by Gaëtan Muller <m.gaetan89@gmail.com>

PiperOrigin-RevId: 817143878
2025-10-10 18:11:08 +00:00
rightnao
d35634cfd2 Automated g4 rollback of changelist 814296973
PiperOrigin-RevId: 816428327
2025-10-10 18:08:04 +00:00
leticiars
ee52adbf05 [TopAppBar][a11y] Remove special key shortcut and keyboard navigation cluster for top app bar for correct keyboard navigation a11y.
PiperOrigin-RevId: 816305551
2025-10-07 19:55:50 +00:00
Material Design Team
3d8d23dadb [Slider][A11y] Use arrow keys for value adjustment and TAB for navigation
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
2025-10-07 19:55:02 +00:00