Properly set at glance cellHspan

This commit is contained in:
MrSluffy
2023-11-01 14:51:38 +08:00
parent 7a23ea7d17
commit acb3afa1f3
2 changed files with 2 additions and 5 deletions
+1 -1
View File
@@ -666,7 +666,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
.inflate(smartspaceMode.getLayoutResourceId(), firstPage, false);
}
int cellHSpan = mLauncher.getDeviceProfile().inv.numSearchContainerColumns;
int cellHSpan = mLauncher.getDeviceProfile().inv.numColumns;
CellLayoutLayoutParams lp = new CellLayoutLayoutParams(0, 0, cellHSpan, 1);
lp.canReorder = false;
if (!firstPage.addViewToCellLayout(
@@ -593,13 +593,10 @@ public class LauncherPreviewRenderer extends ContextWrapper
// Add first page QSB
if (FeatureFlags.topQsbOnFirstScreenEnabled (mContext)) {
CellLayout firstScreen = mWorkspaceScreens.get(FIRST_SCREEN_ID);
// View qsb = mHomeElementInflater.inflate(R.layout.qsb_preview, firstScreen, false);
// CellLayoutLayoutParams lp = new CellLayoutLayoutParams(
// 0, 0, firstScreen.getCountX(), 1);
View qsb = mHomeElementInflater.inflate(mWorkspaceSearchContainer, firstScreen,
false);
CellLayoutLayoutParams lp =
new CellLayoutLayoutParams(0, 0, 1, 1);
new CellLayoutLayoutParams(0, 0, mDp.inv.numColumns, 1);
lp.canReorder = false;
firstScreen.addViewToCellLayout(qsb, 0, R.id.search_container_workspace, lp, true);
}