diff options
| author | 2020-04-08 01:33:31 +0000 | |
|---|---|---|
| committer | 2020-04-08 01:33:31 +0000 | |
| commit | 2ac0ece450b2623fa1bd08411ade8f86c50e0794 (patch) | |
| tree | f4cf009041b755a93268570c138d9e06534043fd | |
| parent | 9f16f2665a878a0f08fb73bd56ba1f703c35db4f (diff) | |
| parent | 2e98f50ec3f11de8d911fd644c4be389d8a4d671 (diff) | |
Merge "Added interpolated blur animation for status bar" into rvc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/Interpolators.java | 2 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/Interpolators.java b/packages/SystemUI/src/com/android/systemui/Interpolators.java index 6923079dd5c4..13d6a9bef266 100644 --- a/packages/SystemUI/src/com/android/systemui/Interpolators.java +++ b/packages/SystemUI/src/com/android/systemui/Interpolators.java @@ -49,6 +49,8 @@ public class Interpolators { public static final Interpolator CUSTOM_40_40 = new PathInterpolator(0.4f, 0f, 0.6f, 1f); public static final Interpolator HEADS_UP_APPEAR = new HeadsUpAppearInterpolator(); public static final Interpolator ICON_OVERSHOT = new PathInterpolator(0.4f, 0f, 0.2f, 1.4f); + public static final Interpolator SHADE_ANIMATION = + new PathInterpolator(0.6f, 0.02f, 0.4f, 0.98f); public static final Interpolator ICON_OVERSHOT_LESS = new PathInterpolator(0.4f, 0f, 0.2f, 1.1f); public static final Interpolator PANEL_CLOSE_ACCELERATED diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index d2da2628276a..55d3e8372b01 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter import android.animation.ValueAnimator import android.app.WallpaperManager import android.util.Log +import android.util.MathUtils import android.view.Choreographer import android.view.View import androidx.annotation.VisibleForTesting @@ -225,7 +226,10 @@ class NotificationShadeDepthController @Inject constructor( private fun updateShadeBlur() { var newBlur = 0 if (statusBarStateController.state == StatusBarState.SHADE) { - newBlur = blurUtils.blurRadiusOfRatio(shadeExpansion) + val animatedBlur = + Interpolators.SHADE_ANIMATION.getInterpolation( + MathUtils.constrain(shadeExpansion / 0.15f, 0f, 1f)) + newBlur = blurUtils.blurRadiusOfRatio(0.35f * animatedBlur + 0.65f * shadeExpansion) } shadeSpring.animateTo(newBlur) } |