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

Commit 151d4823 authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

Set shortcuts back to original position after shaking

Due to the nature of the "shake" animation, the shortcuts were ending up
a few pixels to the left from their original location after the
animation ended.

Additionally update the horizontal position of the shortcuts, per design
spec change to align them with notifications.

Fixes: 301079105
Fixes: 298964750
Test: manual - turn show layout bounds on. Tap shortcut to initiate shake, observe that the shortcut goes back to its original position after shaking
Test: manual - notice that the shortcuts are moved outwards as expected
Change-Id: I493ed2f6744d06ab3abc9bd992edfd1c73ec85a6
parent f00f4b39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -846,7 +846,7 @@
    <!-- Amount the button should shake when it's not long-pressed for long enough. -->
    <dimen name="keyguard_affordance_shake_amplitude">8dp</dimen>

    <dimen name="keyguard_affordance_horizontal_offset">32dp</dimen>
    <dimen name="keyguard_affordance_horizontal_offset">16dp</dimen>
    <dimen name="keyguard_affordance_vertical_offset">32dp</dimen>
    <!-- Value should be at least sum of 'keyguard_affordance_width' +
         'keyguard_affordance_horizontal_offset' -->
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.util.doOnEnd
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
@@ -402,6 +403,9 @@ object KeyguardBottomAreaViewBinder {
                        KeyguardBottomAreaVibrations.ShakeAnimationDuration.inWholeMilliseconds
                    shakeAnimator.interpolator =
                        CycleInterpolator(KeyguardBottomAreaVibrations.ShakeAnimationCycles)
                    shakeAnimator.doOnEnd {
                        view.translationX = 0f
                    }
                    shakeAnimator.start()

                    vibratorHelper?.vibrate(KeyguardBottomAreaVibrations.Shake)
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordanceViewMod
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.util.doOnEnd
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.combine
@@ -240,6 +241,9 @@ object KeyguardQuickAffordanceViewBinder {
                        KeyguardBottomAreaVibrations.ShakeAnimationDuration.inWholeMilliseconds
                    shakeAnimator.interpolator =
                        CycleInterpolator(KeyguardBottomAreaVibrations.ShakeAnimationCycles)
                    shakeAnimator.doOnEnd {
                        view.translationX = 0f
                    }
                    shakeAnimator.start()

                    vibratorHelper?.vibrate(KeyguardBottomAreaVibrations.Shake)