Start springs for All Apps when user flings up.

Bug: 77695481
Change-Id: Ifecfbbb89601947118f620f522662aee8a61946e
This commit is contained in:
Jon Miranda
2018-05-22 23:12:10 -07:00
parent c0928c3ba0
commit 1d19e2f152
3 changed files with 48 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ package com.android.launcher3.views;
import android.content.Context;
import android.graphics.Canvas;
import android.support.animation.DynamicAnimation;
import android.support.animation.FloatPropertyCompat;
import android.support.animation.SpringAnimation;
import android.support.animation.SpringForce;
@@ -79,6 +80,11 @@ public class SpringRelativeLayout extends RelativeLayout {
mSpringViews.put(id, true);
}
public void removeSpringView(int id) {
mSpringViews.delete(id);
invalidate();
}
@Override
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
if (mDampedScrollShift != 0 && mSpringViews.get(child.getId())) {
@@ -110,6 +116,13 @@ public class SpringRelativeLayout extends RelativeLayout {
mSpring.start();
}
protected void finishWithShiftAndVelocity(float shift, float velocity,
DynamicAnimation.OnAnimationEndListener listener) {
setDampedScrollShift(shift);
mSpring.addEndListener(listener);
finishScrollWithVelocity(velocity);
}
public EdgeEffectFactory createEdgeEffectFactory() {
return new SpringEdgeEffectFactory();
}