mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Start springs for All Apps when user flings up.
Bug: 77695481 Change-Id: Ifecfbbb89601947118f620f522662aee8a61946e
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user