1657 Commits

Author SHA1 Message Date
dniz
621f8387bd [Motion] Remove boolean entering from MaterialFade constructor and don't set default duration
This makes MaterialFade more consistent with the other transition patterns

PiperOrigin-RevId: 312718402
(cherry picked from commit 1a6ebc0c56e3ed553a64f9f06a9d2fb6b4ec7da3)
2020-05-27 15:12:03 -04:00
raajkumars
783bf3b6b4 Updated UtcDates class in datepicker implementation to allow injection of TimeSource instead of directly using Calendar.getInstance().
PiperOrigin-RevId: 312715093
(cherry picked from commit b546cbd3ed461de45bef3647f03bd16da40ca4da)
2020-05-27 15:12:03 -04:00
dniz
d3086f5865 [Motion] Add more explanation to the MaterialContainerTransform method Javadocs
PiperOrigin-RevId: 312672592
(cherry picked from commit ae6fcf14e7f96e8fe4bb841afa4300a02efd5506)
2020-05-27 15:12:03 -04:00
leticiars
d0f7d490c9 [TextInputLayout] Fixing crash when calling setBoxCornerRadii when edit text hasn't been added yet.
Resolves https://github.com/material-components/material-components-android/issues/1192

PiperOrigin-RevId: 312517954
(cherry picked from commit 8a5c95c7b9c01fcde91d3249b040ab3eeefb662e)
2020-05-27 15:12:03 -04:00
dniz
37c7425c14 [MaterialDatePicker] Make customDatePicker method public but restricted for now
PiperOrigin-RevId: 312495780
(cherry picked from commit 0bdb2cbdbddf160eadfaea422fb1c400e89dc1e3)
2020-05-27 15:12:03 -04:00
dniz
d2b9226b9c [Motion] Update MaterialContainerTransform to use default scrim color constant instead of theme attribute
PiperOrigin-RevId: 312492669
(cherry picked from commit f20a91f98000fd2b699c92ae5eecb211ff6a3d6e)
2020-05-27 15:12:03 -04:00
connieshi
7a6ae3d702 [Slider] Add range and invalid value to IllegalStateException message to make it more clear.
PiperOrigin-RevId: 312474145
(cherry picked from commit e521fda39595e800e4c2d3c70d4d85a7c1796ff1)
2020-05-27 15:12:03 -04:00
Rafael Wolf de Goes
f3597dba97 Automated g4 rollback of changelist 312323243
PiperOrigin-RevId: 312420120
(cherry picked from commit 6455e69ba736b89078d816918b6fc5fb32d2625e)
2020-05-27 15:12:03 -04:00
dniz
a31d5f5977 [MaterialDatePicker] Hide customDatePicker method since DateSelector API is not exposed yet. We will consider exposing this method and the DateSelector APIs in 1.3.
PiperOrigin-RevId: 312332065
(cherry picked from commit d854e78d54c672d24e9d4271da4f5276d87026fa)
2020-05-27 15:12:03 -04:00
Rafael Wolf de Goes
8395be3b87 [MaterialButton] Align icon on top
Resolves https://github.com/material-components/material-components-android/pull/1129

GIT_ORIGIN_REV_ID=8d663b1ca7f7bf62e1e5aa8cfc887a33bdbaf9a2
PiperOrigin-RevId: 312323243

(cherry picked from commit cbc46e9c8d6b6b27d89e8c5635f68f2b9c5df7b6)
2020-05-27 15:12:03 -04:00
dniz
8c8b9557ec [Motion] Improve MaterialContainerTransform exception if start or end view bounds are null
PiperOrigin-RevId: 312273459
(cherry picked from commit ed41b2756fd2af781d9d591fb4067d4b5e046296)
2020-05-27 15:12:03 -04:00
hunterstich
f095b0b782 [Motion] Add support for container transform start and end container colors.
PiperOrigin-RevId: 312152199
(cherry picked from commit e00df6d075d9f99f4fc74f06bb16b76a9a935a86)
2020-05-27 15:12:03 -04:00
leticiars
0631c53409 [TextInputLayout] Fixing end icon having unexpected behaviors when it's switched from another end icon mode.
Resolves https://github.com/material-components/material-components-android/issues/503

PiperOrigin-RevId: 312129467
(cherry picked from commit e315754617193dcf3ad6998b8d26dd08e64ed73a)
2020-05-27 15:08:44 -04:00
marianomartin
afcda0871e Split Slider into two classes
Slider throws an exception when calling getValue with more than one value. Supporting both single value and multiple values in the same class makes it confusing. While not supporting convenience methods getValue and setValue in the multi value class makes it, well, inconvenient.
In addition min, max are also a bit ambiguous since seekBar uses these for valueFrom and valueTo so those were removed.

PiperOrigin-RevId: 311774410
(cherry picked from commit 8f0aa7f8d638aa1368bcd07268433a80d26e4940)
2020-05-27 15:07:51 -04:00
connieshi
37ecf9d6c6 Set Slider to be clickable by default.
Resolves https://github.com/material-components/material-components-android/issues/1121

PiperOrigin-RevId: 311732626
(cherry picked from commit 7d92cd9a4a6f294ad881ed3bd05d4657dfd84ee8)
2020-05-27 15:07:51 -04:00
dniz
df977a06a0 [Motion] Update MaterialContainerTransformSharedElementCallback to support custom shape appearances
PiperOrigin-RevId: 311150643
(cherry picked from commit a5381acf022b91b9c781087fce1b7d9dee86a01e)
2020-05-27 15:07:51 -04:00
connieshi
95a7609159 Prevent content from being clipped by MaterialCardView when a non-round rect is set as the shape.
Caution: content may extend outside shape.

PiperOrigin-RevId: 311135841
(cherry picked from commit d09ac034816a4eb86b49b254f45aed9daa8ca1b6)
2020-05-27 15:07:51 -04:00
connieshi
ac2fce7373 Dispatch button checked after the the button states have been updated and any internal corrections (e.g. singleSelection, selectionRequired) has been made.
Do not dispatch button checked if the button state does not actually change.

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

PiperOrigin-RevId: 310936891
(cherry picked from commit 2d0e00980c9f3f02fa4e755bc668ddb155bc1b67)
2020-05-27 15:07:51 -04:00
hunterstich
aab7100fa9 [Slider] Fix slider tooltip in popupwindows
Slider needs to find an ancestor in which it can add its tooltip overlay. When added in a PopupWindow, its possible to search up the view hierarchy and find a parent which is neither a View nor a ViewGroup. This change adds a check for this case

A note is that this change updates edge cases to return the current parent if it is any valid ancestor instead of just returning null. This allows Slider's tooltip to be added to Popup windows, but doesn't guarantee that the tooltip will be fully visible since a PopupWindow's height might be smaller than the slider + tooltip. If adding a Slider to a PopupWindow, you might need to manually add height to your popup's content view to account for the tooltip or turn of the slider's label.

PiperOrigin-RevId: 310913776
(cherry picked from commit b631ef697984c695e1a16b1017b30f035a7599ce)
2020-05-27 15:07:51 -04:00
connieshi
649d97276c Update content description for badge number that exceeds the max supported badge count to say "More than # new notifications" instead of "# and more notifications".
PiperOrigin-RevId: 310908097
(cherry picked from commit 47f3bbcec646e6e5c25abbc9e275fbad8c38c849)
2020-05-27 15:07:51 -04:00
dniz
fc3664033f [Motion] Update MaterialContainerTransform to support drawing elevation shadows during transition
By default, the elevation shadows are only enabled for API level 28 and above, because Paint shadows are not supported with hardware acceleration below API level 28. If enabled for below API level 28, then the shadows will be drawn using MaterialShapeDrawable, however this may cause performance issues.

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

PiperOrigin-RevId: 310602814
(cherry picked from commit 1094b480809fa4b8c31814b85cd70c0b23fe9dae)
2020-05-27 15:07:51 -04:00
raajkumars
0bbc848813 Fixed issue that causes the Datepicker to highlight wrong the day as today.
Resolves https://github.com/material-components/material-components-android/issues/882

PiperOrigin-RevId: 310565860
(cherry picked from commit d2f81cae5a9ab97f1723711def50908456ae3363)
2020-05-27 15:07:51 -04:00
raajkumars
b62b041094 Renamed Month.today() to Month.current() to make it obvious that this method returns the first moment of the current month and not the first moment of the current day.
PiperOrigin-RevId: 310417056
(cherry picked from commit 2023df01b39679e9c76ba8b85bec4dc73c33bc34)
2020-05-27 14:59:35 -04:00
marianomartin
3767f4841f Make Slider a11y helper a static class
PiperOrigin-RevId: 310251893
(cherry picked from commit 59c156013f7f2401d8331e6b53df13486cba8157)
2020-05-27 14:59:35 -04:00
leticiars
dfcf997638 [Documentation] Updating FABs doc.
Deleting Extended FAB doc as it's now together with regular FAB.

PiperOrigin-RevId: 310161124
(cherry picked from commit 2bc442e3fbcc9708506aa05cbcea1bef7561505d)
2020-05-27 14:59:35 -04:00
Material Design Team
18676fe2de Fix the role description of the GMDC bottom navigation item view's accessibility node.
It was a raw string "Tab", which results in it being never translated. Thus, when Talkback announces the bottom navigation item in other languages, it still announces "Tab" in English.

PiperOrigin-RevId: 310158712
(cherry picked from commit bcaca401c22e11e5ab788f179ee4cb52e02e3b97)
2020-05-27 14:59:35 -04:00
hunterstich
95d9320ae2 [Motion] Fix container transform start delay flash
Switch the container transform to use a transition listener instead of an animator listener. A transition listener calls onTransitionStart as soon as the transition begins where an animator listener calls onAnimatorStart after the transitions delay, if any, casuing an unwanted visual flash of the end view before the animator starts.

PiperOrigin-RevId: 309977033
(cherry picked from commit 6ab9e11a0eb8ffc93338ad72a15adca4152fb020)
2020-05-27 14:59:35 -04:00
dniz
2d3e20f118 [Motion] Remove TransitionValues params from VisibilityAnimatorProvider interface methods
PiperOrigin-RevId: 309763088
(cherry picked from commit 04c93ea5bb1fd5b9a4510329429e3c9cce9f2294)
2020-05-27 14:54:06 -04:00
dniz
b509e5589c [Motion] Refactor MaterialVisibility to use constructor params for primary/secondary instead of abstract getDefault methods
Guarantees that the primary/secondary animator providers are initialized up front, which allows us to simplify the getters/setters to not have an initialization side-effect

PiperOrigin-RevId: 309435463
(cherry picked from commit ae7177d9de9032cb071126dd0d738387034385f3)
2020-05-27 14:52:44 -04:00
dniz
8d9e96c200 Fix MaterialContainerTransform setScrimColor Javadoc error and getDrawingViewId/setDrawingViewId docs typo
PiperOrigin-RevId: 309404225
(cherry picked from commit 119954c881c1099723b52850ecb35041a999a35f)
2020-05-27 14:52:44 -04:00
Anders Kielsholm
680619b256 [MaterialButtonToggleGroup] Single visible button corners
Resolves https://github.com/material-components/material-components-android/pull/1260

GIT_ORIGIN_REV_ID=a5c22101761a8727bb1bdcfad8c16596883f3d93
PiperOrigin-RevId: 309259039

(cherry picked from commit 42126efce8cd0c2dd2c91f0939129642f795e724)
2020-05-27 14:52:44 -04:00
connieshi
62ee273b0f Update badge content description to match badge text displayed (when badge number exceeds max badge number).
Currently, when badge number exceeds max badge number, badge will display max badge number++ e.g. badge number == 1000, badge displays 999+ but content descriptions say "1000 new notifications".
This cl changes the content description to be "999 and more new notifications"

PiperOrigin-RevId: 309219315
(cherry picked from commit eb65ce5b945feb749edc07945b9f66c90e7f69e2)
2020-05-27 14:52:44 -04:00
hunterstich
046296a0db [Motion] Update container transform invalid scrim color logic
PiperOrigin-RevId: 308802757
(cherry picked from commit d3ec2d82dec8d3159b5f5c959b820d6b00f10a83)
2020-05-27 14:52:44 -04:00
hunterstich
cdee36707a [Motion] Replace MaterialVisibility subclass static constructors for standard constructors
PiperOrigin-RevId: 308793749
(cherry picked from commit d025a3b2c3bef53affbeb22c17daed6247755733)
2020-05-27 14:52:44 -04:00
hunterstich
f817305b76 [Motion] Make public transition classes final which are not meant to be subclassed.
PiperOrigin-RevId: 308711224
(cherry picked from commit dc7d3a5d4d902b686578e6180b7f0d2b4f20b938)
2020-05-27 14:52:44 -04:00
hunterstich
0ff76f4224 [Motion] Add getters and setters to MaterialContainerTransform.ProgressThresholds
PiperOrigin-RevId: 308694078
(cherry picked from commit 407193625b129e322c5e72eca981dd507a942731)
2020-05-27 14:52:44 -04:00
hunterstich
5490b0d91f [Motion] Update MaterialVisibility to not need initialize method
- Add initialization check for secondary animator provider in MaterialVisibility so subclasses no longer need to explicitly call MaterialVisibility#initialize.

PiperOrigin-RevId: 308687877
(cherry picked from commit e63cae59fb71b580399ab7479697b5493f7a9dd1)
2020-05-27 14:52:44 -04:00
dniz
e33c6d5067 [Motion] Update transitions to be based on androidx and add transitions platform subpackage to support Activities, Windows, etc.
PiperOrigin-RevId: 308651633
(cherry picked from commit cd36c2f5e77461b26f4723a765e11e6bf16a2a86)
2020-05-27 14:52:44 -04:00
leticiars
7423884cbc [TextInputLayout] Adding setBoxBackgroundColorStateList method and fixing setBoxBackgroundColor method not changing focused and hovered states color like it did originally.
Resolves https://github.com/material-components/material-components-android/issues/1191

PiperOrigin-RevId: 308275897
(cherry picked from commit e5a85a227a946adcf4ae13a279e497d006d81775)
2020-05-27 14:52:44 -04:00
leticiars
008c1996eb [TextInputLayout] Adding setters and getters for boxStrokeWidth and boxStrokeWidthFocused attrs.
PiperOrigin-RevId: 308059511
(cherry picked from commit 167020a5963d3e8be7e36f463bbd93f2b8a0564d)
2020-05-27 14:52:44 -04:00
Frantisek Nagy
76976992f6 [MaterialRadioButton] Fix tint from theme attributes on api 21 + add test
Resolves https://github.com/material-components/material-components-android/issues/1225
Resolves https://github.com/material-components/material-components-android/pull/1226

GIT_ORIGIN_REV_ID=c6202adbe249d8a550113d397b538f3253c1ee06
PiperOrigin-RevId: 307897071

(cherry picked from commit ed48ad90327ca358a32a449fdce914fea31a4c8a)
2020-05-27 14:52:44 -04:00
Nicklas Ansman Giertz
408eb47847 [Motion] Use a private ID resource for the tag ID in MaterialContainerTransform
Resolves https://github.com/material-components/material-components-android/issues/1230
Resolves https://github.com/material-components/material-components-android/pull/1231

GIT_ORIGIN_REV_ID=df1fe9abcd9910302ef0ab97f34153e83a548467
PiperOrigin-RevId: 307895262

(cherry picked from commit 48a6f2892b2d8be68c87e39e6b9b9dd609a7a8b3)
2020-05-27 14:52:44 -04:00
leticiars
36bdb702f5 [TextInputLayout] Flipping password icon behavior so that it shows the action (what's going to happen after the click) instead of the current status.
PiperOrigin-RevId: 307878068
(cherry picked from commit 99c6a28b104b804694a9b3225208cac2bc326c40)
2020-05-27 14:52:44 -04:00
connieshi
50a93de7ca Remove "color" from getters/setters that end with "TintList" to be less verbose.
PiperOrigin-RevId: 307838995
(cherry picked from commit 33683851f2c1bfcda97b4deedf03d13aba9c0b1d)
2020-05-27 14:52:44 -04:00
marianomartin
8d7becdf85 Change ShapeableImageView shape logic to onSizeChanged
PiperOrigin-RevId: 307696728
(cherry picked from commit de111bb53b388272f2e0d5541989a6d49df34be6)
2020-05-27 14:52:44 -04:00
dniz
2a326bdc6f Fix nullability annotations in MaterialContainerTransformSharedElementCallback
PiperOrigin-RevId: 307661071
(cherry picked from commit b8c049658413c12de55c1ce953ca43e43d7a7dbc)
2020-05-27 14:52:44 -04:00
Kirill Olenyov
3738698aba [TextInputLayout] Add click listener for error icon
Resolves https://github.com/material-components/material-components-android/pull/1215

GIT_ORIGIN_REV_ID=f2ae41512162b09c4e37fa727b465970eb83f2b1
PiperOrigin-RevId: 307624385

(cherry picked from commit 1b124afa0264908f1f84b37554c659e2e10bf050)
2020-05-27 14:52:43 -04:00
nickrout
95b89d44c5 [Documentation] Updating FAB javadoc to mention colorSecondary over colorAccent for background tint.
PiperOrigin-RevId: 307612259
(cherry picked from commit 9df47a8548f034139a347beaee33f2ac26f92792)
2020-05-27 14:52:43 -04:00
connieshi
a527fe77f7 Rename color setters in Slider so it's obvious that color properties are ColorStateList.
PiperOrigin-RevId: 307436479
(cherry picked from commit 7a8f3bd48ca60e8b4d08299891420e16de1adbd2)
2020-05-27 14:52:43 -04:00
dniz
c27de091ea Fix Activity container transform unexpected flash and fade
PiperOrigin-RevId: 307090565
(cherry picked from commit 57a8ebdcdd4e64376eac56a2b4c99912d257ccd6)
2020-05-27 14:52:43 -04:00