Align the lockscreen shortcuts haptics with the animation
The math for `vibrationDelayMs` was slightly off due to order of operations. Bug: b/280825875 Test: manual - tap (not long-press) a lockscreen shortcut, and feel that the vibration starts and ends at the same time as the shake animation. Change-Id: I616e99c484b4509d2a526ab5cd6a2612c93d52a2
This commit is contained in:
@@ -31,7 +31,9 @@ object KeyguardBottomAreaVibrations {
|
||||
VibrationEffect.startComposition()
|
||||
.apply {
|
||||
val vibrationDelayMs =
|
||||
(ShakeAnimationDuration.inWholeMilliseconds / ShakeAnimationCycles * 2).toInt()
|
||||
(ShakeAnimationDuration.inWholeMilliseconds / (ShakeAnimationCycles * 2))
|
||||
.toInt()
|
||||
|
||||
val vibrationCount = ShakeAnimationCycles.toInt() * 2
|
||||
repeat(vibrationCount) {
|
||||
addPrimitive(
|
||||
|
||||
Reference in New Issue
Block a user