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

Commit 0d7dc94d authored by Tony Huang's avatar Tony Huang
Browse files

Fix divider visibility issue on transient taskbar

On legacy case, we hide divider bar when gesture start, but this
might cause divider hidden when transient taskbar case.
We should follow the timing it actually start entering overview
then hide divider.

Fix: 261376202
Test: manual
Test: pass existing tests
Change-Id: Iae1339ae0b42033075dd840fc071ba28a7d3e13a
parent a1808c3e
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    private final boolean mIsTransientTaskbar;
    // May be set to false when mIsTransientTaskbar is true.
    private boolean mCanSlowSwipeGoHome = true;
    private boolean mHasReachedOverviewThreshold = false;

    public AbsSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState,
            TaskAnimationManager taskAnimationManager, GestureState gestureState,
@@ -762,6 +763,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

    private void setIsLikelyToStartNewTask(boolean isLikelyToStartNewTask, boolean animate) {
        if (mIsLikelyToStartNewTask != isLikelyToStartNewTask) {
            if (isLikelyToStartNewTask && mIsTransientTaskbar) {
                setDividerShown(false /* shown */, true /* immediate */);
            }

            mIsLikelyToStartNewTask = isLikelyToStartNewTask;
            maybeUpdateRecentsAttachedState(animate);
        }
@@ -1656,8 +1661,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        mRecentsAnimationController.enableInputConsumer();

        // Start hiding the divider
        if (!mIsTransientTaskbar || mTaskbarAlreadyOpen || mIsTaskbarAllAppsOpen) {
            setDividerShown(false /* shown */, true /* immediate */);
        }
    }

    private void computeRecentsScrollIfInvisible() {
        if (mRecentsView != null && mRecentsView.getVisibility() != View.VISIBLE) {
@@ -2288,6 +2295,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

        // "Catch up" with the displacement at mTaskbarCatchUpThreshold.
        if (displacement < mTaskbarCatchUpThreshold) {
            if (!mHasReachedOverviewThreshold) {
                setDividerShown(false /* shown */, true /* immediate */);
                mHasReachedOverviewThreshold = true;
            }
            return Utilities.mapToRange(displacement, mTaskbarAppWindowThreshold,
                    mTaskbarCatchUpThreshold, 0, mTaskbarCatchUpThreshold, ACCEL_DEACCEL);
        }