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

Commit b0e4f03d authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Android (Google) Code Review
Browse files

Merge "Revert "Move flag calls to static initializier"" into main

parents e4787b10 cd34220a
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
    }
}