Add a feature flag to expand smartspace to three rows

In order to experiment with presenting more predicted content to the
workspace I have added a flag to expand smartspace to two rows.

This CL does not include any app relocation. If an app lives in a space
the expanded smartspace will occupy, it will be removed from workspace.

Change-Id: I38354dc81a34a495828cf7a69ddb04cc137e2e4e
This commit is contained in:
alexmang
2020-07-24 21:13:24 -07:00
committed by Alex Mang
parent 13a2a010de
commit 6c666fb196
3 changed files with 14 additions and 2 deletions

View File

@@ -139,6 +139,10 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
public static final int DEFAULT_PAGE = 0;
private static final int DEFAULT_SMARTSPACE_HEIGHT = 1;
private static final int EXPANDED_SMARTSPACE_HEIGHT = 2;
private LayoutTransition mLayoutTransition;
@Thunk final WallpaperManager mWallpaperManager;
@@ -507,7 +511,10 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
.inflate(R.layout.search_container_workspace, firstPage, false);
}
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, firstPage.getCountX(), 1);
int cellVSpan = FeatureFlags.EXPANDED_SMARTSPACE.get()
? EXPANDED_SMARTSPACE_HEIGHT : DEFAULT_SMARTSPACE_HEIGHT;
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, firstPage.getCountX(),
cellVSpan);
lp.canReorder = false;
if (!firstPage.addViewToCellLayout(qsb, 0, R.id.search_container_workspace, lp, true)) {
Log.e(TAG, "Failed to add to item at (0, 0) to CellLayout");