408 Commits

Author SHA1 Message Date
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
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
leticiars
dca7fc0701 [TextInputLayout][a11y] Fixed RTL support for setting corner radius on TextInputLayout.
PiperOrigin-RevId: 408621523
2021-11-10 16:03:01 -05:00
leticiars
9d2f864f0a [TextInputLayout] Fixed getBoxCornerRadiusBottomEnd and getBoxCornerRadiusBottomStart returning wrong values.
PiperOrigin-RevId: 406360531
2021-10-29 18:48:29 +00:00
leticiars
3ca3b71bb2 [TextInputLayout] Don't add placeholder view to text field's input frame if placeholder is null.
PiperOrigin-RevId: 406129696
2021-10-28 18:50:16 +00:00
Material Design Team
8bf3bdeb8a Automated g4 rollback of changelist 404871534
PiperOrigin-RevId: 404899483
2021-10-25 16:08:53 +00:00
leticiars
2701161bbd [a11y][TextInputLayout] Removed TextInputLayout's placeholder text duplicated announcement, and fixed edge case where placeholder text was being enabled and added to the input frame while it was set to null.
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.

PiperOrigin-RevId: 404871534
2021-10-25 16:07:47 +00:00
conradchen
906e921e7a [Tab] Add unit tests for tab selection
PiperOrigin-RevId: 397745353
2021-09-20 12:28:37 -07:00
pekingme
b24e802c30 Updated targetSdkVersion to 31.
PiperOrigin-RevId: 393165652
2021-08-26 15:11:47 -04:00
conradchen
a2e76736c5 [BottomSheetBehavior] Fix ViewDragHelper state inconsistency
When BottomSheetBehavior is set to not draggable, it's still forwarding touch event to ViewDragHelper, which causes ViewDragHelper changes its state to dragging although it's not really dragging. This causes bugs like if we change draggable to true during "no-effect" dragging, ViewDragHelper won't report the dragging state change because it thinks the state is not changing.

Fixes this by avoiding forwarding touch events to ViewDragHelper when it's not draggable, so its state won't be changed.

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

PiperOrigin-RevId: 384942764
2021-07-15 12:37:35 -04:00
conradchen
4044183f46 [TextInputLayout] Apply tint when setting start icons
If startIconTint is a plain color, refreshStartIconDrawableState() won't update the tint to the new drawable. To solve the issue and make the logic be consistent, calls applyStartIconTint() when a new icon is set.

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

PiperOrigin-RevId: 383632467
2021-07-08 15:59:37 +00:00
conradchen
281688a2f2 [DatePicker] Fix DatePicker crashes and and potential issue of range selection
GridView used to display days in months can be scrolled when there are more rows
than the space can contain. Usually this happens when a month spans over 6 rows. In this case, the position of the day in a month will not be the same as its corresponding view position in the grid view. This can cause:

1. Wrong day view being highlighted.
2. Crashes due to out-of-bound index. (The day position can be larger than view
   counts due to invisible days.)

PiperOrigin-RevId: 379382943
2021-06-15 21:56:07 -07:00
afohrman
720088c5c2 [BottomNavigationView] Added deprecation Javadoc for BottomNavigationView#OnNavigationItemSelectedListener and BottomNavigationView#OnNavigationItemReselectedListener.
The listeners were deprecated in favor of `NavigationBarView#OnItemSelectedListener` and `NavigationBarView#OnItemReselectedListener`, but deprecation documentation was never added, so it's unclear what developers should use instead.

Also removed internal usages of these deprecated usages in the catalog and in tests.

PiperOrigin-RevId: 378021534
2021-06-09 18:20:52 +00:00
raajkumars
aca5bfb6f7 [Bottom Navigation] Extracted common logic from bottom navigation component into navigation package.
PiperOrigin-RevId: 345029590
2020-12-02 09:55:26 -05:00
Material Design Team
9659a536b9 [Snackbar] Add support for passing a Context to Snackbar.make()
Currently Snackbar.make() will use the context of the parent view (typically CoordinatorLayout or decor content view) to inflate the Snackbar view. This is not desirable for cases where there may be a ContextThemeWrapper below that parent view, e.g. for a Fragment that uses material theme.

The behavior of existing methods without Context argument remain unchanged.

PiperOrigin-RevId: 340286851
2020-11-03 11:12:55 -05:00
connieshi
bc1bd23375 [chip] Avoid flickering when using downlodable fonts.
PiperOrigin-RevId: 338258136
2020-10-21 15:49:00 -07:00
dniz
90929ee274 [MaterialDatePicker] Fixed overzealous smooth scrolling when horizontally swiping between months
Resolves https://github.com/material-components/material-components-android/issues/920

PiperOrigin-RevId: 337879242
2020-10-19 11:43:33 -07:00
hunterstich
0afcb48f14 [TabLayout] Automated g4 rollback of changelist 337128442.
*** Reason for rollback ***

[TabLayout] Roll forward with dot indicator fix

*** Original change description ***

Automated g4 rollback of changelist 337092676

PiperOrigin-RevId: 337484043
2020-10-16 05:54:50 -07:00
hunterstich
91589f4c24 Automated g4 rollback of changelist 337092676
PiperOrigin-RevId: 337128442
2020-10-15 13:28:59 -07:00
hunterstich
f0a80c4e41 [TabLayout] Automated g4 rollback of changelist 336764852.
*** Reason for rollback ***

Roll forward with fix

*** Original change description ***

Automated g4 rollback of changelist 336704515

PiperOrigin-RevId: 337092676
2020-10-15 13:25:34 -07:00
hunterstich
f743057941 Automated g4 rollback of changelist 336704515
PiperOrigin-RevId: 336764852
2020-10-15 13:16:16 -07:00