sagar-viradiya / AndroidPhysicsAnimation

Sample app demonstrating android physics based animation
MIT License
138 stars 18 forks source link

Question: does the phone-ringing animation use spring animation? #1

Closed AndroidDeveloperLB closed 6 years ago

AndroidDeveloperLB commented 6 years ago

I'm talking about this:

2018-07-11_10-12-59

If not, what does it use? Can the physics animation library help to do something like that ? To me it seems it starts from center, and goes left and right of it.

sagar-viradiya commented 6 years ago

Hey, Not sure phone ringing animation uses physics animation.

But it is possible using physics animation. It seems like animation is divided into 2 parts

  1. Vertical translation
  2. Horizontal spring animation
AndroidDeveloperLB commented 6 years ago

I just wanted the "wiggling" animation to be smooth and natural. Also not sure how I could do it using the normal API, as it needs to do animation in X coordinate of : 0 -> (-10) -> 10 -> 0

I think I got something similar to what you see on the Phone app: RingingWiggleShakeAnimationTest.zip

2018-07-11_12-48-55

Need some work on this. Still doesn't look so fluid and natural...

sagar-viradiya commented 6 years ago

Are using linear interpolator for translation y animation ?

If yes I would recommend some other interpolator to make it smooth

Never mind saw your code. You are using FastOutSlowInInterpolator

AndroidDeveloperLB commented 6 years ago

It's a bit hard to see it in the animation here. Not enough FPS...

You can try the sample yourself too.

AndroidDeveloperLB commented 6 years ago

It's a bit hard to see it in the animation here. Not enough FPS... You can try the sample yourself too.

BTW, I tried to convert your sample to Android-X. Got a weird issue there: https://issuetracker.google.com/issues/111316650

sagar-viradiya commented 6 years ago

Navigation is not compatible with androidx. It will be available in future release.

AndroidDeveloperLB commented 6 years ago

How do you know this?

sagar-viradiya commented 6 years ago

https://github.com/googlesamples/android-sunflower

Refer ☝️. Sample app showcasing jetpack and this also uses support lib

AndroidDeveloperLB commented 6 years ago

Nice. Thanks. BTW, A gardening app?! :)