I want to know if there is any well-known library or an approach to code a long press in .NET MAUI. I'm aware of Mr.Gestures library which is capable of long pressing but don't want to purchase a license for that.
I want to use the long pressing effect so that when a user presses for a long time DisplayActionSheet activates showing the user some options. I found this link about CollectionView LongPress but I'm not using CollectionView so I don't think it applies to my code. Currently, I am using ListView and want to implement a long press method to each row but am stuck with it. If there is no built-in library for NET MAUI is creating platform-specific code or using Xamarin Forms library the only way to do it?
UPDATE
The effects are now out on GitHub checkout release v0.1.1-pre and above for the same!
Answer
I am planning to add a Ripple/Fade and Longpress effect into FreakyEffects.
The latest PR is here.
It has a Longpress command you can use, I am adding the relevant code here you can later add FreakyEffects if you want.
If you don't mind waiting this would be out of Nuget by the end of this month.
Create a RoutingEffect:
Its Android Platform Effect:
iOS version of the same:
Then create a static class that can help you use it:
Register this:
In your view, you can use
Commands.LongTapand assign the relevant command.If I am missing some classes you can get them from Github.