Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Allow detecting if the user is dragging on a CollectionView #13703

@GalaxiaGuy

Description

@GalaxiaGuy

Summary

Expand ItemsViewScrolledEventArgs to include a property indicating whether the user is explicitly dragging.

API Changes

public class ItemsViewScrolledEventArgs : EventArgs
{
     public ItemsViewScrollState ItemsViewScrollState { get; set; }
}

public enum ItemsViewScrollState
{
    Unknown,
    Idle,
    Dragging,
    Settling,
}

Implementation

iOS has UIScrollView.Dragging to detect dragging and UIScrollView.Decelerating to detect settling.
https://developer.apple.com/documentation/uikit/uiscrollview?language=objc

Android has RecyclerView.ScrollState which returns values that directly map to my suggestion ItemsViewScrollState enum.
https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html#getscrollstate

I'm unsure about Windows. It seems WinUI has an experimantal scrollviewer that has support for it.

I don't know other platforms. I added Unknown to handle platforms that don't support it.

Intended Use Case

The main use is behavior that needs to differ between user initiated scroll and programmatic scrol

Other thoughts

Should this be also added to ScrollEventArgs?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions