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

Commit 323755c1 authored by Andreas Miko's avatar Andreas Miko Committed by Android (Google) Code Review
Browse files

Merge "Fix LightRevealScrim jank" into main

parents 19c57939 a9d063da
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ constructor(
    private val lightRevealScrimRepository: LightRevealScrimRepository,
    @Application private val scope: CoroutineScope,
    private val scrimLogger: ScrimLogger,
    powerInteractor: PowerInteractor,
    private val powerInteractor: PowerInteractor,
) {

    init {
@@ -83,11 +83,13 @@ constructor(
            // (invisible) jank. However, we need to still pass through 1f and 0f to ensure that the
            // correct end states are respected even if the screen turned off (or was still off)
            // when the animation finished
            powerInteractor.screenPowerState.value != ScreenPowerState.SCREEN_OFF ||
                it == 1f ||
                it == 0f
            screenIsShowingContent() || it == 1f || it == 0f
        }

    private fun screenIsShowingContent() =
        powerInteractor.screenPowerState.value != ScreenPowerState.SCREEN_OFF &&
            powerInteractor.screenPowerState.value != ScreenPowerState.SCREEN_TURNING_ON

    companion object {

        /**