Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
longerian committed Dec 3, 2017
2 parents 54d4285 + 4d7ddf8 commit c7674c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ protected int fill(RecyclerView.Recycler recycler, LayoutState layoutState,
recycleByLayoutStateExpose(recycler, layoutState);
}
int remainingSpace = layoutState.mAvailable + layoutState.mExtra + (
layoutState.mLayoutDirection == LayoutState.LAYOUT_START ? 0 : recycleOffset); //TODO ugly bug fix, should fix overlapOffset first
layoutState.mLayoutDirection == LayoutState.LAYOUT_START ? 0 : recycleOffset); //FIXME opt here to fix bg and shake
while (remainingSpace > 0 && layoutState.hasMore(state)) {
layoutChunkResultCache.resetInternal();
layoutChunk(recycler, state, layoutState, layoutChunkResultCache);
Expand Down Expand Up @@ -1736,12 +1736,11 @@ public boolean assignFromViewIfValid(View child, RecyclerView.State state) {
}

public void assignFromView(View child) {
//TODO fixme coordinate
if (mLayoutFromEnd) {
mCoordinate = mOrientationHelper.getDecoratedEnd(child) + computeAlignOffset(child, mLayoutFromEnd, true) +
mOrientationHelper.getTotalSpaceChange() - ((LayoutParams) child.getLayoutParams()).mOverlapOffset;
mOrientationHelper.getTotalSpaceChange();
} else {
mCoordinate = mOrientationHelper.getDecoratedStart(child) + computeAlignOffset(child, mLayoutFromEnd, true) + ((LayoutParams) child.getLayoutParams()).mOverlapOffset;
mCoordinate = mOrientationHelper.getDecoratedStart(child) + computeAlignOffset(child, mLayoutFromEnd, true);
}

mPosition = getPosition(child);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,6 @@ public static class LayoutParams extends RecyclerView.LayoutParams {

public int zIndex = 0;

public int mOverlapOffset = 0;

public float mAspectRatio = Float.NaN;

private int mOriginWidth = INVALIDE_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state
rangeStyle.mSpanCount - 1) * rangeStyle.mVGap) * 1.0f / rangeStyle.mSpanCount + 0.5f);
}

int maxOverlapOffset = 0;
int count = 0;
int consumedSpanCount = 0;
int remainingSpan = rangeStyle.mSpanCount;
Expand Down Expand Up @@ -466,10 +465,6 @@ public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state
View.MeasureSpec.EXACTLY);
}
final LayoutParams lp = (LayoutParams) view.getLayoutParams();
if (lp.mOverlapOffset > maxOverlapOffset) {
maxOverlapOffset = lp.mOverlapOffset;
}

if (helper.getOrientation() == VERTICAL) {
helper.measureChildWithMargins(view, spec, getMainDirSpec(rangeStyle, lp.height, mTotalSize,
View.MeasureSpec.getSize(spec), lp.mAspectRatio));
Expand Down Expand Up @@ -536,7 +531,7 @@ public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state
}


result.mConsumed = maxSize + startSpace + endSpace + secondStartSpace + secondEndSpace - maxOverlapOffset; //FIXME conflicts when layout to start
result.mConsumed = maxSize + startSpace + endSpace + secondStartSpace + secondEndSpace;

final boolean layoutStart = layoutState.getLayoutDirection() == LayoutStateWrapper.LAYOUT_START;
int consumedGap = 0;
Expand Down Expand Up @@ -625,18 +620,18 @@ public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state
int left = 0, right = 0, top = 0, bottom = 0;
if (layoutInVertical) {
if (layoutStart) {
bottom = layoutState.getOffset() - endSpace - secondEndSpace - (consumedGap) - lastUnconsumedSpace - maxOverlapOffset; //FIXME should minus maxOverlapOffset
bottom = layoutState.getOffset() - endSpace - secondEndSpace - (consumedGap) - lastUnconsumedSpace;
top = bottom - maxSize;
} else {
top = layoutState.getOffset() + startSpace + secondStartSpace + (consumedGap) + lastUnconsumedSpace - maxOverlapOffset;
top = layoutState.getOffset() + startSpace + secondStartSpace + (consumedGap) + lastUnconsumedSpace;
bottom = top + maxSize;
}
} else {
if (layoutStart) {
right = layoutState.getOffset() - endSpace - (consumedGap) - lastUnconsumedSpace + maxOverlapOffset;
right = layoutState.getOffset() - endSpace - (consumedGap) - lastUnconsumedSpace;
left = right - maxSize;
} else {
left = layoutState.getOffset() + startSpace + (consumedGap) + lastUnconsumedSpace - maxOverlapOffset;
left = layoutState.getOffset() + startSpace + (consumedGap) + lastUnconsumedSpace;
right = left + maxSize;
}
}
Expand Down

0 comments on commit c7674c1

Please sign in to comment.