-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Enhancement] Better animations #6999
Comments
Would #4233 help with that? |
It's not clear to me if |
I would say it should apply to all form navigation so it will look like this:
Where 2000 is the time to take in milliseconds The Transition can be:
The same thing can e applied to OnDisappearing, for example below I am opening the page using SlideFromLeft:
and closing it using Fade:
Thanks, |
@jrahma I believe there is an existing issue / PR for what you need. This issue is different in that I want a better animation framework that hands off as much work as possible to the native layers to do basic translate, scale, fade, etc. So, when I do something like:
this animation should be smooth when I've recently created a simple, hacky dependency service that animates views for me. The animations are 10x better compared to using Xamarin Forms' animation framework. I directly use |
@adrianknight89 would you care to share your hacky solution? |
@raindeer I'll get back to you on this later. I'm a bit busy right now with work and other things. I hope to update you back this weekend. |
@raindeer Hi, sorry I forgot about this... Here's the Android implementation (assuming
This one translates the view on the x axis to point 0. For other properties, you'll need to swap the corresponding Android property names. Make sure to notify Forms of the final change in the iOS is a bit tricky. I'm sure there is a better way to do this.
On iOS, you need to first translate the transform to its start position. Then, inside In essence, all of this hacky code is trying to bypass layers of Forms code that degrade animation performance. |
@adrianknight89 interesting, will have a look at it. thanks! |
I was trying to do some animations on complex views and i had to stop it immediately :( So i tried to compare some small animations with the forms engine and the native ones.... Maybe the community can help to create a more modern and performant engine for animations, lets see if the forms teams will ever approve this request :) |
Honestly, this should not be left to the community. While I understand Forms is an open source project, big corporations like Microsoft should be expected to hire people and develop a full-fledged cross-platform framework, especially considering Microsoft needs to attract more startups to the Azure ecosystem. I'm extremely worried about the future of Xamarin Forms and recently decided to give up after many many years of contributing to this project. Right now, I'm migrating my code base to Xamarin.Android and Xamarin.iOS and noticing visible changes with respect to performance and layouting. With nearly 2000 open issues (some of them are very serious indeed) and a botched I've implemented my own Cheers. |
@adrianknight89 I’ve sent you an email. Let’s talk. I’d really like to see your performance comparisons and get to the bottom of this. We should be able to achieve the same performance since all those same controls you note are either being used or may be substituted. |
I have to say that in ios the animations are quite smooth (not as native, but they are good), in android on the other hand... they are a bit jittering, not fluid at all. Lately i was experimenting some simple UI with other cross-platforms frameworks. The custom animations in Xamarin Forms doesnt felt "natural" and fluid. I dont know... now that i noted this, I cant stop to see it in every app i developed :) But, again, maybe its just me... |
Duplicate of #6033 |
Summary
The current
Animation
implementation seems complex and performs poorly when multiple non-trivial views are animated (such as translating two ListViews at the same time). There should be a new way for us to animate objects by taking advantage of hardware acceleration and avoiding things like a timer.I can't find a good substitute for the current implementation. I've looked at Xamarin Transitions, but the project is not actively being maintained and doesn't seem to work as of now.
The text was updated successfully, but these errors were encountered: