launcher: create paddings for foldables

This creates a new padding file that bring some foldables up to spec
with VisD. For 2 panel layouts it now uses workspace margin instead of
cell layout padding.

Bug: 191879424
Fixes: 200035429
Test: checking paddings in HSV
Change-Id: I11b8e1afd76f535368d4c26e31630ce496171e13
This commit is contained in:
Thales Lima
2021-09-23 14:31:00 +01:00
parent 81f168ee7c
commit 7a6752da51
4 changed files with 25 additions and 38 deletions

View File

@@ -638,7 +638,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
private int getPageWidthSize(int widthSize) {
return (widthSize - mInsets.left - mInsets.right) / getPanelCount();
// It's necessary to add the padding back because it is remove when measuring children,
// like when MeasureSpec.getSize in CellLayout.
return (widthSize - mInsets.left - mInsets.right - getPaddingLeft() - getPaddingRight())
/ getPanelCount() + getPaddingLeft() + getPaddingRight();
}
@Override