Skip to content

Commit 3bb8893

Browse files
committed
itemIsObscuredByHeader() padding fix
1 parent 056196a commit 3bb8893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/main/java/com/timehop/stickyheadersrecyclerview/HeaderPositionCalculator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ private boolean itemIsObscuredByHeader(RecyclerView parent, View item, View head
228228

229229
if (orientation == LinearLayoutManager.VERTICAL) {
230230
int itemTop = item.getTop() - layoutParams.topMargin;
231-
int headerBottom = header.getBottom() + mTempRect1.bottom + mTempRect1.top;
231+
int headerBottom = getListTop(parent) + header.getBottom() + mTempRect1.bottom + mTempRect1.top;
232232
if (itemTop > headerBottom) {
233233
return false;
234234
}
235235
} else {
236236
int itemLeft = item.getLeft() - layoutParams.leftMargin;
237-
int headerRight = header.getRight() + mTempRect1.right + mTempRect1.left;
237+
int headerRight = getListLeft(parent) + header.getRight() + mTempRect1.right + mTempRect1.left;
238238
if (itemLeft > headerRight) {
239239
return false;
240240
}

0 commit comments

Comments
 (0)