173 Commits

Author SHA1 Message Date
pekingme
ecb6284a8b [Shape] Fixed overlapping of compat shadow of inner corners.
Resolves https://github.com/material-components/material-components-android/issues/1388

PiperOrigin-RevId: 454893622
2022-06-14 10:21:03 -07:00
pekingme
d0c3ea0eb5 [Tokens] Upgraded token resources to v0.99.
PiperOrigin-RevId: 452574141
2022-06-02 15:41:39 -07:00
pekingme
c3406dc3ab [Tokens] Upgrade resources to v0.95.
PiperOrigin-RevId: 449840889
2022-05-20 15:19:31 -04:00
pekingme
a1e83052d9 [Tokens] Regenerated token resources with <macro> type.
PiperOrigin-RevId: 449829080
2022-05-20 15:18:57 -04:00
conradchen
3fa48d4cd5 [Shape] Workaround the issue that Context.obtainStyledAttributes() doesn't handle @macro properly
Somehow Context.obtainStyledAttributes() with a provided style resource crashes if some attributes in the style are resolved to be macros. Using ContextThemeWrapper to wrap the context with the style doesn't have this issue. Workarounds this by always wrapping the context to retrieve attributes.

PiperOrigin-RevId: 445451176
2022-04-29 14:50:17 -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
pekingme
c5284c6ce8 [Tokens] Upgraded to v0.87.
PiperOrigin-RevId: 439670161
2022-04-07 11:15:21 -04:00
pekingme
a878690a93 [Tokens] Upgraded to v0.86.
PiperOrigin-RevId: 435371390
2022-03-17 18:48:53 +00:00
pekingme
ccfc0eecdf [Tokens] Upgraded to v0.79.
PiperOrigin-RevId: 434669243
2022-03-15 19:18:27 +00:00
pekingme
a5b78e659c [Tokens] Added new shape appearance styles.
PiperOrigin-RevId: 433486068
2022-03-09 22:12:26 +00:00
pekingme
37fcd242bd [Tokens][Cleanup] Better ordering in the output.
PiperOrigin-RevId: 430479085
2022-02-23 11:23:09 -08:00
pekingme
64c6d047a9 [Tokens] Updated copyright year.
PiperOrigin-RevId: 427833895
2022-02-11 15:47:03 +00:00
pekingme
e721c468c2 [Tokens] Updated atomic shape resources to ShapeAppearance styles.
PiperOrigin-RevId: 426466909
2022-02-04 13:48:13 -08:00
pekingme
53863287d6 [Tokens] Re-upgraded to v0.73.
PiperOrigin-RevId: 424635556
2022-01-27 09:54:21 -08:00
pekingme
d0e0d9404d [Tokens] Downgraded token resources to v0.71.
PiperOrigin-RevId: 421954490
2022-01-18 12:04:57 -05:00
pekingme
4527272319 [Tokens] Upgraded token resources to v0.73.
PiperOrigin-RevId: 420329292
2022-01-12 11:18:41 -05:00
pekingme
4de8565634 [Tokens] Upgrade M3 token resources to v0.71
PiperOrigin-RevId: 420319663
2022-01-12 11:16:06 -05:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Andre\u0301 Wachter
5ff917dc5f [MaterialShapeDrawable] Implement getAlpha()
Resolves https://github.com/material-components/material-components-android/pull/2479

GIT_ORIGIN_REV_ID=20d18f9732871b06aa9f95af0bd02f23b3e7995a
PiperOrigin-RevId: 412092198
2021-11-29 17:31:06 +00:00
pekingme
c1f7dfc314 [Tokens] Updated resources to v0.54.
PiperOrigin-RevId: 402383462
2021-10-12 11:39:48 -04:00
conradchen
79ae9b1351 [TextInputLayout] Create label cutout only on borders
When a collapsed label is showing, we cutout part of the border of an outlined text input box according to the exact stroke width. However when using rounded corners, there can be slight offsets from where the border is really drawn. Also, if the corner size is large, the part of border we need to cutout might not just be a straight line but contains part of the corner.

However, with the existing cutout logic, we cannot just cutout the whole label area, which will cause the area inside the border also gets cutout, if it has color. This CL changes the cutout drawing logic to only apply the cutout on stroke drawing to fix the issue.

This CL also fixes the bug that when the label is too long, we didn't take the ellipsized text length into account. Creates a variable to store the calculated collapsed text width to fix the issue.

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

PiperOrigin-RevId: 402316057
2021-10-12 11:26:21 -04:00
pekingme
9c93dcd626 [M3][Tokens] Update resources to v0.47.
PiperOrigin-RevId: 397066722
2021-09-20 09:31:04 -07:00
dsn5ft
ec591e5420 [MaterialShapeDrawable] Open access to getResolvedTintColor() method
PiperOrigin-RevId: 396585644
2021-09-16 11:37:52 -07:00
dsn5ft
96f41cb9a5 [M3][Shape] Update Shape dev docs with M3 themes/styles
PiperOrigin-RevId: 395703463
2021-09-15 12:21:33 -07:00
pekingme
585fd8df89 [M3][Tokens] Integrated shape resources.
PiperOrigin-RevId: 392530797
2021-08-24 15:44:16 -04:00
conradchen
edbc4e1f64 [M3][Textfield] Create M3 styles
PiperOrigin-RevId: 391773145
2021-08-23 09:22:14 -07:00
dsn5ft
3008d782e7 [AppBarLayout] Added listener for when lift on scroll background elevation and color change
PiperOrigin-RevId: 386243658
2021-07-28 14:26:55 -04:00
conradchen
b8c9f4949d [MaterialShapeDrawable] Move static paint initialization to static block
PiperOrigin-RevId: 374650659
2021-05-19 10:59:31 -07:00
connieshi
6951bd5179 [Chip] Support elevation overlay.
Resolves https://github.com/material-components/material-components-android/issues/1749

PiperOrigin-RevId: 336930100
2020-10-15 13:21:17 -07:00
marianomartin
edbfd15c82 [MaterialShapeDrawables] Fixed compat shadows after ShapePathProvider change
PiperOrigin-RevId: 325797837
2020-08-10 13:20:07 -04:00
marianomartin
c59c04639c [MaterialShapeDrawable] Convert ShapeAppearancePathProvider to a singleton.
Also allocate less path objects.

PiperOrigin-RevId: 325287653
2020-08-06 21:10:36 -04:00
marianomartin
049ad022a6 Delete components build.gradle files
PiperOrigin-RevId: 320944144
2020-07-15 09:38:31 -07:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
marianomartin
b5533eae6b Swallow exception setting convex path in MaterialShapeDrawable for pre releases of Q
PiperOrigin-RevId: 306874530
2020-04-17 15:17:21 -04:00
Material Design Team
e802ecaa36 Add documentation to clarify percent units.
Otherwise it's pretty ambiguous, a percent logically is out of 100 but this unit is actually a fraction of the height intended to be in range 0-1.

PiperOrigin-RevId: 306281351
2020-04-14 21:37:46 -04:00
marianomartin
841fae9258 Fix javadocs issues in Shape package
PiperOrigin-RevId: 300547341
2020-03-13 10:57:59 -04:00
marianomartin
8e8d20c94f Fix interpolation for MSD round rects
PiperOrigin-RevId: 296281750
2020-02-20 16:35:56 -05:00
cketcham
b5c3fecacc Add warning to ShapePath when an operation is being used in a situation where a compatibility shadow would normally be drawn
PiperOrigin-RevId: 295847026
2020-02-19 10:52:22 -05:00
cketcham
9c3701a7cf Add ShapePath#cubicToPoint()
Resolves https://github.com/material-components/material-components-android/issues/924

PiperOrigin-RevId: 295775205
2020-02-18 16:53:15 -05:00
cketcham
1e1100f6a9 Clarify ShapePath#quadToPoint() will only draw native shadows
PiperOrigin-RevId: 295755346
2020-02-18 16:47:00 -05:00
Material Design Team
5a396edbb6 Always use padding in drawable state so that it can survive newDrawable()
Previously padding was set to both drawableState.padding and this.padding, but only retrieved from this.padding, which results in lost padding after newDrawable() and makes drawableState.padding useless.

PiperOrigin-RevId: 293878104
2020-02-10 09:59:00 -05:00
cketcham
6e340c49d4 Fix BottomAppBarTopEdgeTreatment bug caused by large negative vertical offset
While some small negative values for vertical offset do work, this use case is currently not supported. Most negative values result in the cutout being drawn incorrectly. This also adds a new exception to help clarify the crash in the future.

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

PiperOrigin-RevId: 292148159
2020-01-29 16:15:04 -05:00
marianomartin
1aef5b9a9e [ImageView] Add catalog ImageView demo
PiperOrigin-RevId: 285279245
2019-12-13 17:30:43 -05:00
cketcham
5f4a1394e5 Add OffsetEdgeTreatment
PiperOrigin-RevId: 281991688
2019-11-22 21:45:35 +00:00
marianomartin
bb1e9e47a4 Enable non convex shadows on Q
PiperOrigin-RevId: 281750600
2019-11-22 21:24:52 +00:00
cketcham
8ed1484690 Update MaterialShapeDrawable to handle overlapping edge and corners
PiperOrigin-RevId: 281498365
2019-11-20 14:39:06 -05:00
marianomartin
7eb1af5f8e Support disabling bitmap drawing in MaterialShapeDrawable
Creating an additional bitmap affects performance and there are instances where it's not necessary.

Add the option to disable that.

PiperOrigin-RevId: 280434620
2019-11-15 15:09:41 -05:00
dniz
ab54c23e9b Fix MaterialShapeDrawable stroke corner bug
PiperOrigin-RevId: 272977992
2019-10-04 20:09:24 -04:00
ldjesper
294f12498d Rename setCornerRadius to setAllCornerSizes
PiperOrigin-RevId: 272959729
2019-10-04 20:08:43 -04:00