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

Commit da615b6a authored by Andreas Agvard's avatar Andreas Agvard Committed by Android (Google) Code Review
Browse files

Merge "Implements shrink animation variant of nav handle" into main

parents 3e12c112 e544d3d3
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