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

[Android] Forward ScrollView touch events to custom renderers #472

Merged
merged 2 commits into from Oct 31, 2016

Conversation

Projects
None yet
4 participants
@adrianknight89
Contributor

adrianknight89 commented Oct 19, 2016

Description of Change

Android ScrollViewer is not forwarding touch events when they are caught by the nested horizontal scroll viewer. This PR will ask the nested item to forward its touch capture to the parent and ask it not to process the touch again. So, the touch bubbles up to the custom renderer and when it's back in the vertical scroll viewer, it won't go any further.

Just to add more, if scroll view orientation is vertical, touch events will be caught by the vertical (parent) scroll view. If horizontal, they will be forwarded. If bidirectional, depending on who captures the event, it will either be processed by the parent or forwarded to the parent.

Bugs Fixed

API Changes

Added:

  • internal bool ShouldSkipOnTouch;

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
if (ShouldSkipOnTouch)
{
ShouldSkipOnTouch = false;
return false;

This comment has been minimized.

@adrianknight89

adrianknight89 Oct 19, 2016

Contributor

At the moment, I'm debating if the right return value should be true or false.

@adrianknight89

adrianknight89 Oct 19, 2016

Contributor

At the moment, I'm debating if the right return value should be true or false.

This comment has been minimized.

@rmarinho

rmarinho Oct 31, 2016

Member

You can return false, you are not interested in more events. so this allow others to pick up.

@rmarinho

rmarinho Oct 31, 2016

Member

You can return false, you are not interested in more events. so this allow others to pick up.

@adrianknight89 adrianknight89 changed the title from [Android] Forward touch events to custom renderers to [Android] Forward ScrollView touch events to custom renderers Oct 19, 2016

if (ShouldSkipOnTouch)
{
ShouldSkipOnTouch = false;
return false;

This comment has been minimized.

@rmarinho

rmarinho Oct 31, 2016

Member

You can return false, you are not interested in more events. so this allow others to pick up.

@rmarinho

rmarinho Oct 31, 2016

Member

You can return false, you are not interested in more events. so this allow others to pick up.

@rmarinho rmarinho merged commit c9edd1a into xamarin:master Oct 31, 2016

1 check passed

Android-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 : Tests passed: 348, ig…
Details

@samhouts samhouts added this to the 2.3.4 milestone Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment