I have this code for a RecyclerView.
recyclerView = (RecyclerView)rootview.findViewById(R.id.fabric_recyclerView);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new RV_Item_Spacing(5));
FabricAdapter fabricAdapter=new FabricAdapter(ViewAdsCollection.getFabricAdsDetailsAsArray());
recyclerView.setAdapter(fabricAdapter);
I need to know when the RecyclerView reaches bottom most position while scrolling. Is it possible ? If yes, how ?
Answer is in Kotlin, it will work in Java. IntelliJ should convert it for you if you copy and paste.
This will also work for
LinearLayoutManager
because it has the same methods used above. NamelyfindLastVisibleItemPosition()
andgetItemCount()
(itemCount
in Kotlin).