14 Commits

Author SHA1 Message Date
pekingme
f46c78cbae [Shape] Moved utility functions for MaterialShapes to MaterialShapes.
PiperOrigin-RevId: 663482774
2024-08-16 17:36:14 +00:00
pekingme
21ba18a4af [Shape] Added Material endorsed shapes.
PiperOrigin-RevId: 663370897
2024-08-16 17:34:51 +00:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -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
cketcham
ab59d93064 Update corner size for builder to use floats
PiperOrigin-RevId: 271428842
2019-09-26 17:57:33 -04:00
cketcham
1538729814 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265057078
2019-08-29 10:28:12 -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
dniz
1f244318d8 Add @hide to all @RestrictTo annotations that are missing it
PiperOrigin-RevId: 243646339
2019-04-19 16:29:30 -04:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
afohrman
a10070b6b3 Unify the creation of default CornerTreatments and EdgeTreatments.
Change the default CornerTreatment created in MaterialShapeUtils from CornerTreatment() to RoundedCornerTreatment(0). This matches the default previously created from ShapeAppearanceModel constructors.

This change unifies the defaults created in ShapeAppearanceModel's constructors with the default created by MaterialShapeUtils, by converging the two default corner and edge treatment creation methods into one method in MaterialShapeUtils. That method is then called from MaterialShapeUtils#createCornerTreatment#createCornerTreatment() and ShapeAppearanceModel's constructors.

This change also renames getDefaultCornerTreatment() to createDefaultCornerTreatment() to convey that the method instantiates an object.

PiperOrigin-RevId: 222269551
2018-12-06 11:15:10 -05:00
cketcham
3de44ca7ac Add shapes theming infrastructure.
Add shapeAppearance and shapeAppearanceOverlay attributes. These attributes combine to support shapes theming. ShapeAppearance is modeled after TextAppearance. A shapeAppearance attribute contains a style reference that is meant to be defined at the theme level. Since changing anything defined in the shapeAppearance would clobber everything else in the ShapeAppearance, the shapeAppearanceOverlay attribute is provided for clients to modify the shapeAppearance.

PiperOrigin-RevId: 215273652
2018-10-02 14:53:40 -04:00
Material Design Team
a681567504 Automated g4 rollback of changelist 215242636
PiperOrigin-RevId: 215260729
2018-10-02 14:52:47 -04:00
cketcham
432b46cc83 Add shapes theming infrastructure.
Add shapeAppearance and shapeAppearanceOverlay attributes. These attributes combine to support shapes theming. ShapeAppearance is modeled after TextAppearance. A shapeAppearance attribute contains a style reference that is meant to be defined at the theme level. Since changing anything defined in the shapeAppearance would clobber everything else in the ShapeAppearance, the shapeAppearanceOverlay attribute is provided for clients to modify the shapeAppearance.

PiperOrigin-RevId: 215242636
2018-10-02 14:21:40 -04:00