nativescript-community / ui-collectionview

Allows you to easily add a collection view (grid list view) to your projects. Supports vertical and horizontal modes, templating, and more.
Apache License 2.0
59 stars 18 forks source link

Feature Request: itemUnloading event similar to itemLoading event #24

Closed garsuga closed 1 year ago

garsuga commented 3 years ago

I could not find anything similar to this, it would be helpful to have an event for when an item is no longer being displayed as a view to free up any tasks/intervals related to it.

farfromrefug commented 3 years ago

@garsuga such évent is not really possible seeing how collection view works. views are reused. so you wouly not always get the event

garsuga commented 3 years ago

Sorry, I worded that poorly. I was interested in an event that would tell when at item has its view bound to a new item. That way you can tell when an item is no longer bound to a view.

https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.RecyclerListener This is an event that happens when a view is being recycled, I was hoping for an event at the same time which would return the item which was replaced when the view was recycled.

farfromrefug commented 3 years ago

@garsuga ok the thing is i want the component to remain as lean as possible for it be fast. What you could do is:

Would that we good with you?