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

Commit 12053e95 authored by Jon Miranda's avatar Jon Miranda Committed by Android (Google) Code Review
Browse files

Merge "Fix window x-axis movement after gesture ends." into tm-qpr-dev

parents 18d56341 6811fe8a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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);
+5 −5
Original line number Diff line number Diff line
@@ -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);
    }

    /**