[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
This commit is contained in:
Nick Chameyev
2022-11-25 15:35:57 +00:00
parent bcd596c6c2
commit 8c8ade27fd

View File

@@ -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