Makes spring variable dynamic resources so that they can be changed via plugin
Bug: 147302669 Change-Id: Ia4e74ff46a4d8338a56ea75ed826b69102c42d93
This commit is contained in:
@@ -32,8 +32,10 @@ import com.android.launcher3.anim.AnimationSuccessListener;
|
||||
import com.android.launcher3.anim.AnimatorSetBuilder;
|
||||
import com.android.launcher3.anim.PropertySetter;
|
||||
import com.android.launcher3.anim.SpringObjectAnimator;
|
||||
import com.android.launcher3.util.DynamicResource;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.launcher3.views.ScrimView;
|
||||
import com.android.systemui.plugins.ResourceProvider;
|
||||
|
||||
/**
|
||||
* Handles AllApps view transition.
|
||||
@@ -47,9 +49,6 @@ import com.android.launcher3.views.ScrimView;
|
||||
*/
|
||||
public class AllAppsTransitionController implements StateHandler, OnDeviceProfileChangeListener {
|
||||
|
||||
private static final float SPRING_DAMPING_RATIO = 0.75f;
|
||||
private static final float SPRING_STIFFNESS = 600f;
|
||||
|
||||
public static final FloatProperty<AllAppsTransitionController> ALL_APPS_PROGRESS =
|
||||
new FloatProperty<AllAppsTransitionController>("allAppsProgress") {
|
||||
|
||||
@@ -187,8 +186,12 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
|
||||
|
||||
public Animator createSpringAnimation(float... progressValues) {
|
||||
if (UNSTABLE_SPRINGS.get()) {
|
||||
ResourceProvider rp = DynamicResource.provider(mLauncher);
|
||||
float damping = rp.getFloat(R.dimen.all_apps_spring_damping_ratio);
|
||||
float stiffness = rp.getFloat(R.dimen.all_apps_spring_stiffness);
|
||||
|
||||
return new SpringObjectAnimator<>(this, ALL_APPS_PROGRESS, 1f / mShiftRange,
|
||||
SPRING_DAMPING_RATIO, SPRING_STIFFNESS, progressValues);
|
||||
damping, stiffness, progressValues);
|
||||
}
|
||||
return ObjectAnimator.ofFloat(this, ALL_APPS_PROGRESS, progressValues);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user