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

Commit 2345fee5 authored by Winson Chung's avatar Winson Chung
Browse files

Snap to running task if it's offscreen when back is invoked

- If the user has scrolled the running task offscreen, then
  snap back to the task if back is invoked.

Bug: 233952141
Test: Swipe to overview, scroll away from the current task
      and then go back
Change-Id: Icc5040d4b38c97e0329f937e24bd517a71a32f13
parent 0b944f6a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -131,9 +131,14 @@ public class OverviewState extends LauncherState {

    @Override
    public void onBackPressed(Launcher launcher) {
        TaskView taskView = launcher.<RecentsView>getOverviewPanel().getRunningTaskView();
        RecentsView recentsView = launcher.getOverviewPanel();
        TaskView taskView = recentsView.getRunningTaskView();
        if (taskView != null) {
            if (recentsView.isTaskViewFullyVisible(taskView)) {
                taskView.launchTasks();
            } else {
                recentsView.snapToPage(recentsView.indexOfChild(taskView));
            }
        } else {
            super.onBackPressed(launcher);
        }