A time ago I did this simple animation behavior which helps you to add simple animations to any view
<Image Source="ic_favorite">
<Image.Behaviors>
<behaviors:ViewTappedButtonBehavior Command="{Binding OnLoginCommand}"
AnimationType="Scale"/>
</Image.Behaviors>
</Image>
Blog Post:
https://xamgirl.com/plug-and-play-animations-in-xamarin-forms/
Looks good! I see exception for a Switch and a Button. Are those the only two controls that need exceptions?
Here I'm wondering if we should have a special kind of tap recognizer. If the user has another tap recognizer added first somehow, it might get removed instead of the animation one, right?
But that's something for PR reviews. Proposal in itself looks good AFAIC
@jfversluis
"I see exception for a Switch and a Button. Are those the only two controls that need exceptions?"
Yes, that's because those controls are the only ones that handle specific events. (Clicked, Toggle), to the rest of the other control a simple GestureRecognizer work.
Here I'm wondering if we should have a special kind of tap recognizer. If the user has another tap recognizer added first somehow, it might get removed instead of the animation one, right?
Right now the behaviour removes all the previous gesture recognizer that you may have
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += View_Tapped;
bindable.GestureRecognizers.Add(tapGestureRecognizer);
Yes, that's because those controls are the only ones that handle specific events. (Clicked, Toggle), to the rest of the other control a simple GestureRecognizer work.
OK, is this also still true for RadioButton and CheckBox? We should probably have a close look at the latest controls. Although, here we are again, those are not in the 3.5 version we are supporting right now 馃槄
Right now the behaviour removes all the previous gesture recognizer that you may have
Hm I'm not sure if we are understanding each other. This doesn't clear anything. This code adds to the GestureRecognizers collection which can have multiple values. You can add 3 TapGestureRecognizer objects in there and they will fire all 3 when you tap it.
And from the code I linked, it's not a guarantee that you are removing the recognizer you have added. Right?
OK, is this also still true for RadioButton and CheckBox? We should probably have a close look at the latest controls. Although, here we are again, those are not in the 3.5 version we are supporting right now 馃槄
It does not :P, but I can add it. Do we have a ticket to upgrade to the latest version?
Hm I'm not sure if we are understanding each other. This doesn't clear anything. This code adds to the GestureRecognizers collection which can have multiple values. You can add 3 TapGestureRecognizer objects in there and they will fire all 3 when you tap it.
You are right, it does not remove anything. So the plan will be to remove the previous gestures? I can add those modifications when adding the code in the repo.
Yeah sure. Like I said, and let's just stop here, at discussing implementation details. Which is my fault, I brought it up 馃槵
Proposal looks good, so as far as I am concerned bring this in!
@jsuarezruiz Might also have some cool things to add to this!
Most helpful comment
Yeah sure. Like I said, and let's just stop here, at discussing implementation details. Which is my fault, I brought it up 馃槵
Proposal looks good, so as far as I am concerned bring this in!