-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Less jiggly animation on moveTo #189
Conversation
Maybe it would be a good idea to add a comment about this to the code, since I will certainly forget about this detail in T-10 seconds... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment would help! No idea about why this happens.
On a side note, should AbsolutePoint and ScaledPoint be inline classes? I wonder if this would avoid JVM allocations which are especially painful during animations.
Probably, however, according to the Kotlin docs:
Which doesn't seem like a very intuitive thing for an object that is meant to describe two values. |
Sounds good 😄 |
Hey, I have been testing There are also hiccups when the content hits the edge of the container, I think they are what @markusressel calls @natario1 @markusressel Any ideas about what is going on? I have been trying to fix the problem(s), any help is really welcome. |
Well, since it was over 2 years ago when I last looked at this, sadly I have no idea 😢 All of the research that I have done has been documented in #188, and it may very well not be trivial to fix this this. |
Thanks for the reply @markusressel One thing I think it causes problems is trying to fix zoom and pan during the animation ( This is what happens with a zoom + pan animation, it is the actual panX that the ZoomLayout is getting. It is full of bumps before reaching 0, where you can clearly see a hard transition, an then you get a nice curve from there. I think those jumps happen because of the corrections applied during the animation. That hard transition is probably caused by how the gravity affects the position of the content view before it gets bigger than the container view, gravity should not have any effect during the animation and it just needs to be considered when calculating the final state before hand. |
so,PropertyValuesHolder.ofObject |
Is there a good solution now |
Solution
This replaces the usage of
PropertyValuesHolder.ofObject
with twoPropertyValuesHolder.ofFloat
instances, to work around the weird behavior which is not respecting the set animation interpolator.This also pretty much eliminates the "wiggly" animation when using
moveTo
, although it still has problems, like "bashing" into walls due to overpan not being allowed during the animation.