Loading packages/SystemUI/src/com/android/systemui/doze/util/BurnInHelper.kt +2 −3 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ 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_X = 83f private const val BURN_IN_PREVENTION_PERIOD_SCALE = 181f private const val BURN_IN_PREVENTION_PERIOD_SCALE = 181f private const val BURN_IN_PREVENTION_PERIOD_PROGRESS = 89f 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 * Returns the translation offset that should be used to avoid burn in at the current time (in Loading Loading @@ -55,9 +56,7 @@ fun getBurnInProgressOffset(): Float { /** Returns a value to scale a view in order to avoid burn in. */ /** Returns a value to scale a view in order to avoid burn in. */ fun getBurnInScale(): Float { fun getBurnInScale(): Float { val multiplier = if (Flags.clockReactiveSmartspaceLayout()) 0.75f else 0.8f return BASE_BURNIN_SCALE + return multiplier + zigzag( zigzag( System.currentTimeMillis() / MILLIS_PER_MINUTES, System.currentTimeMillis() / MILLIS_PER_MINUTES, 0.2f, 0.2f, Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodBurnInViewModel.kt +2 −3 Original line number Original line Diff line number Diff line Loading @@ -192,18 +192,17 @@ constructor( val burnInY = MathUtils.lerp(0, burnIn.translationY, interpolated).toInt() val burnInY = MathUtils.lerp(0, burnIn.translationY, interpolated).toInt() val translationY = max(params.topInset - params.minViewY, burnInY) val translationY = max(params.topInset - params.minViewY, burnInY) val stopScale = if (Flags.clockReactiveSmartspaceLayout()) MAX_LARGE_CLOCK_SCALE else 1f BurnInModel( BurnInModel( translationX = MathUtils.lerp(0, burnIn.translationX, interpolated).toInt(), translationX = MathUtils.lerp(0, burnIn.translationX, interpolated).toInt(), translationY = translationY, translationY = translationY, scale = MathUtils.lerp(burnIn.scale, stopScale, 1f - interpolated), scale = MathUtils.lerp(burnIn.scale, MAX_LARGE_CLOCK_SCALE, 1f - interpolated), scaleClockOnly = useScaleOnly, scaleClockOnly = useScaleOnly, ) ) } } } } companion object { companion object { private const val MAX_LARGE_CLOCK_SCALE = 0.9f private val MAX_LARGE_CLOCK_SCALE = if (Flags.clockReactiveSmartspaceLayout()) 0.9f else 1f } } } } Loading Loading
packages/SystemUI/src/com/android/systemui/doze/util/BurnInHelper.kt +2 −3 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ 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_X = 83f private const val BURN_IN_PREVENTION_PERIOD_SCALE = 181f private const val BURN_IN_PREVENTION_PERIOD_SCALE = 181f private const val BURN_IN_PREVENTION_PERIOD_PROGRESS = 89f 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 * Returns the translation offset that should be used to avoid burn in at the current time (in Loading Loading @@ -55,9 +56,7 @@ fun getBurnInProgressOffset(): Float { /** Returns a value to scale a view in order to avoid burn in. */ /** Returns a value to scale a view in order to avoid burn in. */ fun getBurnInScale(): Float { fun getBurnInScale(): Float { val multiplier = if (Flags.clockReactiveSmartspaceLayout()) 0.75f else 0.8f return BASE_BURNIN_SCALE + return multiplier + zigzag( zigzag( System.currentTimeMillis() / MILLIS_PER_MINUTES, System.currentTimeMillis() / MILLIS_PER_MINUTES, 0.2f, 0.2f, Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AodBurnInViewModel.kt +2 −3 Original line number Original line Diff line number Diff line Loading @@ -192,18 +192,17 @@ constructor( val burnInY = MathUtils.lerp(0, burnIn.translationY, interpolated).toInt() val burnInY = MathUtils.lerp(0, burnIn.translationY, interpolated).toInt() val translationY = max(params.topInset - params.minViewY, burnInY) val translationY = max(params.topInset - params.minViewY, burnInY) val stopScale = if (Flags.clockReactiveSmartspaceLayout()) MAX_LARGE_CLOCK_SCALE else 1f BurnInModel( BurnInModel( translationX = MathUtils.lerp(0, burnIn.translationX, interpolated).toInt(), translationX = MathUtils.lerp(0, burnIn.translationX, interpolated).toInt(), translationY = translationY, translationY = translationY, scale = MathUtils.lerp(burnIn.scale, stopScale, 1f - interpolated), scale = MathUtils.lerp(burnIn.scale, MAX_LARGE_CLOCK_SCALE, 1f - interpolated), scaleClockOnly = useScaleOnly, scaleClockOnly = useScaleOnly, ) ) } } } } companion object { companion object { private const val MAX_LARGE_CLOCK_SCALE = 0.9f private val MAX_LARGE_CLOCK_SCALE = if (Flags.clockReactiveSmartspaceLayout()) 0.9f else 1f } } } } Loading