Remove widget panel

- Remove all usage of LEFT_PANEL_ID and fixed left panel code
- For preview renderer, load screen 0 + screen 1 instead
- Added a split display specific default workspace layout, with a placeholder app to pass test before we implement page pairing(b/196376162)
- Known issue: If screenId 1 is deleted, right panel will disappear from Wallpaepr & Style because there is no screenId 1. Will be resovled after page pairing(b/196376162)

Bug: 175939730
Test: manual and TaplTestsLauncher3#testWorkSpace
Change-Id: Icac1c94165c14a49c17897c45355b6cdc4d87e91
This commit is contained in:
Alex Chau committed 2021-08-13 21:48:35 +01:00
1 parent 0cba30e990
commit 1e4484669d
15 files changed
+47 -67

No files matched your search

+3 -26
View File
@@ -36,7 +36,6 @@ import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.LauncherState.NO_SCALE;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.WorkspaceLayoutManager.LEFT_PANEL_ID;
import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions;
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_LAUNCHER_LOAD;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
@@ -2099,19 +2098,12 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
? mWorkspace.getCurrentPageScreenIds() : mPagesToBindSynchronously;
IntArray actualIds = new IntArray();
if (mDeviceProfile.isTwoPanels) {
actualIds.add(LEFT_PANEL_ID);
} else {
visibleIds.remove(LEFT_PANEL_ID);
}
IntSet result = new IntSet();
if (visibleIds.isEmpty()) {
return result;
}
for (int id : orderedScreenIds.toArray()) {
if (id != LEFT_PANEL_ID) {
actualIds.add(id);
}
actualIds.add(id);
}
int firstId = visibleIds.getArray().get(0);
if (actualIds.contains(firstId)) {
@@ -2119,7 +2111,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
if (mDeviceProfile.isTwoPanels) {
int index = actualIds.indexOf(firstId);
int nextIndex = ((int) (index / 2)) * 2;
int nextIndex = (index / 2) * 2;
if (nextIndex == index) {
nextIndex++;
}
@@ -2176,12 +2168,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
@Override
public void bindScreens(IntArray orderedScreenIds) {
// Make sure the first screen is at the start if there's no widget panel,
// or on the second place if the first is the widget panel
boolean isLeftPanelShown =
mWorkspace.mWorkspaceScreens.containsKey(LEFT_PANEL_ID);
int firstScreenPosition = isLeftPanelShown && orderedScreenIds.size() > 1 ? 1 : 0;
int firstScreenPosition = 0;
if (FeatureFlags.QSB_ON_FIRST_SCREEN &&
orderedScreenIds.indexOf(Workspace.FIRST_SCREEN_ID) != firstScreenPosition) {
orderedScreenIds.removeValue(Workspace.FIRST_SCREEN_ID);
@@ -2207,11 +2194,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
continue;
}
if (screenId == LEFT_PANEL_ID) {
// No need to bind the left panel, as its always bound.
continue;
}
mWorkspace.insertNewWorkspaceScreenBeforeEmptyScreen(screenId);
}
}
@@ -2287,11 +2269,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
continue;
}
// Skip if the item is on the left widget panel but the panel is not shown
if (item.screenId == LEFT_PANEL_ID && !getDeviceProfile().isTwoPanels) {
continue;
}
final View view;
switch (item.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION: