428 Commits

Author SHA1 Message Date
Material Design Team
c7fa5dc6e9 [TextField][A11y] Add tooltip support to TextInputLayout icons
- The icon's `contentDescription` is used as the tooltip text.
- Tooltips are only shown for icons that are interactive (focusable). Decorative-only icons will not display a tooltip.
- `CheckableImageButton` is updated to provide a callback for when its focusable state changes, which is used to trigger tooltip updates.
- API-level differences are handled to ensure that custom `OnLongClickListeners` are not overridden by the tooltip's long-press listener on older platforms (pre-API 26).

PiperOrigin-RevId: 794951524
2025-08-20 14:50:08 +00:00
Material Design Team
d8cc690b51 [ExposedDropdownMenu][A11y] Add keyboard support for dropdown menus
PiperOrigin-RevId: 788007779
2025-07-28 17:10:55 +00:00
Material Design Team
95e7b45208 [BottomSheet][A11y] Add half-expanded state description for accessibility
PiperOrigin-RevId: 765144604
2025-05-30 13:36:48 +00:00
rightnao
71bfc93bb6 [DatePicker] Fix bug causing undesired screenshot changes
PiperOrigin-RevId: 746583803
2025-04-17 23:56:05 +00:00
hunterstich
a8d492cb89 [Build] Moved back to Java 8 source and target compatibility
PiperOrigin-RevId: 739934297
2025-03-24 15:33:47 +00:00
hunterstich
4662301f7b [Build] Migrated builds to use a version catalog
PiperOrigin-RevId: 738386885
2025-03-19 18:26:48 +00:00
Material Design Team
71287c67dd [MaterialDatePicker][A11y] Disable next/prev button when the selected month is at the boundary
When user clicks on previous/next month button, the button will be disabled if the clicked month is at the boundary.

PiperOrigin-RevId: 738309727
2025-03-19 18:25:59 +00:00
pekingme
949b05742f [FAB] Improved readability.
PiperOrigin-RevId: 735467033
2025-03-11 18:00:04 +00:00
hunterstich
2c2a26cd9e [Build] Updated to AGP 8.7.3, Gradle 8.9, Java 21
PiperOrigin-RevId: 733023271
2025-03-03 21:28:32 +00:00
Material Design Team
7f8f3e762b Automated g4 rollback of changelist 655638807
PiperOrigin-RevId: 730472222
2025-02-25 19:31:01 +00:00
pubiqq
8f5a04c62b [NavigationView] Change navigation item pointer icon to arrow instead of hand, since they are not external links
Resolves https://github.com/material-components/material-components-android/pull/4316
Resolves https://github.com/material-components/material-components-android/issues/4315

GIT_ORIGIN_REV_ID=4e40f118f90ed05a48c5877d45db91642c7dad31
PiperOrigin-RevId: 681079283
2024-10-01 19:11:39 +00:00
Material Design Team
31f80151a9 [Snackbar] Set the accessibility pane title right before the Snackbar's appearance to resolve an event stream issue
PiperOrigin-RevId: 664967701
2024-08-20 17:36:35 +00:00
Material Design Team
f3aacd7bc6 [FloatingActionButton] Add an accessibility role to FloatingActionButton and ExtendedFloatingActionButton.
PiperOrigin-RevId: 663363115
2024-08-16 17:33:56 +00:00
Material Design Team
d7645ae5e1 [Snackbar] Add an accessibility pane title of "Alert"
PiperOrigin-RevId: 655638807
2024-07-25 19:04:11 +00:00
pekingme
51e5cec6dd [Release] Updated minSdkVersion to 21.
PiperOrigin-RevId: 644444951
2024-06-20 18:18:28 +00:00
Ga\u00ebtan Muller
b3fe6a7f61 [Cleanup] Remove redundant version checks for api <= 19.
Resolves https://github.com/material-components/material-components-android/pull/3849

GIT_ORIGIN_REV_ID=47bb2fcc8031740e5a7d4f741f1ada2af025e126
PiperOrigin-RevId: 632154861
2024-05-09 18:46:02 +00:00
Material Design Team
9734a2e96c Internal change
Tested:
PiperOrigin-RevId: 617920527
2024-03-25 21:15:42 +00:00
Material Design Team
8a71e7741a [AppBarLayout] Use an accessibility delegate to add and perform actions
This replaces the use of `ViewCompat#add/removeAccessibilityAction`

Both are valid strategies, but each call to `remove` or `add` triggers an accessibility event. Since this check is done in layout (originally to fix a11y scroll state) it's sending a high number of events that create noise for accessibility services.

To avoid this, we move this code to the delegate `onInitialize` and `performAction` methods. Instead of the view dynamically adding and removing actions to itself, the node is initialized with actions only when an a11y service sends a request with a new node (likely due to some UI change).

The flow here would look like:
1. UI is scrolled/page is loaded
2. TalkBack gets a scroll event/content change event
3. TalkBack requests new snapshot of the screen
4. ABL populates the node with the actions

For a simple scroll, this change reduces the events from ~40 to ~10.

We also add the Truth library for clearer assertions.

PiperOrigin-RevId: 605333170
2024-02-12 16:14:44 +00:00
hunterstich
ec89a8a225 [Build] Bumped minSkdVersion declarations to 19
PiperOrigin-RevId: 600452742
2024-01-22 18:26:37 +00:00
pekingme
1e9f5f0730 [AppBarLayout] Simplified logics to animate the container color between lifted state and the default state.
PiperOrigin-RevId: 566754407
2023-09-20 12:30:16 +00:00
pekingme
2b476b3a96 [TopAppBar] Updated the handling of liftOnScrollColor not override android:background.
PiperOrigin-RevId: 547883467
2023-07-17 15:56:54 +00:00
pfthomas
917da52393 [NavigationDrawer] Do not count headers for accessibility
PiperOrigin-RevId: 540975970
2023-06-26 21:25:15 +00:00
pfthomas
022e217770 [Navigation] Add itemTextAppearanceActiveBoldEnabled attr
Resolves https://github.com/material-components/material-components-android/issues/3191
Resolves https://github.com/material-components/material-components-android/issues/3293

PiperOrigin-RevId: 539977391
2023-06-14 15:14:24 +00:00
pfthomas
29b59c21f5 [MaterialDatePicker] Add getTextColor to DayViewDecorator
PiperOrigin-RevId: 527265648
2023-04-26 16:19:16 -04:00
pubiqq
4d50aa41e7 [Badge] Badge cleanup/fixes:
- Allow single digit badges to be non-circular if the label text is too big horizontally.
- Change maxCharacterCount to truncate both strings and numbers, and add new attribute maxNumber to truncate only numbers
- Updated maxCharacterCount so that if it doesn't exist, it does not truncate instead of defaulting to a value

Resolves https://github.com/material-components/material-components-android/pull/3321

GIT_ORIGIN_REV_ID=a8f5866eef5ffd4d949b8c6d7f1451b563536a6e
Co-authored-by: imhappi
PiperOrigin-RevId: 523453145
2023-04-13 09:05:14 -07:00
pfthomas
e1688f3d19 [MaterialDatePicker][a11y] Improve date input validation feedback
Resolves https://github.com/material-components/material-components-android/issues/2223

Add `TextInputLayout.setErrorAccessibilityLiveRegion` and `TextInputLayout.getErrorAccessibilityLiveRegion` to allow controlling the way the TextInputLayout error is announced.

Example:

```
textInputLayout.setErrorAccessibilityLiveRegion(ViewCompat.ACCESSIBILITY_LIVE_REGION_NONE);
```

PiperOrigin-RevId: 497323465
2022-12-29 00:19:00 -05:00
pfthomas
dff70c062d [MaterialDatePicker][a11y] Improve TalkBack focus order when selecting a day
Make RecyclerView non-scrollable to allow focusing away from it instead of paginating to previous/next month.

PiperOrigin-RevId: 486936286
2022-11-09 22:14:37 +00:00
rightnao
f9a37c5077 [TabLayout] Fix tab indicator animation
resolves https://github.com/material-components/material-components-android/issues/3047

PiperOrigin-RevId: 486241080
2022-11-07 16:00:53 +00:00
rightnao
c587dd1259 [AppBarLayout] Adding new attribute liftOnScrollColor that disables elevation overlay and allows users to change the app bar color
PiperOrigin-RevId: 477794812
2022-10-03 16:57:13 +00:00
rightnao
3c0c9e75f5 [TabLayout] Setting a custom view on the tab should replace the current custom view
PiperOrigin-RevId: 473057129
2022-09-12 12:25:10 -04:00
leticiars
08c40d85e5 [TextInputLayout] Added method to set corner family programmatically and a setShapeAppearanceModel method for greater customizability of the box background shape.
Resolves https://github.com/material-components/material-components-android/issues/1957

PiperOrigin-RevId: 470826160
2022-08-30 11:28:55 -04:00
leticiars
89a2b6fc1c [Build] Updated SDK target version to 33
PiperOrigin-RevId: 469782574
2022-08-24 14:42:06 -07:00
OxygenCobalt
2958d8d51b [BottomSheetBehavior] Add method to calculate slide offset
Resolves https://github.com/material-components/material-components-android/issues/2871
Resolves https://github.com/material-components/material-components-android/pull/2872

GIT_ORIGIN_REV_ID=de874ff649af0a6ad92340b3aad4e033bd84e933
PiperOrigin-RevId: 468521740
2022-08-19 10:57:18 -04:00
dsn5ft
be650c4f57 [MaterialDatePicker] Add initialize() method to DayViewDecorator to better support configuration changes
Fixes an issue where compound drawables using resource qualifiers like -land will have the wrong value on rotation

PiperOrigin-RevId: 466776776
2022-08-11 12:52:12 -04:00
dsn5ft
24201b4246 [MaterialDatePicker] Add ability to customize background color to DayViewDecorator
Resolves https://github.com/material-components/material-components-android/issues/2881

PiperOrigin-RevId: 464841873
2022-08-04 14:32:40 -04: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
rightnao
633b3cecfa [TextInputLayout] Adding set/get methods to control minimum width and height for start/end icons
Resolves https://github.com/material-components/material-components-android/issues/2080

PiperOrigin-RevId: 461939723
2022-07-20 21:44:40 +00:00
conradchen
051410b7ef [TextField] Stop saving/restoring TextInputLayout's themeable fields
Saving/restoring themeable fields will cause problems when the view is recreated, because those fields will be restored to the value resolved from the context before the recreation, instead of the current context. For example, when the device locale changes, those fields will still be restored to the previous locale instead of the new one.

It's a general practice in Android framework and AndroidX not to save/restore themeable fields. If clients need this, they should implement their own logic.

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

PiperOrigin-RevId: 454708278
2022-06-13 16:15:10 -07:00
Material Design Team
eb54d6a51a Update Appcompat and Emoji2 libraries from aosp-androidx-g3-release with build id #8479725
Android build branch: aosp-androidx-g3-release
Android build id: 8479725
Android build target: androidx
Auto generated by Argon artifacts pipeline

BEGIN_PUBLIC
...Update Appcompat and Emoji2 libraries...
END_PUBLIC

RELNOTES:N/A
PiperOrigin-RevId: 453710558
2022-06-09 14:16:44 -07:00
conradchen
1fe1618fca [BottomSheet] Do not find scrolling child that's not visible
Resolves https://github.com/material-components/material-components-android/issues/1834

PiperOrigin-RevId: 452813746
2022-06-03 15:42:29 -04:00
Material Design Team
72228f4f35 [AppBarLayout] Fix scrolling for a11y
Ensure the CoL can scroll to the bottommost elements of the scrolling child, which may not be visible due to the app bar.
Also, set the node info properties to expose the CoL to auto-scrolling.

PiperOrigin-RevId: 447596411
2022-05-10 09:48:55 -04:00
leticiars
6206ff5a1f [ExposedDropdownMenu] Added support for default/ripple background colors for the selected item of the exposed dropdown menu when the default MaterialAutoCompleteArrayAdapter is being used.
PiperOrigin-RevId: 447531152
2022-05-09 17:35:43 -04:00
pfthomas
b1f7d5bebc [NavigationView][a11y] Announce number of items in drawer
Resolves https://github.com/material-components/material-components-android/issues/678

PiperOrigin-RevId: 445165922
2022-04-28 12:40:24 -04:00
leticiars
f31414af02 [ExposedDropdownMenu] Update dropdown background when setRawInputType is called.
PiperOrigin-RevId: 438829151
2022-04-05 13:39:43 -04:00
leticiars
1c02b62eaf [ExposedDropdownMenu] Update background when setInputType is called so that ripple is or isn't present properly.
PiperOrigin-RevId: 437345929
2022-03-28 16:47:36 +00:00
conradchen
6cdf7b5155 [CleanUp][TextField] Extract end components from TextInputLayout
PiperOrigin-RevId: 435390505
2022-03-17 18:51:39 +00:00
conradchen
e644a72aa7 Automated g4 rollback of changelist 435127325
PiperOrigin-RevId: 435152125
2022-03-17 11:40:14 -04:00
conradchen
493243ea1e [BottomSheet] Fix bottom sheets in EXPANDED state when the expanded height is the same as the collapsed height
Resolves https://github.com/material-components/material-components-android/issues/2335

PiperOrigin-RevId: 435127325
2022-03-17 11:39:42 -04:00
leticiars
ae16efd5da [TextInputLayout] Fixed icons behaving unexpectedly when switching modes + bug of wrong icon tint state when setting an icon programmatically.
Resolves https://github.com/material-components/material-components-android/issues/503
Resolves https://github.com/material-components/material-components-android/issues/1849

PiperOrigin-RevId: 427268349
2022-02-09 15:58:45 +00:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00