private boolean isWrapRequired(int mode, int maxSize, int currentLength, int childLength,
            LayoutParams lp, int childAbsoluteIndex, int childRelativeIndexInFlexLine) {
        if (mFlexWrap == FLEX_WRAP_NOWRAP) {
            return false;
        }
        if (lp.wrapBefore) {
            return true;
        }
        if (mode == MeasureSpec.UNSPECIFIED) {
            return false;
        }
        if (isMainAxisDirectionHorizontal(mFlexDirection)) {
            if (hasDividerBeforeChildAtAlongMainAxis(childAbsoluteIndex,
                    childRelativeIndexInFlexLine)) {
                childLength += mDividerVerticalWidth;
            }
            if ((mShowDividerVertical & SHOW_DIVIDER_END) > 0) {
                childLength += mDividerVerticalWidth;
            }
        } else {
            if (hasDividerBeforeChildAtAlongMainAxis(childAbsoluteIndex,
                    childRelativeIndexInFlexLine)) {
                childLength += mDividerHorizontalHeight;
            }
            if ((mShowDividerHorizontal & SHOW_DIVIDER_END) > 0) {
                childLength += mDividerHorizontalHeight;
            }
        }
        return maxSize < currentLength + childLength;
    }
Determine if a wrap is required (add a new flex line).

@param mode          the width or height mode along the main axis direction
@param maxSize       the max size along the main axis direction
@param currentLength the accumulated current length
@param childLength   the length of a child view which is to be collected to the flex line
@param lp            the LayoutParams for the view being determined whether a new flex line
                     is needed
@return {@code true} if a wrap is required, {@code false} otherwise
@see #getFlexWrap()
@see #setFlexWrap(int)
common/src/main/java/com/sxjs/common/widget/flexboxlayout/FlexboxLayout.java