From f2abf614037bb25a4493848c0542895588d3405b Mon Sep 17 00:00:00 2001 From: "huangjun.barney" Date: Fri, 4 Nov 2022 17:30:03 +0800 Subject: [PATCH] bugfix: #614 --- .../com/google/android/flexbox/FlexboxLayoutManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java b/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java index 21ea7338..0b475931 100644 --- a/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java +++ b/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java @@ -1662,7 +1662,7 @@ private int layoutFlexLineMainAxisVertical(FlexLine flexLine, LayoutState layout } childTop += (lp.topMargin + getTopDecorationHeight(view)); - childBottom -= (lp.rightMargin + getBottomDecorationHeight(view)); + childBottom -= (lp.bottomMargin + getBottomDecorationHeight(view)); if (layoutState.mLayoutDirection == LayoutState.LAYOUT_END) { calculateItemDecorationsForChild(view, TEMP_RECT); @@ -1699,9 +1699,9 @@ private int layoutFlexLineMainAxisVertical(FlexLine flexLine, LayoutState layout Math.round(childTop) + view.getMeasuredHeight()); } } - childTop += (view.getMeasuredHeight() + lp.topMargin + getBottomDecorationHeight(view) + childTop += (view.getMeasuredHeight() + lp.bottomMargin + getBottomDecorationHeight(view) + spaceBetweenItem); - childBottom -= (view.getMeasuredHeight() + lp.bottomMargin + + childBottom -= (view.getMeasuredHeight() + lp.topMargin + getTopDecorationHeight(view) + spaceBetweenItem); } layoutState.mFlexLinePosition += mLayoutState.mLayoutDirection;