mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Merge "Fix window x-axis movement after gesture ends." into tm-qpr-dev am: 12053e958f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20590521 Change-Id: Ia8007f6d5d36d59292cf53233f20c244322099aa Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1204,7 +1204,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
final GestureEndTarget endTarget = calculateEndTarget(velocity, endVelocity,
|
||||
isFling, isCancel);
|
||||
|
||||
setClampScrollOffset(false);
|
||||
// Set the state, but don't notify until the animation completes
|
||||
mGestureState.setEndTarget(endTarget, false /* isAtomic */);
|
||||
mAnimationFactory.setEndTarget(endTarget);
|
||||
@@ -1282,13 +1281,16 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
|
||||
// Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
|
||||
// or resumeLastTask().
|
||||
Runnable onPageTransitionEnd = () -> {
|
||||
mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
|
||||
setClampScrollOffset(false);
|
||||
};
|
||||
if (mRecentsView != null) {
|
||||
ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
|
||||
.SET_ON_PAGE_TRANSITION_END_CALLBACK);
|
||||
mRecentsView.setOnPageTransitionEndCallback(
|
||||
() -> mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED));
|
||||
mRecentsView.setOnPageTransitionEndCallback(onPageTransitionEnd);
|
||||
} else {
|
||||
mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
|
||||
onPageTransitionEnd.run();
|
||||
}
|
||||
|
||||
animateToProgress(startShift, endShift, duration, interpolator, endTarget, velocity);
|
||||
|
||||
@@ -5072,15 +5072,15 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
* Returns how many pixels the page is offset on the currently laid out dominant axis.
|
||||
*/
|
||||
public int getScrollOffset(int pageIndex) {
|
||||
int unboundedOffset = getUnclampedScrollOffset(pageIndex);
|
||||
int unclampedOffset = getUnclampedScrollOffset(pageIndex);
|
||||
if (!mShouldClampScrollOffset) {
|
||||
return unboundedOffset;
|
||||
return unclampedOffset;
|
||||
}
|
||||
if (Math.abs(unboundedOffset) < mClampedScrollOffsetBound) {
|
||||
if (Math.abs(unclampedOffset) < mClampedScrollOffsetBound) {
|
||||
return 0;
|
||||
}
|
||||
return unboundedOffset
|
||||
- Math.round(Math.signum(unboundedOffset) * mClampedScrollOffsetBound);
|
||||
return unclampedOffset
|
||||
- Math.round(Math.signum(unclampedOffset) * mClampedScrollOffsetBound);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user