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

Sliding gestures don't work when SlideMenuView contains a ListView on UWP / Android #74

Open
youfacepalm opened this issue May 4, 2018 · 1 comment

Comments

@youfacepalm
Copy link

As the title says, I cannot get the drag gestures to work on Android and UWP when using a ListView inside SlideMenuView on Xamarin.Forms. I use a ListView because I wanted to display a dynamically generated menu.

I use this in a PCL project.

SlideOverKit Version - 2.1.6.1
Xamarin.Forms Version - 2.5.1.527436

@youfacepalm
Copy link
Author

youfacepalm commented May 4, 2018

I was able to fix it by adding the following code to SlideMenuDroidRenderer.cs

public override bool OnInterceptTouchEvent(MotionEvent e)
{
    if (_dragGesture == null)
        return false;
    MotionEventActions action = e.Action & MotionEventActions.Mask;
    if (action == MotionEventActions.Down) 
        _dragGesture.DragBegin(e.RawX, e.RawY);
    if (action == MotionEventActions.Move)
        _dragGesture.DragMoving(e.RawX, e.RawY);
    if (action == MotionEventActions.Up)
        _dragGesture.DragFinished();
    return false;
}

I am not sure if this is the correct way to fix this. Please let me know if you need any additional information on fixing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant