From 638f7c9fb38e3c6869f23cebcb4fc7635efc6d24 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 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..febd9c2d 100644 --- a/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java +++ b/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java @@ -749,7 +749,7 @@ public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State int filledToEnd = fill(recycler, state, mLayoutState); if (mAnchorInfo.mLayoutFromEnd) { if (DEBUG) { - Log.d(TAG, String.format("filled: %d toward start", filledToEnd)); +// Log.d(TAG, String.format("filled: %d toward start", filledToEnd)); } startOffset = mLayoutState.mOffset; updateLayoutStateToFillEnd(mAnchorInfo, true, false); @@ -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;