Open taweewong opened 5 years ago
It is an overscroll issue, it happens in horizontal mode too. I think there is some error in the scrollBy
method and, more specifically, in how the end
value is computed (the overscroll seems to be exactly one extra span).
Dear @manfcas,
do you have any news regarding the issue fixing?
I have the latest version 3.0.2
and I faced with the same bug.
Please recommend any suitable workaround if possible.
Thanks in advance, Dmitry
Try to override the scrollBy
method and replace the line:
val end = layoutEnd + rectsHelper.itemSize + paddingEndLayout
with:
var end = 0
for (i in (state.itemCount - 1) downTo 0) {
val rect = childFrames[state.itemCount - 1]
if (rect != null) {
end = rect.right + paddingEndLayout
break
}
}
and the line:
if (scroll + size > end && (firstVisiblePosition + childCount + spans) >= state.itemCount) {
with:
if (end != 0 && scroll + size > end && (firstVisiblePosition + childCount + spans) >= state.itemCount) {
and let me know.
I just try version 3.0.2 when I scroll down to the bottom I found an empty space like this
I also add items at the start to show that empty space is still at the bottom
What I want to ask is, is this normal or I just did something wrong?
Setup layout
MainActivity's layout
Item's layout