mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Enable support for same page hotseat migration
Bug: 142753423 Test: Manual Change-Id: Ib53a64629a595c412e30ca5ff46077efc73a3f3e
This commit is contained in:
@@ -2783,6 +2783,26 @@ public class CellLayout extends ViewGroup implements Transposable {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
ItemConfiguration configuration = new ItemConfiguration();
|
||||
if (findReorderSolution(cellPoint[0], cellPoint[1], mCountX, 1, mCountX, 1,
|
||||
directionVector, null, false, configuration).isSolution) {
|
||||
if (commitConfig) {
|
||||
copySolutionToTempState(configuration, null);
|
||||
commitTempPlacement();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isRegionVacant(int x, int y, int spanX, int spanY) {
|
||||
return mOccupied.isRegionVacant(x, y, spanX, spanY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user