Prevent x-axis window movement during the initial swipe up to show transient taskbar

- If gesture starts and isLikelyToStartANewTask=true, we do not clamp
- If gesture starts and isLikelyToStartANewTask=false AND transient taskbar is not
  already showing, we clamp the scrolling

Bug: 258851206
Test: swipe up to show taskbar, no x-axis movement
      swipe left/right still works as expected

Change-Id: Iac194df63e03b4a28b49008983c88c165847aa31
This commit is contained in:
Jon Miranda committed 2022-11-18 13:10:34 -08:00
1 parent 193f8992f1
commit 08be3775f6
5 files changed
+55

No files matched your search

@@ -382,6 +382,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
mInteractionHandler.onGestureStarted(isLikelyToStartNewTask);
mInteractionHandler.setTaskbarAlreadyOpen(mTaskbarAlreadyOpen);
if (mIsTransientTaskbar && !mTaskbarAlreadyOpen && !isLikelyToStartNewTask) {
mInteractionHandler.setClampScrollOffset(true);
}
}
private void startTouchTrackingForWindowAnimation(long touchTimeMs) {
@@ -477,6 +480,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
@UiThread
private void onInteractionGestureFinished() {
Preconditions.assertUIThread();
if (mInteractionHandler != null) {
mInteractionHandler.setClampScrollOffset(false);
}
removeListener();
mInteractionHandler = null;
cleanupAfterGesture();