Skip to content

Commit ea9d250

Browse files
committed
[Shape] Always skip corner morph animation on bounds change in MaterialShapeDrawable.
PiperOrigin-RevId: 827536893
1 parent a207114 commit ea9d250

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/java/com/google/android/material/shape/MaterialShapeDrawable.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ public CornerSize apply(@NonNull CornerSize cornerSize) {
185185
private boolean shadowBitmapDrawingEnable = true;
186186

187187
// Variables for corner morph.
188-
private boolean boundsIsEmpty = true;
189188
private boolean isRoundRectCornerMorph = true;
190189
@NonNull private ShapeAppearanceModel strokeShapeAppearanceModel;
191190
@Nullable private SpringForce cornerSpringForce;
@@ -1111,10 +1110,9 @@ protected void onBoundsChange(Rect bounds) {
11111110
strokePathDirty = true;
11121111
super.onBoundsChange(bounds);
11131112
if (drawableState.shapeAppearance.isStateful() && !bounds.isEmpty()) {
1114-
// We only want to skip the corner morph animation if this is the first non-empty bounds.
1115-
updateShape(getState(), /* skipAnimation= */ boundsIsEmpty);
1113+
// When bounds change, we want to snap to the new shape without animation.
1114+
updateShape(getState(), /* skipAnimation= */ true);
11161115
}
1117-
boundsIsEmpty = bounds.isEmpty();
11181116
}
11191117

11201118
@Override

0 commit comments

Comments
 (0)