143 Commits

Author SHA1 Message Date
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
cketcham
a130a0c3e0 Add support for percentages to ShapeAppearanceModel
PiperOrigin-RevId: 272946740
2019-10-04 16:33:47 -04:00
cketcham
0547d2a06b Uncouple CornerSize from CornerTreatment
This allows for more easily updating the CornerSize independently from the CornerTreatment and makes it possible to create different types of CornerSizes such as percentage based corners. However, this means corner sizes can be different depending on the bounds of the shape, so the bounds need to be provided. MaterialShapeDrawable has bounds and the ShapeAppearanceModel, so there are new convenience methods there which return the current corner size for the current bounds of the drawable.

PiperOrigin-RevId: 272908508
2019-10-04 15:23:16 -04:00
ldjesper
17ff72c69a Remove deprecated getPathForSize not in any stable release
PiperOrigin-RevId: 272877489
2019-10-04 11:28:25 -04:00
ldjesper
5afdf00f80 Remove deprecated method not present in stable MaterialShapeDrawable#getStrokeTint
PiperOrigin-RevId: 272741709
2019-10-03 19:40:24 -04:00
marianomartin
4f8bc435c4 Fix binary compatibility issues with MaterialShapeDrawable
These methods existed in 1.0.0 so they can't be removed.

PiperOrigin-RevId: 272665301
2019-10-03 11:44:57 -04:00
afohrman
5592c1b74e Optimize MaterialShapeDrawable's RectF usages.
PiperOrigin-RevId: 271588528
2019-09-27 14:06:30 -04:00
cketcham
ab59d93064 Update corner size for builder to use floats
PiperOrigin-RevId: 271428842
2019-09-26 17:57:33 -04:00
afohrman
f6a67eb9f6 Fix issues with javadocs.
PiperOrigin-RevId: 269825611
2019-09-18 14:24:31 -04:00
cketcham
d993425201 Update ShapeAppearanceModel javadoc to correctly specify that an instance is returned, not the builder.
PiperOrigin-RevId: 269363772
2019-09-18 14:16:09 -04:00
cketcham
5c384c3804 Add space to the bitmap for drawing shadows to prevent clipping
PiperOrigin-RevId: 268449384
2019-09-12 14:04:45 -04:00
marianomartin
215a839598 Internal cleanup
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
cketcham
f52407e1e3 Make cornerSize a private field
PiperOrigin-RevId: 266924741
2019-09-04 18:04:37 -04:00
cketcham
fb272f84b4 Remove cloneable from corner treatments since ShapeAppearance and CornerTreatments are now immutable
PiperOrigin-RevId: 266422300
2019-09-04 18:00:22 -04:00
cketcham
27b58f1611 Make ShapeAppearanceModel immutable
PiperOrigin-RevId: 266378228
2019-09-04 14:20:35 -04:00
cketcham
7bb525ff59 Update usages of ShapeAppearanceModel to use Builder pattern
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
cketcham
ca91442ba2 Add builder to ShapeAppearanceModel
PiperOrigin-RevId: 265806696
2019-08-29 12:21:55 -04:00
marianomartin
f5c9026efa Internal cleanup
PiperOrigin-RevId: 265550877
2019-08-29 11:39:58 -04:00
cketcham
1538729814 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265057078
2019-08-29 10:28:12 -04:00
afohrman
7241e7181f Hide CornerFamily documentation and restrict the annotation.
PiperOrigin-RevId: 260144206
2019-07-29 16:39:19 -04:00
ldjesper
ec856cdeae Deprecate fields from the public API of ShapePath
PiperOrigin-RevId: 259830158
2019-07-25 13:13:11 -04:00
dniz
cc73c2a630 Update TODOs
PiperOrigin-RevId: 259535844
2019-07-23 11:21:39 -04:00
dniz
0512f776c5 Remove sub-package AndroidManifest.xml files from lib directory
PiperOrigin-RevId: 258390736
2019-07-16 13:18:32 -04:00
isabellekim
a628bf516b Revert the library to compile with Java 7: revert lambdas, add necessary casts, and make some variables final.
Continue compile shrine demo, catalog, and tests with Java 8.

PiperOrigin-RevId: 257874888
2019-07-15 19:19:23 -04:00
marianomartin
164bf0fabd Internal cleanup
PiperOrigin-RevId: 255609320
2019-07-03 14:02:53 -04:00
dniz
5df3bebd63 Update elevation overlays to be based absolute elevation, factoring in the elevation of all parent views
Will follow-up with TabLayout absolute elevation separately

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

PiperOrigin-RevId: 255404830
2019-07-03 13:55:49 -04:00
isabellekim
36b760d220 Change ripples on MaterialButton to use the alphas provided in the ColorStateList.
RippleDrawable on different API levels will modulate the alphas differently
for the pressed / focused / hovered states. Therefore, in order to get the
desired alphas for pressed / focused / hovered states, we are using the
mtrl_(low|high)_ripple_(pressed|focused|hovered|default)_alpha values which have
been defined to account for the different implementations of RippleDrawable.

This will allow developers to specify different colors for focused vs. pressed if desired.

PiperOrigin-RevId: 255306749
2019-07-03 13:50:29 -04:00
marianomartin
1c5df57127 Make ShapeAppearancePathProvider not restricted
PiperOrigin-RevId: 254229963
2019-06-24 17:03:52 -04:00
dniz
91f292432f Rename MaterialShapeDrawable internal elevation overlay util method
PiperOrigin-RevId: 253794203
2019-06-18 13:56:22 -04:00
marianomartin
53e4e9cca8 Internal cleanup
PiperOrigin-RevId: 253624674
2019-06-18 13:43:33 -04:00
dniz
6783f9e1cd Clean up naming of elevation overlay methods and attributes
PiperOrigin-RevId: 253283047
2019-06-18 13:34:29 -04:00