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

Commit 034ce6fd authored by Winson Chung's avatar Winson Chung
Browse files

Update shelf offset earlier when in gesture nav

- Provide a hint to Launcher to indicate it will be resumed when
  swiping home, which allows us to notify sysui before any potential
  pip invocation, reducing the likelyhood of two conflicting animations
  when entering pip

Bug: 156637223
Change-Id: Iae773e1aac88bbea6f74e1d1332417b448126471
parent 1801d19b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        onStateOrResumeChanged();
        onStateOrResumeChanging(false /* inTransition */);
    }

    @Override
@@ -115,11 +115,9 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
    @Override
    protected void onActivityFlagsChanged(int changeBits) {
        super.onActivityFlagsChanged(changeBits);

        if ((changeBits & (ACTIVITY_STATE_DEFERRED_RESUMED | ACTIVITY_STATE_STARTED
                | ACTIVITY_STATE_USER_ACTIVE | ACTIVITY_STATE_TRANSITION_ACTIVE)) != 0
                && (getActivityFlags() & ACTIVITY_STATE_TRANSITION_ACTIVE) == 0) {
            onStateOrResumeChanged();
                | ACTIVITY_STATE_USER_ACTIVE | ACTIVITY_STATE_TRANSITION_ACTIVE)) != 0) {
            onStateOrResumeChanging((getActivityFlags() & ACTIVITY_STATE_TRANSITION_ACTIVE) == 0);
        }

        if (mHotseatPredictionController != null && ((changeBits & ACTIVITY_STATE_STARTED) != 0
@@ -164,14 +162,16 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
    /**
     * Recents logic that triggers when launcher state changes or launcher activity stops/resumes.
     */
    private void onStateOrResumeChanged() {
    private void onStateOrResumeChanging(boolean inTransition) {
        LauncherState state = getStateManager().getState();
        DeviceProfile profile = getDeviceProfile();
        boolean visible = (state == NORMAL || state == OVERVIEW) && isUserActive()
        boolean willUserBeActive = (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0;
        boolean visible = (state == NORMAL || state == OVERVIEW)
                && (willUserBeActive || isUserActive())
                && !profile.isVerticalBarLayout();
        UiThreadHelper.runAsyncCommand(this, SET_SHELF_HEIGHT, visible ? 1 : 0,
                profile.hotseatBarSizePx);
        if (state == NORMAL) {
        if (state == NORMAL && !inTransition) {
            ((RecentsView) getOverviewPanel()).setSwipeDownShouldLaunchApp(false);
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -290,6 +290,11 @@ public final class LauncherActivityInterface extends
        return true;
    }

    @Override
    public void setHintUserWillBeActive() {
        getCreatedActivity().setHintUserWillBeActive();
    }

    @Override
    public boolean deferStartingActivity(RecentsAnimationDeviceState deviceState, MotionEvent ev) {
        return deviceState.isInDeferredGestureRegion(ev);
+1 −0
Original line number Diff line number Diff line
@@ -939,6 +939,7 @@ public class LauncherSwipeHandler extends BaseSwipeUpHandler<Launcher, RecentsVi
                        : null;

                mActivity.getRootView().setForceHideBackArrow(true);
                mActivityInterface.setHintUserWillBeActive();

                homeAnimFactory = new HomeAnimationFactory(floatingIconView) {

+4 −0
Original line number Diff line number Diff line
@@ -304,4 +304,8 @@ public abstract class BaseQuickstepLauncher extends Launcher
    public ShelfPeekAnim getShelfPeekAnim() {
        return mShelfPeekAnim;
    }

    public void setHintUserWillBeActive() {
        addActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -174,6 +174,8 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
        recentsView.switchToScreenshot(thumbnailData, runnable);
    }

    public void setHintUserWillBeActive() {}

    /**
     * Sets the expected window size in multi-window mode
     */
Loading