Skip to content Skip to sidebar Skip to footer

How To Get Top Item Of Recyclerview On Scroll

Thanks for giving your precious time to read this thread. I am developing an android app where there is recyclerview within recyclerview's item. I want to perform some task when o

Solution 1:

By using two combination of these method you can archive what you needed.

 if (linearLayoutManager1.findFirstVisibleItemPosition() == 0
     && linearLayoutManager1.findFirstCompletelyVisibleItemPosition() == 0) {

    // reach first fully visible item.

}

from op question code snippet..

  1. beware of NullPointerException for linearLayoutManager1, check null
  2. beware of ClassCastException for linearLayoutManager1, check instanceof

Post a Comment for "How To Get Top Item Of Recyclerview On Scroll"