When content can be clipped to the shape (round rect, Lollipop+), the content will be clipped to the interior of the stroke.
When preventCornerOverlap is true, if the content cannot be clipped, extra padding is added such that the entirety of the content is inside the stroke. Any contentPadding is additional to this padding. In order to keep centered content centered, the same amount of padding is added in each direction when preventCornerOverlap is true.
PiperOrigin-RevId: 222456398
ShapeAppearanceModel.
Prior to this change, ShapeAppearanceModel#setAllCorners() and
ShapeAppearanceModel#setAllEdges() set all four corners or edges to the same
CornerTreatment or EdgeTreatment. This change creates deep copies for each
corner/edge treatment to avoid bugs caused by silently reusing the mutable
object.
PiperOrigin-RevId: 222413898
Implement Cloneable and override Object#clone() to create deep copies of the corner and edge treatments. The Cloneable method is generally discouraged, but this solution appears to be the most effective solution for our use case because:
- CornerTreatment and EdgeTreatment don't contain mutable fields, so using the native Object#clone() should be fine. This allows us to avoid intervening in the clone() method, which is one of the main reasons to avoid using Obect#clone().
- Since we have to maintain binary compatibility with our 1.0.0 stable release, we have very little wiggle room with which to ensure that we have effective copy() methods in each subclass of CornerTreatment and EdgeTreatment.
PiperOrigin-RevId: 222311453
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
Also clarify the counter description when the limit is not exceeded. Instead of "3/10" it now reads "Characters entered 3 of 10."
Before this change, the counter would read out incorrect character lengths when focused on -- since the live region was set to ACCESSIBILITY_LIVE_REGION_POLITE, it wouldn't be incorrectly read out to the user unless they explored by touch, but if the user were to tap the counter view, it would read out an incorrect character length. This commit fixes that by updating the counter description at the appropriate point when the character count is updated.
PiperOrigin-RevId: 221671905
Update the type within TextInputLayout create color attributes for each element in order to ensure that the colors can be set outside of our typescale. The colors set in those new attributes are intended to be visual no-ops; the goal of this change is not to update the colors.
PiperOrigin-RevId: 219726813
+ Updates LineShadowOperation to call drawEdgeShadow with a horizontal edge
+ ShapePath has a start & end shadow angle and will add shadow arcs to fill in gaps between shadow operations
PiperOrigin-RevId: 219686107