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
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
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
This commit renames ShapePathModel to ShapeAppearanceModel to align with the new shapeAppearance attributes that will be added for shape theming.
PiperOrigin-RevId: 214818189
Anti-aliasing the Paint by default eliminates the appearance of jagged edges and corners.
Anti-aliasing is currently supported by calling setPaintFlags() on MaterialShapeDrawable, but it is not yet enabled by default.
PiperOrigin-RevId: 212709536
Before this change, MaterialShapeDrawable incorrectly handled ColorStateLists. Only the color defined "last" in a ColorStateList was used. This is because MaterialShapeDrawable was not properly updating and handling state changes. This change fixes the issue by updating the tint filter appropriately and overriding some methods which should have been overridden.
PiperOrigin-RevId: 210779870
Before this change, MaterialShapeDrawable did not draw with respect to InsetDrawables. The problem was that MaterialShapeDrawable was using the Canvas to determine where to draw, rather than the bounds. This change reworks MaterialShapeDrawable to use the bounds to calculate and draw the shape's path, rather than the Canvas.
PiperOrigin-RevId: 210724227