Migrate hotseat items into a folder

If feature flag HOTSEAT_MIGRATE_TO_FOLDER is enabled, this moves hotseat
items into a folder in the workspace. If not, it moves the whole hotseat
to the first workspace page that can host the hotseat.

Bug: 151099421
Test: Manual
Change-Id: I49f6a22a0ada2c4cf237ca91a323a46346a11a59
This commit is contained in:
Samuel Fufa
2020-03-09 18:24:47 -07:00
parent ef1d1b93e4
commit 82bbdaceae
9 changed files with 366 additions and 193 deletions

View File

@@ -2766,7 +2766,6 @@ public class CellLayout extends ViewGroup implements Transposable {
* Finds solution to accept hotseat migration to cell layout. commits solution if commitConfig
*/
public boolean makeSpaceForHotseatMigration(boolean commitConfig) {
if (FeatureFlags.HOTSEAT_MIGRATE_NEW_PAGE.get()) return false;
int[] cellPoint = new int[2];
int[] directionVector = new int[]{0, -1};
cellToPoint(0, mCountY, cellPoint);
@@ -2776,12 +2775,23 @@ public class CellLayout extends ViewGroup implements Transposable {
if (commitConfig) {
copySolutionToTempState(configuration, null);
commitTempPlacement();
// undo marking cells occupied since there is actually nothing being placed yet.
mOccupied.markCells(0, mCountY - 1, mCountX, 1, false);
}
return true;
}
return false;
}
/**
* returns a copy of cell layout's grid occupancy
*/
public GridOccupancy cloneGridOccupancy() {
GridOccupancy occupancy = new GridOccupancy(mCountX, mCountY);
mOccupied.copyTo(occupancy);
return occupancy;
}
public boolean isRegionVacant(int x, int y, int spanX, int spanY) {
return mOccupied.isRegionVacant(x, y, spanX, spanY);
}