mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Add the KeyboardQuickSwitchView (2/2)
Adding KeyboardQuickSwitchView and associated flows. Test: Manually tested alt-tab and alt-shift-tab in and out of overview on a tablet and phone Bug: 258854035 Change-Id: Ifb48b005067b3a9c66acfd5ecdbae144b359d3be
This commit is contained in:
@@ -31,7 +31,10 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.statemanager.StatefulActivity;
|
||||
import com.android.launcher3.taskbar.TaskbarUIController;
|
||||
import com.android.launcher3.util.RunnableList;
|
||||
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
@@ -174,8 +177,25 @@ public class OverviewCommandHelper {
|
||||
mOverviewComponentObserver.getActivityInterface();
|
||||
RecentsView recents = activityInterface.getVisibleRecentsView();
|
||||
if (recents == null) {
|
||||
T activity = activityInterface.getCreatedActivity();
|
||||
DeviceProfile dp = activity == null ? null : activity.getDeviceProfile();
|
||||
TaskbarUIController uiController = activityInterface.getTaskbarController();
|
||||
boolean allowQuickSwitch = FeatureFlags.ENABLE_KEYBOARD_QUICK_SWITCH.get()
|
||||
&& uiController != null
|
||||
&& dp != null
|
||||
&& (dp.isTablet || dp.isTwoPanels);
|
||||
|
||||
if (cmd.type == TYPE_HIDE) {
|
||||
// already hidden
|
||||
if (!allowQuickSwitch) {
|
||||
return true;
|
||||
}
|
||||
mTaskFocusIndexOverride = uiController.launchFocusedTask();
|
||||
if (mTaskFocusIndexOverride == -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (cmd.type == TYPE_KEYBOARD_INPUT && allowQuickSwitch) {
|
||||
uiController.openQuickSwitchView();
|
||||
return true;
|
||||
}
|
||||
if (cmd.type == TYPE_HOME) {
|
||||
|
||||
Reference in New Issue
Block a user