linisme / SlimAdapter

A slim & clean & typeable Adapter without# VIEWHOLDER
https://raw.githubusercontent.com/MEiDIK/SlimAdapter/master/SlimAdapter.jpg
MIT License
931 stars 117 forks source link

SlimMoreLoader ArrayIndexOutOfBoundsException: length=0; index=-1 #23

Closed jkyeo closed 7 years ago

jkyeo commented 7 years ago

In SlimMoreLoader::onScrollStateChanged() method. In some case, it cased ArrayIndexOutOfBoundsException: length=0; index=-1.

Well, it comes from findLastCompletelyVisibleItemPosition return -1 ---> getItem(-1).

The adapter position of the last fully visible view or NO_POSITION if there aren't any visible items. int NO_POSITION Constant Value: -1 (0xffffffff)

This case happens when the item is height enough to no one completely visible on the screen.

jkyeo commented 7 years ago

Looking forward to version update on maven. 👍