One of my activities contain a RecyclerView.
On launching the activity, I want to know how many times onBindViewHolder()
would run before user does any scrolling. Using logging, I checked that it runs almost as many times as the number of items visible on the screen. So essentially I want to know how many items are visible on the screen.
getItemCount()
gives the total number of items. This is not what I want.
Is there any other way or method to get only the count of visible items?
I checked this post, but it did not help my case - Get visible items in RecyclerView