Merge "[Unfold animation] Update dark vignette interpolator" into tm-qpr-dev

This commit is contained in:
Nick Chameyev
2022-12-01 15:48:04 +00:00
committed by Android (Google) Code Review

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