How To Get All Recycler View Item View Position ( X,y ) In Nested Scrollview
I have to draw a curved line on the left side of recycler view ( which connect all the item in the recyclerview).But i cant get all of the position of recyclerview item to start dr
Solution 1:
If your RecyclerView has hundreds of items, you shouldn't put it inside NestedScrollView or try to get any measure of all items at once.
The reason is: RecyclerView will have to measure layout for all items at once, which is totally opposite with the purpose of RecyclerView (calculate layout for item when needed) and lead to a very bad performance, very laggy or even freeze your app (if there are about 1000 items)
In your case, I think you should try to draw each path of the line inside each onBindViewHolder() as part of each item. If the logic to calculate how each draw is drawn is not too complex, I think this is an doable solution to consider
Post a Comment for "How To Get All Recycler View Item View Position ( X,y ) In Nested Scrollview"