2556 Commits

Author SHA1 Message Date
dsn5ft
d6c435461e [AppBarLayout] Add setLiftOnScrollTargetView() method
Resolves https://github.com/material-components/material-components-android/pull/2544

PiperOrigin-RevId: 442823082
2022-04-19 12:02:59 -04:00
Rikka
824a12b7c8 [Color] Fix HarmonizedColorsOptions.Builder#setColorAttributes is marked as nullable
Resolves https://github.com/material-components/material-components-android/pull/2649

GIT_ORIGIN_REV_ID=b1f2d2ca1d4c5b25370eb0902fbf35729d6fc0a4
PiperOrigin-RevId: 442676674
2022-04-19 10:59:04 -04:00
conradchen
45b99f603e [Button] Fix the issue that button state is not updated
On Lollipop, when first assigned as View's background, RippleDrawable won't/can't propagate states to its content drawable. This causes the issue that the state relevant features like stroke colors are not correctly updated when the background is recreated. Explicitly assigns states to the content drawable to fix the issue.

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

PiperOrigin-RevId: 442676637
2022-04-19 10:57:43 -04:00
conradchen
5b9f27aad0 [SnackBar] Make dismiss direction the same as swipe direction
In SwipeDismissBehavior, when dismissing views according to the horizontal velocity instead of position delta, we would still using position delta to decide the dismissing direction, which, unfortunately, makes the view always be dismissed from left to right because of the "less than" logic we are using doesn't really take the equaling case into account. Fixes this by using the velocity direction to dismiss the view instead.

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

PiperOrigin-RevId: 442553318
2022-04-18 13:12:46 -04:00
conradchen
788866e448 [Chip] Fix chip layout not updated when programmatically setting text size
We didn't forward Chip.setTextSize() call properly to ChipDrawable.setTextSize(). Fixes this by properly overriding the method.

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

PiperOrigin-RevId: 442056225
2022-04-15 14:18:11 -04:00
hunterstich
894edb6aa5 [Motion] Open MotionUtils and update resolveThemeInterpolator to load both new and legacy easing attributes.
PiperOrigin-RevId: 441806915
2022-04-14 14:10:45 -04:00
conradchen
26308d97d8 [CleanUp][TextField] Centralize EndIconDelegate listener logic
It provides better performance and memory management.

PiperOrigin-RevId: 441566824
2022-04-14 13:15:33 -04:00
conradchen
b6b895a1e4 [Button] Fix icon textStart/End alignment with multiline text
When calculating text width to decide the icon position with textStart/End alignment, we missed accounting for multiline text. Fixes this by calculating each line's width separately and take the widest one to decide the icon position.

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

PiperOrigin-RevId: 440982189
2022-04-11 17:13:57 -04:00
conradchen
05be1b92c5 [TopAppBar] Fix app:expanded=false not working
When an AppBarLayout is loaded, it will load the attribute and set up a non-forcing pending action. However when it's measured, the current scroll state will be saved and restored, which will override the non-forcing pending action. This behavior is incorrect - if there's a pending action, we shouldn't restore the scrolling state because it's meant to be changed.

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

PiperOrigin-RevId: 440960254
2022-04-11 15:47:00 -04:00
conradchen
19d05000bc [Button] Fix icon position with multiline text
When the icon gravity is textTop, we are using the smaller one of the calculated height from text paint and the text layout height to decide the icon position. This is wrong when there are multiple lines of text since the text paint is always single line and always shorter than the actual height.

Fixes this by returning the actual layout height whenever there are multiple lines of text to fix the issue.

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

PiperOrigin-RevId: 440923733
2022-04-11 15:12:33 -04:00
conradchen
dc0d8a956e [Slider] Make slider's height adjustable with track height or thumb radius
Resolves https://github.com/material-components/material-components-android/issues/1923

PiperOrigin-RevId: 440913851
2022-04-11 12:42:09 -04:00
leticiars
2c335b5f77 [ExposedDropdownMenu] Updated the elevation of the popup to match M3 specs. Also fixed bug where elevation wasn't being read via xml.
PiperOrigin-RevId: 440397922
2022-04-11 11:17:51 -04:00
pfthomas
c23daec8b1 [MaterialDatePicker][a11y] Make picker header focusable to improve TalkBack response
PiperOrigin-RevId: 440375456
2022-04-11 11:13:40 -04:00
conradchen
2544c1f243 [Color] Fix MaterialColors cannot handle CSL issue
Resolves https://github.com/material-components/material-components-android/issues/955

PiperOrigin-RevId: 440358122
2022-04-08 11:01:05 -04:00
conradchen
c6a654c7dd [DatePicker] Fix edge-to-edge mode being applied multiple times
When the date picker goes back from background to foreground, the onStart() method will be called and make enableEdgeToEdge() be called again. This will make it incorrectly use the header height and top padding already adjusted with system inset as the original height and padding, and thus add the inset multiple times.

Creates a flag to only enable edge-to-edge once to fix the issue.

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

PiperOrigin-RevId: 440110562
2022-04-07 11:44:38 -04:00
pekingme
c5284c6ce8 [Tokens] Upgraded to v0.87.
PiperOrigin-RevId: 439670161
2022-04-07 11:15:21 -04:00
pfthomas
ee49c5aa8b [BadgeDrawable][a11y] Attach/detach badge contentDescription when using menuItem.
Resolves https://github.com/material-components/material-components-android/issues/2429

PiperOrigin-RevId: 439651014
2022-04-07 11:11:54 -04:00
raajkumars
df273cd91b [MaterialTextView] Deprecated 4 arg constructor.
Resolves https://github.com/material-components/material-components-android/issues/1397

PiperOrigin-RevId: 439393421
2022-04-06 14:20:53 -04:00
leticiars
f915ffdd8a [ExposedDropdownMenu] Removed update dropdown background call from setInputType as it indirectly calls setRawInputType
PiperOrigin-RevId: 439311647
2022-04-05 15:08:02 -04:00
jeremymuhia
5a0541f851 [TabLayout] tab layout should not ignore focused state ripple color
Resolves: https://github.com/material-components/material-components-android/issues/2434

in sdk >= 21 RippleUtils.convertToRippleDrawable ignores the ColorStateList's focused color. therefore, updating TabLayout to use RippleUtils.sanitizeRippleDrawableColor should fix the bug

PiperOrigin-RevId: 438875412
2022-04-05 13: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
Material Design Team
6fdc114bcd [M3][Colors] Add additional condition to check dynamic color supported devices
PiperOrigin-RevId: 438770498
2022-04-05 12:58:57 -04:00
leticiars
df3a708392 [ExposedDropdownMenu] Fixed android:popupBackground not working in xml/styles for the AutoCompleteTextView.
Before, its value was being overwritten in code where we set the default popup background, so we should null it in the Material styles.

PiperOrigin-RevId: 437813304
2022-03-30 15:12:06 +00:00
jeremymuhia
ffb64c1643 [DatePicker] expand the touch area of a month's days
PiperOrigin-RevId: 437775591
2022-03-30 15:11:10 +00:00
leticiars
784f901135 [TextInputLayout] Fixed regression bug of prefix spacing being shown and making expanded label be in the wrong position when text field is not focused.
Resolves https://github.com/material-components/material-components-android/issues/2612

PiperOrigin-RevId: 437745108
2022-03-28 16:48:28 +00: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
pfthomas
0ba0d6540a [MaterialTimePicker][a11y] Make label important for accessibility
PiperOrigin-RevId: 437326760
2022-03-28 16:46:50 +00:00
hunterstich
0ab2068bac [Motion] Add new motion system duration theming
PiperOrigin-RevId: 436975443
2022-03-28 15:57:30 +00:00
raajkumars
a1ec73beb8 [MaterialDatePicker] Fix for issue that causes the month view not to expand to show all days in a month.
Resolves https://github.com/material-components/material-components-android/issues/1676

PiperOrigin-RevId: 436812359
2022-03-28 15:56:44 +00:00
leticiars
01021a710a [ExposedDropdownMenu][a11y] Fixed bug where setting the AutoCompleteTextView's input type to TYPE_NULL in code would make it unusable in a11y touch mode, as it was still seen as editable for a11y.
Fixed by checking for the input type instead of the key listener (which remains as non null when updating the input type).

PiperOrigin-RevId: 436308197
2022-03-28 15:55:36 +00:00
pfthomas
a51d1dcb68 [MaterialTimePicker][a11y] Update accessibility className used for hour/minute Chips
PiperOrigin-RevId: 436207977
2022-03-21 18:53:24 +00:00
hunterstich
0d91f4ac3b [Motion] Add motion easing xml interpolators and theme attributes.
PiperOrigin-RevId: 435639751
2022-03-18 18:52:15 +00:00
hunterstich
5173944531 [NavigationRailView] Fix bottom padding being applied to top bug
PiperOrigin-RevId: 435636054
2022-03-18 18:51:17 +00:00
conradchen
7c160c86fb [CleanUp][TextField] Create EndIconDelegates in an on-demand fashion
This should slightly improve the text field rendering performance.

PiperOrigin-RevId: 435411420
2022-03-18 18:50:15 +00:00
leticiars
dce4419744 [TextInputLayout][a11y] Fixed text field's focused rect wrong behavior when using a11y magnification.
Before, in requestRectangleOnScreen we were setting the text input layout’s rectangle to a specific and constant position, which caused the zoomed in screen to be fixed to the left instead of following the input text as it was typed. We should use the edit text’s rectangle’s position first, then adjust for the text field’s height (which includes the helper/error text), then use that updated rectangle on the super call of the method.

PiperOrigin-RevId: 435402032
2022-03-17 18:52:42 +00:00
conradchen
6cdf7b5155 [CleanUp][TextField] Extract end components from TextInputLayout
PiperOrigin-RevId: 435390505
2022-03-17 18:51:39 +00:00
pekingme
a878690a93 [Tokens] Upgraded to v0.86.
PiperOrigin-RevId: 435371390
2022-03-17 18:48:53 +00:00
dsn5ft
f69e3a025b [MaterialToolbar] Fixed centering logic when title and subtitle are the same
Resolves https://github.com/material-components/material-components-android/issues/2303

PiperOrigin-RevId: 435348290
2022-03-17 11:41:23 -04:00
dsn5ft
8363cde162 [Color] Deprecate previous apply...() APIs and add overload for activity apply method with no options
PiperOrigin-RevId: 435344858
2022-03-17 11:40:47 -04: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
pfthomas
380778f992 [MaterialTimePicker][a11y] Give more context on hour/minute selection
PiperOrigin-RevId: 435119125
2022-03-16 19:31:02 +00:00
pekingme
ccfc0eecdf [Tokens] Upgraded to v0.79.
PiperOrigin-RevId: 434669243
2022-03-15 19:18:27 +00:00
jeremymuhia
cfc307ed4e [NavigationView] fix navigation view item ripple
PiperOrigin-RevId: 434516655
2022-03-14 18:55:40 +00:00
pekingme
91c25301db [Tokens] Migrated deprecated motion token generated resources.
PiperOrigin-RevId: 434493204
2022-03-14 18:54:01 +00:00
Material Design Team
69121c8b81 [M3][Colors] Add additional condition to check dynamic color supported devices
PiperOrigin-RevId: 434417515
2022-03-14 18:53:07 +00:00
pekingme
6a4fa0b991 [Tokens] Removed deprecated font family resource.
PiperOrigin-RevId: 433793454
2022-03-10 20:04:59 +00:00
Material Design Team
b70bbc2942 [M3][Color] Iteration on HarmonizedColors and DynamicColors feedback
Removed the Context/Application/Activity in the Builders class.
Updated docs accordingly and added examples explaining how harmonizing color attributes with theme overlay works.

PiperOrigin-RevId: 433769484
2022-03-10 20:04:09 +00:00
pekingme
ca8594d2d2 [Slider] Added LABEL_VISIBLE to label behavior and added a demo fragment in catalog.
Resolves https://github.com/material-components/material-components-android/issues/1316

PiperOrigin-RevId: 433570701
2022-03-09 22:14:31 +00:00
pekingme
e7a691e067 [Tokens] Added missing palette token generated resources.
PiperOrigin-RevId: 433519901
2022-03-09 22:13:29 +00:00