Fix PIP snapping to incorrect location.

animateToClosestSnapTarget is no longer used, we always use flingToSnapTarget now. If velocity is low/zero, the fling animation will end and a spring animation will spring it to the nearest allowable location.

This also incorporates a fix to PhysicsAnimator (cl/296316037) to more accurately decide if a fling is strong enough to reach the other side of the screen. This fixes an issue where pushing PIP off-screen and then very gently moving it back on screen caused it to jump to the other side of the screen.

Fixes: 154937295
Test: manual
Change-Id: I6f0284195bcb802f4cdd58cc06457023dcf63aa1
3 files changed