From 8c8ade27fd54a97c5cfe219183947a6a24aef71b Mon Sep 17 00:00:00 2001 From: Nick Chameyev Date: Fri, 25 Nov 2022 15:35:57 +0000 Subject: [PATCH] [Unfold animation] Update dark vignette interpolator Update the interpolator to darken the screen later when folding the device. Graph of the interpolator: http://screen/3duzZ8hZCTxFNi2.png Bug: 255955520 Test: manual fold/unfold and going to tabletop mode Change-Id: Id2fa4feaf0dd9d86b6a7fbde87a42cfec73e1626 --- .../src/com/android/systemui/statusbar/LightRevealScrim.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt index bc456d5d46138..2334a4c27af8b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt @@ -15,6 +15,7 @@ import android.os.Trace import android.util.AttributeSet import android.util.MathUtils.lerp import android.view.View +import android.view.animation.PathInterpolator import com.android.systemui.animation.Interpolators import com.android.systemui.statusbar.LightRevealEffect.Companion.getPercentPastThreshold import com.android.systemui.util.getColorWithAlpha @@ -88,10 +89,12 @@ object LiftReveal : LightRevealEffect { class LinearLightRevealEffect(private val isVertical: Boolean) : LightRevealEffect { - private val INTERPOLATOR = Interpolators.FAST_OUT_SLOW_IN_REVERSE + // Interpolator that reveals >80% of the content at 0.5 progress, makes revealing faster + private val interpolator = PathInterpolator(/* controlX1= */ 0.4f, /* controlY1= */ 0f, + /* controlX2= */ 0.2f, /* controlY2= */ 1f) override fun setRevealAmountOnScrim(amount: Float, scrim: LightRevealScrim) { - val interpolatedAmount = INTERPOLATOR.getInterpolation(amount) + val interpolatedAmount = interpolator.getInterpolation(amount) scrim.interpolatedRevealAmount = interpolatedAmount