afohrman
ca07e5f616
Create OnChangedListener to respond to ShapeAppearanceModel changes and Shapeable interface, and implement it in Chip.
...
The OnChangedListener provides a callback that MaterialShapeDrawables can use to invalidate themselves when the associated ShapeAppearanceModel changes. This allows for modifying the ShapeAppearanceModel through the get/setShapeAppearance methods that the Shapeable interface exposes without having to update the client to redraw itself.
PiperOrigin-RevId: 238703600
2019-03-22 16:16:23 -04:00
dniz
6adba8f93b
Fix MaterialShapeDrawable to work with ColorStateLists for fill and stroke tint
...
and paint
PiperOrigin-RevId: 238478987
2019-03-22 16:09:16 -04:00
dniz
7b594393c8
Dark Theme Elevation Overlay system
...
PiperOrigin-RevId: 237829773
2019-03-22 16:02:26 -04:00
marianomartin
01874ad4e9
Change setElevation in MSD to use default offset
...
PiperOrigin-RevId: 236858323
2019-03-08 09:58:58 -05:00
dniz
c0de00cdac
Fix MaterialShapeDrawable bug that causes compat shadows to be drawn for round rects on lollipop+
...
PiperOrigin-RevId: 235786787
2019-02-27 18:00:21 -05:00
dniz
03cf027bc7
Deprecate Experimental annotation and remove from Shapes
...
PiperOrigin-RevId: 229200655
2019-01-18 14:10:16 -05:00
dniz
a4964594a1
Add MaterialShapeDrawable setElevation(float) and deprecate setShadowElevation(int)
...
PiperOrigin-RevId: 228572421
2019-01-10 17:16:43 -05:00
marianomartin
c4f014b192
Add back getPathForSize(int int, Path) to MaterialShapeDrawable.
...
PiperOrigin-RevId: 227901559
2019-01-10 16:27:32 -05:00
afohrman
db4c951c0c
Add annotations to hide protected MaterialShapeDrawable#drawShape() method.
...
MaterialShapeDrawable#drawShape() is protected, so it shouldn't be visible outside of the library group. This commit also adds documentation, since this method is protected.
PiperOrigin-RevId: 227696166
2019-01-10 16:01:24 -05:00
cketcham
dc72aaeed4
Migrate Gradle build and sources to androidx
...
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
marianomartin
cf69538c9c
Refactor path logic out of MSD
...
PiperOrigin-RevId: 224182175
2018-12-06 12:05:06 -05:00
marianomartin
61f426afca
Remove (get/set)PaintFlags from MSD
...
PiperOrigin-RevId: 224162294
2018-12-06 12:04:30 -05:00
cketcham
7a2c2823ee
Only recalculate the path if it has changed
...
PiperOrigin-RevId: 223826749
2018-12-06 11:47:06 -05:00
marianomartin
d75fb6513c
Fix constant state in MSD
...
PiperOrigin-RevId: 223802087
2018-12-06 11:46:29 -05:00
Material Design Team
f152b75e1a
Automated g4 rollback of changelist 223558824
...
PiperOrigin-RevId: 223564801
2018-12-06 11:43:02 -05:00
marianomartin
c75482b473
Fix constant state in MSD
...
PiperOrigin-RevId: 223558824
2018-12-06 11:42:42 -05:00
marianomartin
bf024ebed9
Remove stroke shader from MSD
...
PiperOrigin-RevId: 223397575
2018-12-06 11:38:24 -05:00
marianomartin
3bf777db8a
Implement Mutate in MaterialShapeDrawable
...
PiperOrigin-RevId: 223059565
2018-12-06 11:31:50 -05:00
cketcham
95cf55f04b
Remove option to use paint shadow
...
PiperOrigin-RevId: 223017988
2018-12-06 11:25:01 -05:00
cketcham
ab61f4c50a
Restrict access to setting the vertical offset for the shadow.
...
I think we may want to remove these methods in the future and just handle this automatically.
PiperOrigin-RevId: 220944239
2018-11-16 11:19:10 -05:00
cketcham
3d8e2b408c
Stop expanding the clip rect on versions of android that have native shadow support
...
PiperOrigin-RevId: 219478262
2018-11-01 16:17:19 -07:00
isabellekim
e9a8d48f60
Fixes MaterialShadowDrawable shadow to respect bounds that don't start at (0,0)
...
PiperOrigin-RevId: 219367777
2018-11-01 16:15:40 -07:00
cketcham
22cd4dba4f
Prevent invalidating MaterialShapeDrawable if parameters haven't changed
...
PiperOrigin-RevId: 219319784
2018-11-01 16:13:36 -07:00
afohrman
a25e13ca39
Update isStateful() method in MaterialShapeDrawable.
...
isStateful() should include the statefulness of the fill and stroke colors.
PiperOrigin-RevId: 219310584
2018-11-01 16:11:35 -07:00
afohrman
ed37888efe
Remove MaterialShapeDrawable hairline inset from fill bounds.
...
PiperOrigin-RevId: 219303758
2018-11-01 16:09:21 -07:00
connieshi
d9d9b6e1ef
Change scope of #getFillBounds to protected so children can override it.
...
PiperOrigin-RevId: 219227988
2018-11-01 16:08:38 -07:00
connieshi
0f764e9a15
Change scope of #getBoundsAsRectF and #drawShape to be protected so the children of MSD could call them.
...
PiperOrigin-RevId: 219189920
2018-11-01 16:08:10 -07:00
afohrman
38ef896da2
Adjust corners of MaterialShapeDrawable's stroke to draw the stroke perfectly over the fill.
...
To draw the stroke with the correct corner radius, MaterialShapeDrawable now calculates what the corner radius should be and adjusts the stroke accordingly.
Before this change, the corner radius was calculated such that the stroke didn't fully reach the edges of the shape. This change tweaks the corner radius calculation so that the stroke's path matches the fill's path and is overlaid directly on top of the fill's shape.
PiperOrigin-RevId: 219139586
2018-11-01 16:04:35 -07:00
cketcham
3bc7afd292
Disable native shadows when compat shadows are always drawn.
...
PiperOrigin-RevId: 219134990
2018-11-01 16:04:08 -07:00
afohrman
52eb143e99
Optimize stroke inset bounds method.
...
Use RectF#inset() instead of manually insetting the stroke by half of the stroke width.
PiperOrigin-RevId: 218887035
2018-10-28 21:47:13 -04:00
cketcham
560c982284
Enable shadows for BottomAppBar
...
PiperOrigin-RevId: 218868156
2018-10-28 21:44:27 -04:00
cketcham
ab1992a2ba
Fix shadow rendering and add shadow rotation angle for MaterialShapeDrawable
...
PiperOrigin-RevId: 218576270
2018-10-28 19:13:20 -04:00
marianomartin
e192fbe3e0
Use round rect when possible in MSD
...
PiperOrigin-RevId: 218559377
2018-10-28 19:12:46 -04:00
afohrman
ccf98970c2
Add methods to get and set stroke and fill paint colors.
...
Also refactor some of the stroke methods, since stroke was using the tint rather than the color to color the stroke.
PiperOrigin-RevId: 218383900
2018-10-28 18:34:50 -04:00
cketcham
530100e574
Add modes to control compat shadows for MaterialShapeDrawable
...
PiperOrigin-RevId: 217861830
2018-10-28 18:32:26 -04:00
cketcham
2edfef1a6c
Draw compatibility shadows if the shape is concave or native shadows aren't supported.
...
PiperOrigin-RevId: 217689320
2018-10-28 18:28:35 -04:00
gauthams
17ffd91b6c
Add cornerRadius setter to MaterialShapeDrawable.
...
PiperOrigin-RevId: 217643698
2018-10-28 18:28:07 -04:00
gauthams
6abaa62d56
Update MaterialShapeDrawable to return dummy ConstantState.
...
PiperOrigin-RevId: 217412761
2018-10-28 18:24:30 -04:00
marianomartin
169ac3f142
Add ability to set shader on border paint for MSD
...
PiperOrigin-RevId: 216709276
2018-10-11 18:30:54 -04:00
dniz
f16d0e1a8e
Add back getPathForSize() method to MaterialShapeDrawable to preserve API
...
PiperOrigin-RevId: 215956091
2018-10-11 18:06:02 -04: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
cketcham
8bd94e9276
Rename ShapePathModel to ShapeAppearanceModel.
...
This commit renames ShapePathModel to ShapeAppearanceModel to align with the new shapeAppearance attributes that will be added for shape theming.
PiperOrigin-RevId: 214818189
2018-09-28 16:30:13 -04:00
cketcham
c6a08a4b68
Allow for centering on EdgeTreatments
...
PiperOrigin-RevId: 214613004
2018-09-28 16:28:45 -04:00
cketcham
0527fe7d09
Fix MaterialShapeDrawable path so it is correctly convex on API 21 and 22
...
PiperOrigin-RevId: 214461440
2018-09-28 16:28:01 -04:00
ldjesper
5df0d8b760
Fix draw bounds for MaterialShapeDrawable stroke and fill
...
PiperOrigin-RevId: 213877586
2018-09-28 16:12:57 -04:00
ldjesper
03edbf3d5f
Switch MaterialShapeDrawable to RectF
...
PiperOrigin-RevId: 213872653
2018-09-28 16:12:36 -04:00
ldjesper
20bbf1523b
Improvements to readability and javadoc of MaterialShapeDrawable
...
PiperOrigin-RevId: 212875571
2018-09-14 11:04:01 -04:00
ldjesper
f79c91e53e
Allow different stroke and fill colors for MaterialShapeDrawable
...
PiperOrigin-RevId: 212857049
2018-09-14 11:03:07 -04:00