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

[Custom] SwipeEvent #10

Closed
bcaceiro opened this issue Jun 5, 2019 · 9 comments
Closed

[Custom] SwipeEvent #10

bcaceiro opened this issue Jun 5, 2019 · 9 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@bcaceiro
Copy link

bcaceiro commented Jun 5, 2019

How can I deactivate the SwipeUp gesture from this calendar? I want to override it / disable, to call my own SwipeGesture in my view, is it possible?

@bcaceiro bcaceiro added the help wanted Extra attention is needed label Jun 5, 2019
@bcaceiro bcaceiro changed the title [Custom] Your title [Custom] SwipeEvent Jun 5, 2019
@PenguinPero
Copy link
Contributor

With current version I think there is no way

And since I don't know your exact needs and situation I will try to make some guesses
Here are few options:

  • I could update the plugin for you to be able to override it (any direction swipe event, command or something)
  • If calendar is wrapped inside another view which has either top or bottom content which needs to be swipe-able together with calendar it might be more complicated
  • However if I add something like "DisableSwipeDetection" to calendar and disable all the gestures, it might work for you, in which case if you want to have swipe left-right you would need to manually call calendar's PrevMonthCommand and NextMonthCommand with your gestures

Also is this an issue on both platforms or specific to Android/iOS?

@bcaceiro
Copy link
Author

bcaceiro commented Jun 5, 2019

The last option is the better, tbf, or, expose the event, so I could have my SwipedUp implementation.

This is for Android and iOS.

Thanks!

@PenguinPero
Copy link
Contributor

PenguinPero commented Jun 5, 2019

I added both, although I will test the iOS version tomorrow

Available properties will be:

DisableSwipeDetection="True"
SwipeUpActionEnabled="False"
SwipeUpCommand="{Binding SwipeUpCommand}"

I will run the build/nuget push now, you might be able to test iOS before me
Swipe-Left/Right I will leave as todo

PenguinPero pushed a commit that referenced this issue Jun 6, 2019
@PenguinPero
Copy link
Contributor

1.0.3.44 will contain the new functionalities
Let me know if this solves the issue for you :)

@bcaceiro
Copy link
Author

bcaceiro commented Jun 6, 2019

It is almost perfect, thank you so much for the support.

   SwipeUpCommand?.Execute(null);

            if (SwipeUpActionEnabled)
                ToggleCalendarSectionVisibility();

In this method, you should override the SwipeUpCommand, and not invoke the ToggleCalendarSectionVisibility, if there was a SwipeUpCommand defined. At this moment, I have detected my swipe, however, it is still hiding the calendar, which I don't want (at least not your default method)

@PenguinPero
Copy link
Contributor

PenguinPero commented Jun 6, 2019

I made it so that you can set:

SwipeUpActionEnabled="false"
SwipeUpCommand="-your command binding-"

This way you will override it
So the logic is:
SwipeUpCommand is always called on swipe-up, while default behavior can be disabled with SwipeUpActionEnabled

Sorry if it wasn't clear

@bcaceiro
Copy link
Author

bcaceiro commented Jun 6, 2019

Oh, you are right. Well, I've managed to do what I needed. Thank you so much!

@PenguinPero
Copy link
Contributor

Maybe I will rename it to SwipeUpToHideEnabled to make it clearer that it only disables the default behaviour
so If everything works for you we can close the issue?

I will add a feature request issue for remaining todos for other direction swipe overrides

@bcaceiro
Copy link
Author

bcaceiro commented Jun 6, 2019

Yes, that would make it more clear.

Indeed having all actions bindable would be great. Would serve all purposes for anyone.

thanks again.

iCodeSometime pushed a commit to iCodeSometime/Xamarin.Plugin.Calendar that referenced this issue Jul 30, 2020
iCodeSometime pushed a commit to iCodeSometime/Xamarin.Plugin.Calendar that referenced this issue Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants