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

How to handle Tap with Label and Spans? #20

Open
akamud opened this issue Jan 27, 2021 · 0 comments
Open

How to handle Tap with Label and Spans? #20

akamud opened this issue Jan 27, 2021 · 0 comments
Projects

Comments

@akamud
Copy link
Owner

akamud commented Jan 27, 2021

Apparently the treatment is a little different, this might be useful:

            // if (view == null)


            var captured = false;

            var children = view.GetChildElements(Point.Zero);

            if (children != null)
                foreach (var recognizer in children.GetChildGesturesFor<TapGestureRecognizer>(recognizer =>
                    recognizer.NumberOfTapsRequired == numberOfTapsRequired))
                {
                    recognizer.SendTapped(view);
                    captured = true;
                }

            if (captured)
                return;

            foreach (var gestureRecognizer in view.GestureRecognizers.GetGesturesFor<TapGestureRecognizer>(x =>
                x.NumberOfTapsRequired == numberOfTapsRequired))
            {
                gestureRecognizer.SendTapped(view);
            }

https://github.com/xamarin/Xamarin.Forms/blob/80a4dbfb1cd897f478c38d0aafa6a5d67940d2f3/Xamarin.Forms.Core/EnumerableExtensions.cs

https://github.com/xamarin/Xamarin.Forms/blob/80a4dbfb1cd897f478c38d0aafa6a5d67940d2f3/Xamarin.Forms.Core/Label.cs#L386

https://github.com/xamarin/Xamarin.Forms/blob/80a4dbfb1cd897f478c38d0aafa6a5d67940d2f3/Xamarin.Forms.Platform.Android/TapGestureHandler.cs

@akamud akamud created this issue from a note in Initial release (To do) Jan 27, 2021
@akamud akamud removed this from To do in Initial release Feb 7, 2021
@akamud akamud added this to To do in Backlog Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Backlog
To do
Development

No branches or pull requests

1 participant