Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt +14 −16 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ object LightRevealScrimViewBinder { launch("$TAG#viewModel.maxAlpha") { var animator: ValueAnimator? = null viewModel.maxAlpha.collect { (alpha, animate) -> if (alpha != revealScrim.alpha) { animator?.cancel() if (!animate) { revealScrim.alpha = alpha Loading @@ -65,7 +64,6 @@ object LightRevealScrimViewBinder { } } } } launch("$TAG#viewModel.revealAmount") { viewModel.revealAmount.collect { revealScrim.revealAmount = it } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt +10 −7 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.systemui.keyguard.domain.interactor.LightRevealScrimInteracto import com.android.systemui.statusbar.LightRevealEffect import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map /** Loading @@ -34,13 +35,15 @@ constructor(private val interactor: LightRevealScrimInteractor) { /** Max alpha for the scrim + whether to animate the change */ val maxAlpha: Flow<Pair<Float, Boolean>> = interactor.maxAlpha.map { alpha -> interactor.maxAlpha .map { alpha -> Pair( alpha, // Darken immediately if going to be fully opaque if (alpha == 1f) false else true, ) } .distinctUntilChanged() fun setWallpaperSupportsAmbientMode(supportsAmbientMode: Boolean) { interactor.setWallpaperSupportsAmbientMode(supportsAmbientMode) Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt +14 −16 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ object LightRevealScrimViewBinder { launch("$TAG#viewModel.maxAlpha") { var animator: ValueAnimator? = null viewModel.maxAlpha.collect { (alpha, animate) -> if (alpha != revealScrim.alpha) { animator?.cancel() if (!animate) { revealScrim.alpha = alpha Loading @@ -65,7 +64,6 @@ object LightRevealScrimViewBinder { } } } } launch("$TAG#viewModel.revealAmount") { viewModel.revealAmount.collect { revealScrim.revealAmount = it } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt +10 −7 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.systemui.keyguard.domain.interactor.LightRevealScrimInteracto import com.android.systemui.statusbar.LightRevealEffect import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map /** Loading @@ -34,13 +35,15 @@ constructor(private val interactor: LightRevealScrimInteractor) { /** Max alpha for the scrim + whether to animate the change */ val maxAlpha: Flow<Pair<Float, Boolean>> = interactor.maxAlpha.map { alpha -> interactor.maxAlpha .map { alpha -> Pair( alpha, // Darken immediately if going to be fully opaque if (alpha == 1f) false else true, ) } .distinctUntilChanged() fun setWallpaperSupportsAmbientMode(supportsAmbientMode: Boolean) { interactor.setWallpaperSupportsAmbientMode(supportsAmbientMode) Loading