Xamarin.forms: [Enhancement] Add Scroll Status property to ItemsViewScrolledEventArgs (CarouselView, CollectionView)

Created on 15 Jun 2020  Â·  3Comments  Â·  Source: xamarin/Xamarin.Forms

Summary

It would be nice to have the ScrollStatus property in the ItemsViewScrolledEventArgs

ScrollStatus | Gets a value that tells if this event is for a newly started scroll, a running scroll, a completed scroll, or a canceled scroll.
-- | --

ScrollStatus | enum | Description
-- | -- | --
Canceled | 3 | Scroll was canceled.
Completed | 2 | Scroll completed.
Running | 1 | Scroll is still recognized
Started | 0 | Scroll started.

API Changes

public enum ScrollStatus { Started = 0, Running = 1, Completed = 2, Canceled = 3 }

````
public class ItemsViewScrolledEventArgs : EventArgs
{
...

            public ScrollStatus StatusType { get; set; }
}

````

Actual Behavior

For now we just have the running event on Carousel or CollectionView
We can't know if it's a newly started, completed, or cancelled scroll.

Special case

  • When scroll is running and the user stop the scroll with his finger (without movement), scroll stop and no event is raised,
    Scrolled event should be raised with cancelled status on this case.
  • if ScrollTo() function is call without animation,
    Scrolled event should be raise one time with ScrollStatus scroll completed.

Intended Use Case

  • Reset some properties when scroll start.
  • Display/Hide a view when it's scrolling
  • Updating items informations in real times when scroll completed
  • Fetch new datas when scroll is completed and it is the last Item index.
  • And more ...
collectionview proposal-open enhancement âž•

Most helpful comment

Another quite relevant use case:
Pause ffimageloading while scrolling, and reenable when done scrolling. As per described here for better scrolling performance: https://github.com/luberda-molinet/FFImageLoading/wiki/Advanced-Usage#scroll-high-performances

Right now I have some lag when scrolling a large collectionview with images. With this enhancement, I could disable fetching of images while scrolling to get better performance.

All 3 comments

Another quite relevant use case:
Pause ffimageloading while scrolling, and reenable when done scrolling. As per described here for better scrolling performance: https://github.com/luberda-molinet/FFImageLoading/wiki/Advanced-Usage#scroll-high-performances

Right now I have some lag when scrolling a large collectionview with images. With this enhancement, I could disable fetching of images while scrolling to get better performance.

I'm trying to implement nice animations of the cells while scrolling, and such a status would be very helpful.. :)

It seems that in the depths of the issue tracker I have finally found people who are trying to achieve the same thing.

I hope this gets made soon.

Was this page helpful?
0 / 5 - 0 ratings