question

EmilAlipiev-5934 avatar image
0 Votes"
EmilAlipiev-5934 asked ·

How to handle Transform Animation on listview (shopping basket sample)?

I have created a transform animation similar to below using xamarin.forms. I achieved that using a behavior on a view cell of the lisview. But what actually happen is, item of the view is literally moving to the basket using the code below and there appears a gap where the item is moved. I can restore it with another translateto animation using x:0 y:0. how can we dynamically achieve this without having such temporally gap on a listview?
I can simply create a copy of selected item's view cell and move it. I guess this is what it happens on the gif below? but is it not too expensive to create such copy of view every time? Anyone knows a better strategie ? or any sample for xamarin.forms

 await AssociatedObject.Animate(new ScaleToAnimation() { Delay = 200, Duration = "1500", Scale = 2, Easing = EasingType.SinIn });
          _ = AssociatedObject.Animate(new TranslateToAnimation() { Delay = 0, Duration = "1000", TranslateX = X, TranslateY = Y, Easing = EasingType.SinOut });
          await AssociatedObject.Animate(new ScaleToAnimation() { Delay = 0, Duration = "1200", Scale = 0, Easing = EasingType.SinOut });
          _ = AssociatedObject.Animate(new TranslateToAnimation() { Delay = 0, TranslateX = 0, TranslateY = 0 });
          _ = AssociatedObject.Animate(new ScaleToAnimation() { Delay = 0, Scale = 1 });


40867-n4mmc.gif



dotnet-xamarinforms
n4mmc.gif (863.9 KiB)
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi , EmilAlipiev-5934
I can't reproduce your issue , could you provide us a basic ,minimal repro project ?
You could upload it to github and attach the link here .
BTW , have you checked Drag and Drop sample ? It maybe helpful to your case.


0 Votes 0 ·

0 Answers