Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd34220a authored by Pechetty Sravani (xWF)'s avatar Pechetty Sravani (xWF) Committed by Android (Google) Code Review
Browse files

Revert "Move flag calls to static initializier"

This reverts commit a4e49cdb.

Reason for revert: <Droidmonitor created revert due to b/409913090.Will be verified throgh ABTD for standard investigation.>

Change-Id: Iddf5e4c454d9764a7c068702942f8d569439cd75
parent a4e49cdb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ private const val BURN_IN_PREVENTION_PERIOD_Y = 521f
private const val BURN_IN_PREVENTION_PERIOD_X = 83f
private const val BURN_IN_PREVENTION_PERIOD_SCALE = 181f
private const val BURN_IN_PREVENTION_PERIOD_PROGRESS = 89f
private val BASE_BURNIN_SCALE = if (Flags.clockReactiveSmartspaceLayout()) 0.75f else 0.8f

/**
 * Returns the translation offset that should be used to avoid burn in at the current time (in
@@ -56,7 +55,9 @@ fun getBurnInProgressOffset(): Float {

/** Returns a value to scale a view in order to avoid burn in. */
fun getBurnInScale(): Float {
    return BASE_BURNIN_SCALE +
    val multiplier = if (Flags.clockReactiveSmartspaceLayout()) 0.75f else 0.8f

    return multiplier +
        zigzag(
            System.currentTimeMillis() / MILLIS_PER_MINUTES,
            0.2f,
+3 −2
Original line number Diff line number Diff line
@@ -192,17 +192,18 @@ constructor(

            val burnInY = MathUtils.lerp(0, burnIn.translationY, interpolated).toInt()
            val translationY = max(params.topInset - params.minViewY, burnInY)
            val stopScale = if (Flags.clockReactiveSmartspaceLayout()) MAX_LARGE_CLOCK_SCALE else 1f
            BurnInModel(
                translationX = MathUtils.lerp(0, burnIn.translationX, interpolated).toInt(),
                translationY = translationY,
                scale = MathUtils.lerp(burnIn.scale, MAX_LARGE_CLOCK_SCALE, 1f - interpolated),
                scale = MathUtils.lerp(burnIn.scale, stopScale, 1f - interpolated),
                scaleClockOnly = useScaleOnly,
            )
        }
    }

    companion object {
        private val MAX_LARGE_CLOCK_SCALE = if (Flags.clockReactiveSmartspaceLayout()) 0.9f else 1f
        private const val MAX_LARGE_CLOCK_SCALE = 0.9f
    }
}