Removing layout handling in DeviceProfile and moving it to

individual views

Bug: 71709920
Change-Id: I8300fa7a84b31898bdb135d774cca576d2928525
This commit is contained in:
Sunny Goyal
2018-01-08 14:19:34 -08:00
parent 228153d92a
commit 07b6929cd9
19 changed files with 228 additions and 332 deletions
+14
View File
@@ -310,6 +310,20 @@ public class Workspace extends PagedView
@Override
public void setInsets(Rect insets) {
mInsets.set(insets);
DeviceProfile grid = mLauncher.getDeviceProfile();
Rect padding = grid.workspacePadding;
setPadding(padding.left, padding.top, padding.right, padding.bottom);
if (grid.shouldFadeAdjacentWorkspaceScreens()) {
// In landscape mode the page spacing is set to the default.
setPageSpacing(grid.defaultPageSpacingPx);
} else {
// In portrait, we want the pages spaced such that there is no
// overhang of the previous / next page into the current page viewport.
// We assume symmetrical padding in portrait mode.
setPageSpacing(Math.max(grid.defaultPageSpacingPx, padding.left + 1));
}
}
/**