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

Commit 8eb5649e authored by Jeremy Sim's avatar Jeremy Sim Committed by Android (Google) Code Review
Browse files

Merge "Fix janky movement when resizing split windows" into main

parents 76b198e6 272e9abe
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -492,6 +492,11 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
        return mHideHandle;
    }

    /** Returns true if the divider is currently being physically controlled by the user. */
    boolean isMoving() {
        return mMoving;
    }

    private class DoubleTapListener extends GestureDetector.SimpleOnGestureListener {
        @Override
        public boolean onDoubleTap(MotionEvent e) {
+10 −1
Original line number Diff line number Diff line
@@ -652,9 +652,18 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
                .ofInt(from, to)
                .setDuration(duration);
        mDividerFlingAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);

        // If the divider is being physically controlled by the user, we use a cool parallax effect
        // on the task windows. So if this "snap" animation is an extension of a user-controlled
        // movement, we pass in true here to continue the parallax effect smoothly.
        boolean isBeingMovedByUser = mSplitWindowManager.getDividerView() != null
                && mSplitWindowManager.getDividerView().isMoving();

        mDividerFlingAnimator.addUpdateListener(
                animation -> updateDividerBounds(
                        (int) animation.getAnimatedValue(), false /* shouldUseParallaxEffect */)
                        (int) animation.getAnimatedValue(),
                        isBeingMovedByUser /* shouldUseParallaxEffect */
                )
        );
        mDividerFlingAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
+1 −2
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import android.view.LayoutInflater;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
import android.view.SurfaceSession;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;

@@ -192,7 +191,7 @@ public final class SplitWindowManager extends WindowlessWindowManager {
        mDividerView.setInteractive(interactive, hideHandle, from);
    }

    View getDividerView() {
    DividerView getDividerView() {
        return mDividerView;
    }

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class DividerViewTest extends ShellTestCase {
                mContext,
                configuration, mCallbacks);
        splitWindowManager.init(mSplitLayout, new InsetsState(), false /* isRestoring */);
        mDividerView = spy((DividerView) splitWindowManager.getDividerView());
        mDividerView = spy(splitWindowManager.getDividerView());
    }

    @Test