Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListView detect LongPress having SelectionMode="None" #16

Closed
marcellangmaier opened this issue May 25, 2019 · 3 comments
Closed

ListView detect LongPress having SelectionMode="None" #16

marcellangmaier opened this issue May 25, 2019 · 3 comments
Labels
bug in XF Depends on a bug in Xamarin.Forms

Comments

@marcellangmaier
Copy link

I want to detect a Tap and a LongPress on a Listview item having the property ListView.SelectionMode set to "None".

The builtin ListView ItemTappedEventArgs provide an Item property, so that I can figure out the Item which was tapped.
Unforunately your LongPressEventArgs does not provide this information, so that I only can rely on the SelectedItem property of the ListView. This does not work with ListView.SelectionMode="None".

If I am using your ViewCell and catch the Tap and LongPress, I can use the BindingContext of the sender to find out which Item was affected. But: the light grey flash animation when tapping the cell does not appear anymore. So the user does not have a feedback that the cell was hit.

I am looking for a way to either get the Viewcell animated when tapping it or finding out the long pressed item within your ListView_LongPressing event handler.

@marcellangmaier
Copy link
Author

The tap Animation works on ios, but not on android.

@MichaelRumpler
Copy link
Owner

That the ListView provides only information about the ListView itself and not its cells is by design.

For the missing animation I opened a bug in Xamarin.Forms in 2015!! @kingces95 and @pauldipietro added something in 2017, but otherwise the bug was ignored.

We could create an issue on https://github.com/xamarin/Xamarin.Forms/issues too, but then we should first test if the same happens with a CollectionView. It is very likely and they will most probably be more inclined to look at it if the bug happens in their shiny new control.

@MichaelRumpler MichaelRumpler added the bug in XF Depends on a bug in Xamarin.Forms label Nov 18, 2019
@MichaelRumpler
Copy link
Owner

This is a Xamarin.Android bug which is open for 9 years now. I can't do anything about it, so I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in XF Depends on a bug in Xamarin.Forms
Projects
None yet
Development

No branches or pull requests

2 participants