diff --git a/flexbox/src/main/java/com/google/android/flexbox/FlexboxHelper.java b/flexbox/src/main/java/com/google/android/flexbox/FlexboxHelper.java index e271d8f6..55ba03c4 100644 --- a/flexbox/src/main/java/com/google/android/flexbox/FlexboxHelper.java +++ b/flexbox/src/main/java/com/google/android/flexbox/FlexboxHelper.java @@ -1273,6 +1273,10 @@ private void shrinkFlexItems(int widthMeasureSpec, int heightMeasureSpec, FlexLi if (!mChildrenFrozen[index] && flexItem.getFlexShrink() > 0f) { float rawCalculatedWidth = childMeasuredWidth - unitShrink * flexItem.getFlexShrink(); + if (rawCalculatedWidth < 0) { + // Make sure no negative width when shrinking + rawCalculatedWidth = 0; + } if (i == flexLine.mItemCount - 1) { rawCalculatedWidth += accumulatedRoundError; accumulatedRoundError = 0;