[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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user