2422 Commits

Author SHA1 Message Date
conradchen
bfce84a27c [Card] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 445180046
2022-04-28 16:25:56 -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
conradchen
46fa8cc45b [SnackBar] Fix margins are added multiple times when show() is called
When a snack bar is hidden and its show() method is called, it will be added to the target parent, and at this moment the parent view will set the layout params to the snack bar, with the same existing margins if any. Therefore if the margins are already updated with extra margins, the original margins will be incorrectly updated. This CL introduces a flag to tells this situation from other "real" scenarios in which clients want to update their custom margins.

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

PiperOrigin-RevId: 445159923
2022-04-28 12:37:45 -04:00
hunterstich
5b50bf13a2 [Transitions] Fix container transform easing mapping.
PiperOrigin-RevId: 444901780
2022-04-27 13:32:37 -04:00
hunterstich
e151b7a8ae [Transitions] Update shared axis, fade through, and fade to use new easing and duration system.
PiperOrigin-RevId: 444897183
2022-04-27 13:31:00 -04:00
dsn5ft
a71781355e [Snackbar] Add shape theming support and update M3 style to use new shapeAppearanceCornerExtraSmall
PiperOrigin-RevId: 444883546
2022-04-27 12:37:04 -04:00
dsn5ft
64bdf9e2b7 [Slider] Add back deleted tooltip shape appearance
PiperOrigin-RevId: 444877713
2022-04-27 12:13:12 -04:00
dsn5ft
391d2b2c34 [MaterialAlertDialog] Update M3 style to use new shapeAppearanceCornerExtraLarge attr
PiperOrigin-RevId: 444852173
2022-04-27 10:23:46 -04:00
hunterstich
f2f454ba8a [Motion] Update container transform to use new motion system.
PiperOrigin-RevId: 444848054
2022-04-27 10:12:54 -04:00
leticiars
0e4e44e8cd [TextInputLayout] Updated shape to use M3 attrs/styles.
PiperOrigin-RevId: 444647020
2022-04-27 10:09:51 -04:00
leticiars
75af80cf46 [Slider] Updated tooltip shape style to use M3 value.
PiperOrigin-RevId: 444643192
2022-04-27 10:07:01 -04:00
conradchen
e3bd856567 [TextField] Fix icon ripples go behind the edit text
On API 21 & 22, the borderless ripple will go behind the container view under certain conditions. Setting a mask when creating the ripple drawable to restrain the ripple inside view bounds somehow solves the issue.

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

PiperOrigin-RevId: 444595599
2022-04-26 14:09:24 -04:00
pubiqq
7109aa4b8b [i18n][Date/Time Picker] Use regular strings instead of @android:string/* which can have translation issues
Resolves https://github.com/material-components/material-components-android/issues/2655
Resolves https://github.com/material-components/material-components-android/pull/2656

PiperOrigin-RevId: 444574063
2022-04-26 12:02:43 -04:00
Material Design Team
714521b4ac [Divider] Fixed extra space when lastItemDecorated = false
Resolves https://github.com/material-components/material-components-android/issues/2511

PiperOrigin-RevId: 444556765
2022-04-26 12:02:02 -04:00
pekingme
921868d31b [BottomSheet] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 443484334
2022-04-25 09:27:33 -04:00
dsn5ft
b62b9a50b0 [Gradle] Update library source and target compatibility to Java 8 and add lambda + method reference usage
PiperOrigin-RevId: 443370295
2022-04-21 16:29:39 -04:00
conradchen
431e291b01 [Translation] Update string translations
PiperOrigin-RevId: 443191056
2022-04-20 17:19:02 -04:00
conradchen
72abed042f [TimePicker] Restore hour/minute selection when switch to text mode
This also opens the keyboard automatically when switching the input mode.

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

PiperOrigin-RevId: 443096864
2022-04-20 14:04:46 -04:00
pfthomas
5b78bf4896 [MaterialTimePicker][a11y] Fix label for hour/minute EditTexts.
PiperOrigin-RevId: 443080572
2022-04-20 13:39:25 -04:00
pekingme
6217aa8581 [Shape] Added theme attributes and styles for new shape appearances.
PiperOrigin-RevId: 442925211
2022-04-20 12:55:55 -04:00
pubiqq
3ca41be8f0 [General] Fix typos
Resolves https://github.com/material-components/material-components-android/pull/2654

GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
conradchen
a0e8c35470 [CleanUp][TextField] Create EndIconDelegate.deactivate() method and remove the relevant listener
PiperOrigin-RevId: 442846789
2022-04-19 13:57:46 -04:00
pfthomas
1ad4682fee Automated g4 rollback of changelist 437775591
PiperOrigin-RevId: 442829220
2022-04-19 12:39:30 -04:00
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