Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java +5 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +10 −1 Original line number Diff line number Diff line Loading @@ -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 Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -192,7 +191,7 @@ public final class SplitWindowManager extends WindowlessWindowManager { mDividerView.setInteractive(interactive, hideHandle, from); } View getDividerView() { DividerView getDividerView() { return mDividerView; } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/DividerViewTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java +5 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +10 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitWindowManager.java +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -192,7 +191,7 @@ public final class SplitWindowManager extends WindowlessWindowManager { mDividerView.setInteractive(interactive, hideHandle, from); } View getDividerView() { DividerView getDividerView() { return mDividerView; } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/DividerViewTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading