summaryrefslogtreecommitdiff
path: root/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java')
-rw-r--r--tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java b/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
index 0d2f252b07..86a7bd3df0 100644
--- a/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
+++ b/tests/src/com/android/launcher3/celllayout/CellLayoutTestUtils.java
@@ -42,8 +42,8 @@ public class CellLayoutTestUtils {
params.getCellX(), params.getCellY(),
launcher.getWorkspace().getIdForScreen(cellLayout), CONTAINER_DESKTOP);
int screenId = pos.screenId;
- if (screenId >= boards.size() - 1) {
- boards.add(new CellLayoutBoard());
+ for (int j = boards.size(); j <= screenId; j++) {
+ boards.add(new CellLayoutBoard(cellLayout.getCountX(), cellLayout.getCountY()));
}
CellLayoutBoard board = boards.get(screenId);
// is icon
@@ -51,7 +51,7 @@ public class CellLayoutTestUtils {
board.addIcon(pos.cellX, pos.cellY);
} else {
// is widget
- board.addWidget(params.getCellX(), params.getCellY(), params.cellHSpan,
+ board.addWidget(pos.cellX, pos.cellY, params.cellHSpan,
params.cellVSpan);
}
}