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

Commit 2bb55f14 authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

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
parent 284f8b62
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,9 @@ object KeyguardBottomAreaVibrations {
        VibrationEffect.startComposition()
        VibrationEffect.startComposition()
            .apply {
            .apply {
                val vibrationDelayMs =
                val vibrationDelayMs =
                    (ShakeAnimationDuration.inWholeMilliseconds / ShakeAnimationCycles * 2).toInt()
                    (ShakeAnimationDuration.inWholeMilliseconds / (ShakeAnimationCycles * 2))
                    .toInt()

                val vibrationCount = ShakeAnimationCycles.toInt() * 2
                val vibrationCount = ShakeAnimationCycles.toInt() * 2
                repeat(vibrationCount) {
                repeat(vibrationCount) {
                    addPrimitive(
                    addPrimitive(