1521 Commits

Author SHA1 Message Date
Sven Obser
f248f60de3 [CollapsingToolbarLayout] Fixed slight misalignment during transition in multiline mode
Resolves https://github.com/material-components/material-components-android/pull/1408

GIT_ORIGIN_REV_ID=9b29f85a8f9e9c52b256fbb4ce3148e19ee503fc
PiperOrigin-RevId: 317322732

(cherry picked from commit 74508c89c87f3f17db8f952319ccb4daee60a260)
2020-07-15 15:57:05 -04:00
dniz
79cd05741d [Theming] Move Design widget styles back to full themes from Bridge themes
Makes the Bridge themes a more true no-op when migrating from a Theme.AppCompat or Theme.Design theme and using legacy Widget.Design component styles

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

PiperOrigin-RevId: 317306206
(cherry picked from commit 8851f703d86c3d80cae21d3d117fe5a80560297d)
2020-07-15 15:56:02 -04:00
Eugen Pechanec
134c73e6f8 [Slider] Keyboard navigation fix, part 2
Resolves https://github.com/material-components/material-components-android/pull/1395

GIT_ORIGIN_REV_ID=7762807c9e2b58c4156267c04ae9fbb080ed8835
PiperOrigin-RevId: 317126080

(cherry picked from commit a49e8867e95d4134c3d98369a6176b53709c376d)
2020-07-15 15:53:19 -04:00
dniz
2092e2a3c6 [Motion] Updated MaterialElevationScale default scale value to 0.85
PiperOrigin-RevId: 316905583
(cherry picked from commit ef64df5adc09392600b7e2fbfad2a83b344d0015)
2020-07-15 15:52:49 -04:00
marianomartin
f8d0466f64 [Slider] Changed slider to support very small widths
Resolves https://github.com/material-components/material-components-android/issues/1243

PiperOrigin-RevId: 316741418
(cherry picked from commit ba9c2e63ef5692dbfe411684d77eea0ffb7588a2)
2020-07-15 15:52:27 -04:00
dniz
c438a26c11 [Motion] Added MaterialElevationScale transition
Useful as an exit transition and reenter transition in conjunction with MaterialContainerTransform

PiperOrigin-RevId: 316708216
(cherry picked from commit 3379c4598078d290a3927a26be1619456225beb5)
2020-07-15 15:51:42 -04:00
raajkumars
d9b98743e5 [datepicker]Fixed issue that causes the Datepicker to highlight the wrong day as today.
Resolves https://github.com/material-components/material-components-android/issues/882

PiperOrigin-RevId: 315317701
(cherry picked from commit 712a2ce92040b6fc90530ad853633ecd7f258dfc)
2020-07-15 15:50:28 -04:00
leticiars
1b6bb8928a [TextInputLayout] Fixed clear icon and placeholder text being displayed when the text field is initialized with input text.
Resolves https://github.com/material-components/material-components-android/issues/1379

PiperOrigin-RevId: 315317199
(cherry picked from commit 9b0a8d90e6720bc644913564b8f848ccb9fdcac3)
2020-07-15 15:46:30 -04:00
Eugen Pechanec
49d4068a15 [Slider] Keyboard navigation fix
Resolves https://github.com/material-components/material-components-android/pull/1364

GIT_ORIGIN_REV_ID=8a0fb870fafba516db529ffee13ea448964b0a9b
PiperOrigin-RevId: 315302829

(cherry picked from commit 3e3bc41abb49dc3fa1dff63e886da787b592cf2a)
2020-07-15 15:28:58 -04:00
dniz
943234fc84 [Color] Added @color/material_on_surface_stroke to res-public
PiperOrigin-RevId: 314924864
(cherry picked from commit a65dbfc746ca1605be86b4712766cd64519150fd)
2020-07-15 15:26:17 -04:00
connieshi
ed66710595 [MaterialButtonToggleGroup] Do not update the checked state of any child buttons during onPressedChanged callback.
Resolves https://github.com/material-components/material-components-android/issues/1365

PiperOrigin-RevId: 314798502
(cherry picked from commit 15c048c0fa2fdececdab843659856cc47fc3363f)
2020-07-15 15:25:17 -04:00
Yurii Blinov
f5708f780c [MaterialAutoCompleteTextView] NullPointerException on Meizu devices closes #1347
Resolves https://github.com/material-components/material-components-android/pull/1354
Resolves https://github.com/material-components/material-components-android/issues/1347

GIT_ORIGIN_REV_ID=506d9c8197cab69d63c1415237f2e75a0af1b155
PiperOrigin-RevId: 314222991

(cherry picked from commit c59acae371b5139171081cbf07abc5e15af4e890)
2020-07-15 15:21:39 -04:00
Material Design Team
c2addf191b Fix MaterialButton$SavedState ClassNotFoundException
PiperOrigin-RevId: 313512256
(cherry picked from commit 7cfc63ed35262b2f68a241ecc426484860b183ce)
2020-07-15 15:17:28 -04:00
marianomartin
3d8dae52c9 [ShapeableImageView] Improve default style
PiperOrigin-RevId: 313428562
(cherry picked from commit efc0a7f8276b1679ea15bcb058a2c236d18badd2)
2020-05-27 15:14:04 -04:00
marianomartin
549d21452a [ShapeableImageView] Add Shape appearance attributes for consistency and to fix autocomplete
PiperOrigin-RevId: 313414124
(cherry picked from commit 30c7b247542bf8601b0a5159f9a9235633f8bc11)
2020-05-27 15:14:04 -04:00
Ethan Hsu
4518be3b35 [ShapeableImageView] Allow ShapeableImageView to dynamically update shape appearance
In some cases setShapeAppearanceModel will be called after onSizeChanged but before the first draw. This results in the mask being out of date.

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

GIT_ORIGIN_REV_ID=3d99c7857595ff0ba61c1aaa65963909c1950c10

Co-authored-by: ymarian <38727469+ymarian@users.noreply.github.com>
PiperOrigin-RevId: 313402813
(cherry picked from commit 2b676b46a9fa0296edb43eef32cd94b88006cfd5)
2020-05-27 15:14:04 -04:00
dniz
a310f904bb [MaterialDatePicker] Disable positive button when invalid or incomplete dates are selected
Resolves https://github.com/material-components/material-components-android/issues/1270
Resolves https://github.com/material-components/material-components-android/pull/1271

PiperOrigin-RevId: 313390751
(cherry picked from commit 796509884947b903177594960fb703836de50ba3)
2020-05-27 15:14:04 -04:00
marianomartin
2a37868ee3 [ShapeableImageView] Change strokeWidth to float and support null for stroke color
Resolves https://github.com/material-components/material-components-android/issues/1330
Resolves https://github.com/material-components/material-components-android/issues/1331

PiperOrigin-RevId: 313390374
(cherry picked from commit 24f9c0639635e8d3a50dd821fc8eb3a9920dabd2)
2020-05-27 15:14:04 -04:00
connieshi
89f2248bbf Set buttonBarButtonStyle in full Material Component themes to use @style/Widget.MaterialComponents.Button.TextButton.
Fixes regression in elevation demo introduced when MaterialButton added support for the android:background attribute.

PiperOrigin-RevId: 313390366
(cherry picked from commit 68ccc33dad625fd143bd76449e6dae7889075d61)
2020-05-27 15:14:04 -04:00
dniz
45fb9324f3 [MaterialDatePicker] Fix check for date input keyboard separator characters for single selection mode
Pointed out in d6b2da8b50 (r39471904)

PiperOrigin-RevId: 313382685
(cherry picked from commit 67e9eaf3413690856219933b12ad889e1ce1c591)
2020-05-27 15:14:04 -04:00
hunterstich
8b863d32be [Motion] Update ScaleProvider to use growing/shrinking naming. Fix MaterialSharedAxis isForward getter naming.
PiperOrigin-RevId: 313217150
(cherry picked from commit 56b33909ee3651e74120bc89e95af534dc546f1c)
2020-05-27 15:13:12 -04:00
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