mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Offsetting the CellLayout by the remainder space to center it. (Bug 11030678)
Change-Id: Ib83a982498159c21fef5dd8ecc40ac2287d31c60
This commit is contained in:
@@ -1009,11 +1009,13 @@ public class CellLayout extends ViewGroup {
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
int offset = getMeasuredWidth() - getPaddingLeft() - getPaddingRight() -
|
||||
(mCountX * mCellWidth);
|
||||
int left = getPaddingLeft() + (int) Math.ceil(offset / 2f);
|
||||
int top = getPaddingTop();
|
||||
int count = getChildCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
View child = getChildAt(i);
|
||||
int left = getPaddingLeft();
|
||||
int top = getPaddingTop();
|
||||
child.layout(left, top,
|
||||
left + r - l,
|
||||
top + b - t);
|
||||
|
||||
Reference in New Issue
Block a user