mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Adding animation so the CellLayout is properly spaced on Foldables
Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED Fix: 294841331 Test: atest HomeScreenEditStateImageTest Change-Id: I5dc94b63ca322748b952ce4bd55b6951d51d190f
This commit is contained in:
@@ -349,7 +349,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
setPageSpacing(Math.max(maxInsets, maxPadding));
|
||||
}
|
||||
|
||||
updateCellLayoutPadding();
|
||||
updateCellLayoutMeasures();
|
||||
updateWorkspaceWidgetsSizes();
|
||||
setPageIndicatorInset();
|
||||
}
|
||||
@@ -373,10 +373,12 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
mPageIndicator.setLayoutParams(lp);
|
||||
}
|
||||
|
||||
private void updateCellLayoutPadding() {
|
||||
private void updateCellLayoutMeasures() {
|
||||
Rect padding = mLauncher.getDeviceProfile().cellLayoutPaddingPx;
|
||||
mWorkspaceScreens.forEach(
|
||||
s -> s.setPadding(padding.left, padding.top, padding.right, padding.bottom));
|
||||
mWorkspaceScreens.forEach(cellLayout -> {
|
||||
cellLayout.setPadding(padding.left, padding.top, padding.right, padding.bottom);
|
||||
cellLayout.setSpaceBetweenCellLayoutsPx(getPageSpacing() / 4);
|
||||
});
|
||||
}
|
||||
|
||||
private void updateWorkspaceWidgetsSizes() {
|
||||
@@ -690,7 +692,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
mLauncher.getStateManager().getState(), newScreen, insertIndex);
|
||||
|
||||
updatePageScrollValues();
|
||||
updateCellLayoutPadding();
|
||||
updateCellLayoutMeasures();
|
||||
return newScreen;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user