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
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
Creating an additional bitmap affects performance and there are instances where it's not necessary.
Add the option to disable that.
PiperOrigin-RevId: 280434620
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
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
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
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