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

Commit e544d3d3 authored by Andreas Agvard's avatar Andreas Agvard
Browse files

Implements shrink animation variant of nav handle

Fix: 314158312
Flag: LEGACY SHRINK_NAV_HANDLE_ON_PRESS DISABLED
Test: Manual

Change-Id: I98ebb2b6404c17cdb60b070533f86da46197d3a7
parent 72aff162
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
    <!-- Used while animating the navbar during a long press. -->
    <dimen name="navigation_home_handle_additional_width_for_animation">20dp</dimen>
    <dimen name="navigation_home_handle_additional_height_for_animation">4dp</dimen>
    <dimen name="navigation_home_handle_shrink_width_for_animation">16dp</dimen>

    <!-- Size of the nav bar edge panels, should be greater to the
         edge sensitivity + the drag threshold -->
+2 −1
Original line number Diff line number Diff line
@@ -149,10 +149,11 @@ interface ISystemUiProxy {
     *
     * @param isTouchDown {@code true} if the button is starting to be pressed ({@code false} if
     *                                released or canceled)
     * @param shrink {@code true} if the handle should shrink, {@code false} if it should grow
     * @param durationMs how long the animation should take (for the {@code isTouchDown} case, this
     *                   should be the same as the amount of time to trigger a long-press)
     */
    oneway void animateNavBarLongPress(boolean isTouchDown, long durationMs) = 54;
    oneway void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) = 54;

    // Next id = 55
}
+2 −2
Original line number Diff line number Diff line
@@ -400,8 +400,8 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        }

        @Override
        public void animateNavBarLongPress(boolean isTouchDown, long durationMs) {
            mView.getHomeHandle().animateLongPress(isTouchDown, durationMs);
        public void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) {
            mView.getHomeHandle().animateLongPress(isTouchDown, shrink, durationMs);
        }

        @Override
+2 −2
Original line number Diff line number Diff line
@@ -247,10 +247,10 @@ public class ButtonDispatcher {
        }
    }

    public void animateLongPress(boolean isTouchDown, long durationMs) {
    public void animateLongPress(boolean isTouchDown, boolean shrink, long durationMs) {
        for (int i = 0; i < mViews.size(); i++) {
            if (mViews.get(i) instanceof ButtonInterface) {
                ((ButtonInterface) mViews.get(i)).animateLongPress(isTouchDown, durationMs);
                ((ButtonInterface) mViews.get(i)).animateLongPress(isTouchDown, shrink, durationMs);
            }
        }
    }
+5 −4
Original line number Diff line number Diff line
@@ -36,8 +36,9 @@ public interface ButtonInterface {
     *
     * @param isTouchDown {@code true} if the button is starting to be pressed ({@code false} if
     *                    released or canceled)
     * @param shrink      {@code true} if the handle should shrink, {@code false} if it should grow
     * @param durationMs  how long the animation should take (for the {@code isTouchDown} case, this
     *                    should be the same as the amount of time to trigger a long-press)
     */
    default void animateLongPress(boolean isTouchDown, long durationMs) {}
    default void animateLongPress(boolean isTouchDown, boolean shrink, long durationMs) {}
}
Loading