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

Commit 5c6bdbbc authored by Winson's avatar Winson
Browse files

Fixing regression, reset AllApps when the screen turns off.

- Now that we are debouncing the workspace state, we were no longer resetting
  the all apps view when the screen turns off when the user is already on the
  workspace.

Bug: 23759455
Change-Id: I996b595945de96ae6ff2344349027d4722921984
parent 7412c3cb
Loading
Loading
Loading
Loading
+24 −8
Original line number Original line Diff line number Diff line
@@ -1614,7 +1614,10 @@ public class Launcher extends Activity
                // processing a multi-step drop
                // processing a multi-step drop
                if (mAppsView != null && mWidgetsView != null &&
                if (mAppsView != null && mWidgetsView != null &&
                        mPendingAddInfo.container == ItemInfo.NO_ID) {
                        mPendingAddInfo.container == ItemInfo.NO_ID) {
                    showWorkspace(false);
                    if (!showWorkspace(false)) {
                        // If we are already on the workspace, then manually reset all apps
                        mAppsView.reset();
                    }
                }
                }
            } else if (Intent.ACTION_USER_PRESENT.equals(action)) {
            } else if (Intent.ACTION_USER_PRESENT.equals(action)) {
                mUserPresent = true;
                mUserPresent = true;
@@ -3259,20 +3262,32 @@ public class Launcher extends Activity
        }
        }
    }
    }


    public void showWorkspace(boolean animated) {
    /**
        showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated, null);
     * @return whether or not the Launcher state changed.
     */
    public boolean showWorkspace(boolean animated) {
        return showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated, null);
    }
    }


    public void showWorkspace(boolean animated, Runnable onCompleteRunnable) {
    /**
        showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
     * @return whether or not the Launcher state changed.
     */
    public boolean showWorkspace(boolean animated, Runnable onCompleteRunnable) {
        return showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
                onCompleteRunnable);
                onCompleteRunnable);
    }
    }


    protected void showWorkspace(int snapToPage, boolean animated) {
    /**
        showWorkspace(snapToPage, animated, null);
     * @return whether or not the Launcher state changed.
     */
    protected boolean showWorkspace(int snapToPage, boolean animated) {
        return showWorkspace(snapToPage, animated, null);
    }
    }


    void showWorkspace(int snapToPage, boolean animated, Runnable onCompleteRunnable) {
    /**
     * @return whether or not the Launcher state changed.
     */
    boolean showWorkspace(int snapToPage, boolean animated, Runnable onCompleteRunnable) {
        boolean changed = mState != State.WORKSPACE ||
        boolean changed = mState != State.WORKSPACE ||
                mWorkspace.getState() != Workspace.State.NORMAL;
                mWorkspace.getState() != Workspace.State.NORMAL;
        if (changed) {
        if (changed) {
@@ -3298,6 +3313,7 @@ public class Launcher extends Activity
            getWindow().getDecorView()
            getWindow().getDecorView()
                    .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
                    .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
        }
        }
        return changed;
    }
    }


    void showOverviewMode(boolean animated) {
    void showOverviewMode(boolean animated) {
+10 −3
Original line number Original line Diff line number Diff line
@@ -290,6 +290,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
        }
        }
    }
    }


    /**
     * Resets the state of AllApps.
     */
    public void reset() {
        // Reset the search bar and base recycler view after transitioning home
        mSearchBarController.reset();
        mAppsRecyclerView.reset();
    }

    @Override
    @Override
    protected void onFinishInflate() {
    protected void onFinishInflate() {
        super.onFinishInflate();
        super.onFinishInflate();
@@ -555,9 +564,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
    @Override
    @Override
    public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
    public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) {
        if (toWorkspace) {
        if (toWorkspace) {
            // Reset the search bar and base recycler view after transitioning home
            reset();
            mSearchBarController.reset();
            mAppsRecyclerView.reset();
        }
        }
    }
    }