Skip to content

Commit

Permalink
Make sure to cache views while filling.
Browse files Browse the repository at this point in the history
  • Loading branch information
TonicArtos committed Mar 3, 2015
1 parent baceea1 commit a395bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/com/tonicartos/superslim/GridSLM.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public int fillToEnd(int leadingEdge, int markerLine, int anchorPosition, Sectio
}

LayoutState.View anchor = state.getView(anchorPosition);
state.cacheView(anchorPosition, anchor.view);
if (anchor.getLayoutParams().getTestedFirstPosition() != sd.firstPosition) {
state.cacheView(anchorPosition, anchor.view);
return markerLine;
}

Expand Down Expand Up @@ -227,9 +227,9 @@ public int fillToStart(int leadingEdge, int markerLine, int anchorPosition, Sect
}

LayoutState.View rowAnchor = state.getView(i);
state.cacheView(i, rowAnchor.view);
LayoutManager.LayoutParams params = rowAnchor.getLayoutParams();
if (params.isHeader || params.getTestedFirstPosition() != sd.firstPosition) {
state.cacheView(i, rowAnchor.view);
break;
}

Expand Down

0 comments on commit a395bd4

Please sign in to comment.