Merge "Launching last task when back button is pressed in overview" into ub-launcher3-master
This commit is contained in:
commit
7fee2a82e4
5 files changed
+31
-17
No files matched your search
@@ -1606,14 +1606,8 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
|
||||
AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(this);
|
||||
if (topView != null && topView.onBackPressed()) {
|
||||
// Handled by the floating view.
|
||||
} else if (!isInState(NORMAL)) {
|
||||
LauncherState lastState = mStateManager.getLastState();
|
||||
ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType,
|
||||
lastState.containerType);
|
||||
mStateManager.goToState(lastState);
|
||||
} else {
|
||||
// Back button is a no-op here, but give at least some feedback for the button press
|
||||
mWorkspace.showOutlinesTemporarily();
|
||||
mStateManager.getState().onBackPressed(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.android.launcher3.uioverrides.AllAppsState;
|
||||
import com.android.launcher3.uioverrides.FastOverviewState;
|
||||
import com.android.launcher3.uioverrides.OverviewState;
|
||||
import com.android.launcher3.uioverrides.UiFactory;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -251,6 +252,16 @@ public class LauncherState {
|
||||
}
|
||||
}
|
||||
|
||||
public void onBackPressed(Launcher launcher) {
|
||||
if (this != NORMAL) {
|
||||
LauncherStateManager lsm = launcher.getStateManager();
|
||||
LauncherState lastState = lsm.getLastState();
|
||||
launcher.getUserEventDispatcher().logActionCommand(Action.Command.BACK,
|
||||
containerType, lastState.containerType);
|
||||
lsm.goToState(lastState);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void dispatchWindowStateChanged(Launcher launcher) {
|
||||
launcher.getWindow().getDecorView().sendAccessibilityEvent(TYPE_WINDOW_STATE_CHANGED);
|
||||
}
|
||||
|
||||
@@ -1291,12 +1291,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
}
|
||||
}
|
||||
|
||||
public void showOutlinesTemporarily() {
|
||||
if (!mIsPageInTransition && !isTouchActive()) {
|
||||
snapToPage(mCurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePageAlphaValues() {
|
||||
// We need to check the isDragging case because updatePageAlphaValues is called between
|
||||
// goToState(SPRING_LOADED) and onStartStateTransition.
|
||||
|
||||
Reference in new issue
Block a user