Loading quickstep/src/com/android/quickstep/OverviewCommandHelper.java +23 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.states.InternalStateHandler; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.system.ActivityManagerWrapper; /** Loading Loading @@ -65,6 +66,12 @@ public class OverviewCommandHelper extends InternalStateHandler { homeIntent.setComponent(launcher).setPackage(null); } private void openRecents() { Intent intent = addToIntent(new Intent(homeIntent)); mContext.startActivity(intent); initWhenReady(); } public void onOverviewToggle() { if (DEBUG_START_FALLBACK_ACTIVITY) { mContext.startActivity(new Intent(mContext, RecentsActivity.class) Loading @@ -79,17 +86,30 @@ public class OverviewCommandHelper extends InternalStateHandler { boolean isQuickTap = elapsedTime < ViewConfiguration.getDoubleTapTimeout(); startNonLauncherTask(isQuickTap ? 2 : 1); } else { Intent intent = addToIntent(new Intent(homeIntent)); mContext.startActivity(intent); initWhenReady(); openRecents(); } } public void onOverviewShown() { if (isOverviewAlmostVisible()) { final RecentsView rv = getLauncher().getOverviewPanel(); rv.selectNextTask(); } else { openRecents(); } } public void onOverviewHidden() { final RecentsView rv = getLauncher().getOverviewPanel(); rv.launchCurrentTask(); } private void startNonLauncherTask(int backStackCount) { for (RecentTaskInfo rti : mAM.getRecentTasks(backStackCount, UserHandle.myUserId())) { backStackCount--; if (backStackCount == 0) { mAM.startActivityFromRecents(rti.id, null); break; } } } Loading quickstep/src/com/android/quickstep/TouchInteractionService.java +11 −2 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import com.android.systemui.shared.system.NavigationBarCompat.HitTarget; public class TouchInteractionService extends Service { public static final boolean DEBUG_SHOW_OVERVIEW_BUTTON = false; public static final boolean DEBUG_OPEN_OVERVIEW_VIA_ALT_TAB = false; private static final SparseArray<String> sMotionEventNames; Loading Loading @@ -140,10 +141,18 @@ public class TouchInteractionService extends Service { } @Override public void onOverviewShown(boolean triggeredFromAltTab) { } public void onOverviewShown(boolean triggeredFromAltTab) { if (DEBUG_OPEN_OVERVIEW_VIA_ALT_TAB) { mOverviewCommandHelper.onOverviewShown(); } } @Override public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { } public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { if (DEBUG_OPEN_OVERVIEW_VIA_ALT_TAB) { mOverviewCommandHelper.onOverviewHidden(); } } }; private final TouchConsumer mNoOpTouchConsumer = (ev) -> {}; Loading quickstep/src/com/android/quickstep/views/RecentsView.java +23 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.os.Build; import android.util.ArraySet; import android.util.AttributeSet; import android.util.SparseBooleanArray; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; Loading Loading @@ -607,4 +608,26 @@ public abstract class RecentsView<T extends BaseActivity> anim.setDuration(duration).setInterpolator(interpolator); set.play(anim); } @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_TAB && event.getAction() == KeyEvent.ACTION_DOWN) { setCurrentPage((getCurrentPage() + (event.isShiftPressed() ? getPageCount() - 1 : 1)) % getPageCount()); loadVisibleTaskData(); return true; } return super.dispatchKeyEvent(event); } public void selectNextTask() { setCurrentPage((getCurrentPage() + 1) % getPageCount()); loadVisibleTaskData(); } public void launchCurrentTask() { final TaskView currentTask = (TaskView) getChildAt(getCurrentPage()); currentTask.launchTask(true); } } Loading
quickstep/src/com/android/quickstep/OverviewCommandHelper.java +23 −3 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.states.InternalStateHandler; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.system.ActivityManagerWrapper; /** Loading Loading @@ -65,6 +66,12 @@ public class OverviewCommandHelper extends InternalStateHandler { homeIntent.setComponent(launcher).setPackage(null); } private void openRecents() { Intent intent = addToIntent(new Intent(homeIntent)); mContext.startActivity(intent); initWhenReady(); } public void onOverviewToggle() { if (DEBUG_START_FALLBACK_ACTIVITY) { mContext.startActivity(new Intent(mContext, RecentsActivity.class) Loading @@ -79,17 +86,30 @@ public class OverviewCommandHelper extends InternalStateHandler { boolean isQuickTap = elapsedTime < ViewConfiguration.getDoubleTapTimeout(); startNonLauncherTask(isQuickTap ? 2 : 1); } else { Intent intent = addToIntent(new Intent(homeIntent)); mContext.startActivity(intent); initWhenReady(); openRecents(); } } public void onOverviewShown() { if (isOverviewAlmostVisible()) { final RecentsView rv = getLauncher().getOverviewPanel(); rv.selectNextTask(); } else { openRecents(); } } public void onOverviewHidden() { final RecentsView rv = getLauncher().getOverviewPanel(); rv.launchCurrentTask(); } private void startNonLauncherTask(int backStackCount) { for (RecentTaskInfo rti : mAM.getRecentTasks(backStackCount, UserHandle.myUserId())) { backStackCount--; if (backStackCount == 0) { mAM.startActivityFromRecents(rti.id, null); break; } } } Loading
quickstep/src/com/android/quickstep/TouchInteractionService.java +11 −2 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ import com.android.systemui.shared.system.NavigationBarCompat.HitTarget; public class TouchInteractionService extends Service { public static final boolean DEBUG_SHOW_OVERVIEW_BUTTON = false; public static final boolean DEBUG_OPEN_OVERVIEW_VIA_ALT_TAB = false; private static final SparseArray<String> sMotionEventNames; Loading Loading @@ -140,10 +141,18 @@ public class TouchInteractionService extends Service { } @Override public void onOverviewShown(boolean triggeredFromAltTab) { } public void onOverviewShown(boolean triggeredFromAltTab) { if (DEBUG_OPEN_OVERVIEW_VIA_ALT_TAB) { mOverviewCommandHelper.onOverviewShown(); } } @Override public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { } public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { if (DEBUG_OPEN_OVERVIEW_VIA_ALT_TAB) { mOverviewCommandHelper.onOverviewHidden(); } } }; private final TouchConsumer mNoOpTouchConsumer = (ev) -> {}; Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +23 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.os.Build; import android.util.ArraySet; import android.util.AttributeSet; import android.util.SparseBooleanArray; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; Loading Loading @@ -607,4 +608,26 @@ public abstract class RecentsView<T extends BaseActivity> anim.setDuration(duration).setInterpolator(interpolator); set.play(anim); } @Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_TAB && event.getAction() == KeyEvent.ACTION_DOWN) { setCurrentPage((getCurrentPage() + (event.isShiftPressed() ? getPageCount() - 1 : 1)) % getPageCount()); loadVisibleTaskData(); return true; } return super.dispatchKeyEvent(event); } public void selectNextTask() { setCurrentPage((getCurrentPage() + 1) % getPageCount()); loadVisibleTaskData(); } public void launchCurrentTask() { final TaskView currentTask = (TaskView) getChildAt(getCurrentPage()); currentTask.launchTask(true); } }