Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt +7 −25 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,6 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordanceViewMod import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.plugins.FalsingManager import com.android.systemui.plugins.FalsingManager import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.util.kotlin.pairwise import kotlin.math.pow import kotlin.math.pow import kotlin.math.sqrt import kotlin.math.sqrt import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.milliseconds Loading Loading @@ -128,18 +127,6 @@ object KeyguardBottomAreaViewBinder { } } } } launch { viewModel.startButton .map { it.isActivated } .pairwise() .collect { (prev, next) -> when { !prev && next -> vibratorHelper?.vibrate(Vibrations.Activated) prev && !next -> vibratorHelper?.vibrate(Vibrations.Deactivated) } } } launch { launch { viewModel.endButton.collect { buttonModel -> viewModel.endButton.collect { buttonModel -> updateButton( updateButton( Loading @@ -152,18 +139,6 @@ object KeyguardBottomAreaViewBinder { } } } } launch { viewModel.endButton .map { it.isActivated } .pairwise() .collect { (prev, next) -> when { !prev && next -> vibratorHelper?.vibrate(Vibrations.Activated) prev && !next -> vibratorHelper?.vibrate(Vibrations.Deactivated) } } } launch { launch { viewModel.isOverlayContainerVisible.collect { isVisible -> viewModel.isOverlayContainerVisible.collect { isVisible -> overlayContainer.visibility = overlayContainer.visibility = Loading Loading @@ -383,6 +358,13 @@ object KeyguardBottomAreaViewBinder { .setDuration(longPressDurationMs) .setDuration(longPressDurationMs) .withEndAction { .withEndAction { view.setOnClickListener { view.setOnClickListener { vibratorHelper?.vibrate( if (viewModel.isActivated) { Vibrations.Activated } else { Vibrations.Deactivated } ) viewModel.onClicked( viewModel.onClicked( KeyguardQuickAffordanceViewModel.OnClickedParameters( KeyguardQuickAffordanceViewModel.OnClickedParameters( configKey = viewModel.configKey, configKey = viewModel.configKey, Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt +7 −25 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,6 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordanceViewMod import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.plugins.FalsingManager import com.android.systemui.plugins.FalsingManager import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.util.kotlin.pairwise import kotlin.math.pow import kotlin.math.pow import kotlin.math.sqrt import kotlin.math.sqrt import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.milliseconds Loading Loading @@ -128,18 +127,6 @@ object KeyguardBottomAreaViewBinder { } } } } launch { viewModel.startButton .map { it.isActivated } .pairwise() .collect { (prev, next) -> when { !prev && next -> vibratorHelper?.vibrate(Vibrations.Activated) prev && !next -> vibratorHelper?.vibrate(Vibrations.Deactivated) } } } launch { launch { viewModel.endButton.collect { buttonModel -> viewModel.endButton.collect { buttonModel -> updateButton( updateButton( Loading @@ -152,18 +139,6 @@ object KeyguardBottomAreaViewBinder { } } } } launch { viewModel.endButton .map { it.isActivated } .pairwise() .collect { (prev, next) -> when { !prev && next -> vibratorHelper?.vibrate(Vibrations.Activated) prev && !next -> vibratorHelper?.vibrate(Vibrations.Deactivated) } } } launch { launch { viewModel.isOverlayContainerVisible.collect { isVisible -> viewModel.isOverlayContainerVisible.collect { isVisible -> overlayContainer.visibility = overlayContainer.visibility = Loading Loading @@ -383,6 +358,13 @@ object KeyguardBottomAreaViewBinder { .setDuration(longPressDurationMs) .setDuration(longPressDurationMs) .withEndAction { .withEndAction { view.setOnClickListener { view.setOnClickListener { vibratorHelper?.vibrate( if (viewModel.isActivated) { Vibrations.Activated } else { Vibrations.Deactivated } ) viewModel.onClicked( viewModel.onClicked( KeyguardQuickAffordanceViewModel.OnClickedParameters( KeyguardQuickAffordanceViewModel.OnClickedParameters( configKey = viewModel.configKey, configKey = viewModel.configKey, Loading