Remove min/max values for RectFSpringAnim2.

- Fixes crash on landscape
- We added this to stop the windows from going way out of bounds. But we no
  longer need it since we've tightened up the stiffness so that
  it would take a super aggressive swipe/high velocity for the window
  to go out of bounds

Bug: 188617892
Test: manual
Change-Id: Icc2a0af0a1b26985502ddbc7a5a370e7eecdb346
(cherry picked from commit a2ef1a0238)
This commit is contained in:
Jon Miranda
2021-05-19 09:38:35 -07:00
committed by android-build-team Robot
parent 63b121a163
commit f345df36a4
@@ -34,8 +34,6 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat;
import androidx.dynamicanimation.animation.SpringAnimation;
import androidx.dynamicanimation.animation.SpringForce;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.DynamicResource;
@@ -193,12 +191,8 @@ public class RectFSpringAnim2 extends RectFSpringAnim {
* @param velocityPxPerMs Velocity of swipe in px/ms.
*/
public void start(Context context, PointF velocityPxPerMs) {
DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(context).getDeviceProfile(context);
mRectXAnim = new SpringAnimation(this, RECT_CENTER_X)
.setStartValue(mCurrentCenterX)
.setMinValue(Math.min(0, mCurrentCenterX))
.setMaxValue(Math.max(dp.widthPx, mCurrentCenterX))
.setStartVelocity(velocityPxPerMs.x * 1000)
.setSpring(new SpringForce(mTargetX)
.setStiffness(mXStiffness)
@@ -210,8 +204,6 @@ public class RectFSpringAnim2 extends RectFSpringAnim {
mRectYAnim = new SpringAnimation(this, RECT_Y)
.setStartValue(mCurrentCenterY)
.setMinValue(Math.min(0, mCurrentCenterY))
.setMaxValue(Math.max(dp.heightPx, mCurrentCenterY))
.setStartVelocity(velocityPxPerMs.y * 1000)
.setSpring(new SpringForce(mTargetY)
.setStiffness(mYStiffness)