disable pre-layout when layout to start temp

This commit is contained in:
longerian
2017-10-10 20:03:57 +08:00
parent 457a8698f2
commit 0c4edc4eef
2 changed files with 4 additions and 3 deletions
@@ -1153,7 +1153,8 @@ class ExposeLinearLayoutManagerEx extends LinearLayoutManager {
}
recycleByLayoutStateExpose(recycler, layoutState);
}
int remainingSpace = layoutState.mAvailable + layoutState.mExtra + recycleOffset;
int remainingSpace = layoutState.mAvailable + layoutState.mExtra + (
layoutState.mLayoutDirection == LayoutState.LAYOUT_START ? 0 : recycleOffset); //TODO ugly bug fix, should fix overlapOffset first
while (remainingSpace > 0 && layoutState.hasMore(state)) {
layoutChunkResultCache.resetInternal();
layoutChunk(recycler, state, layoutState, layoutChunkResultCache);
@@ -536,7 +536,7 @@ public class RangeGridLayoutHelper extends BaseLayoutHelper {
}
result.mConsumed = maxSize + startSpace + endSpace + secondStartSpace + secondEndSpace - maxOverlapOffset;
result.mConsumed = maxSize + startSpace + endSpace + secondStartSpace + secondEndSpace - maxOverlapOffset; //FIXME conflicts when layout to start
final boolean layoutStart = layoutState.getLayoutDirection() == LayoutStateWrapper.LAYOUT_START;
int consumedGap = 0;
@@ -625,7 +625,7 @@ public class RangeGridLayoutHelper extends BaseLayoutHelper {
int left = 0, right = 0, top = 0, bottom = 0;
if (layoutInVertical) {
if (layoutStart) {
bottom = layoutState.getOffset() - endSpace - secondEndSpace - (consumedGap) - lastUnconsumedSpace + maxOverlapOffset;
bottom = layoutState.getOffset() - endSpace - secondEndSpace - (consumedGap) - lastUnconsumedSpace + maxOverlapOffset; //FIXME should minus maxOverlapOffset
top = bottom - maxSize;
} else {
top = layoutState.getOffset() + startSpace + secondStartSpace + (consumedGap) + lastUnconsumedSpace - maxOverlapOffset;