I have a screen where items/cells are designed in the 2x2 grid form. What I want to do is I want to fire APIs on item visibility/impression when RecyclerView
scrolls up/down.
As my list is pretty huge
For example scenario is,
This way I want to complete traversal of the entire list and call API on newly found items.
What I tried is,
int findFirstVisibleItemPosition();
int findFirstCompletelyVisibleItemPosition();
int findLastVisibleItemPosition();
int findLastCompletelyVisibleItemPosition();
View
lying on screen with the help of Rect | getGlobalVisibleRect()
Rect | getGlobalVisibleRect()
but that is also not working inside onScrolled() | OnScrollStateChanged()
onScrolled() | OnScrollStateChanged()
Please suggest approach where I can get the correct index of the fully visible cell.
Try to create separate thread for the action of onScrolled() | onScrollStateChanged()
onScrolled() | onScrollStateChanged()
. It will solve your problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.