Giving custom content full screen

Change-Id: Icd104fff8a1a315b795a60b812048a6218bf0e5a
This commit is contained in:
Adam Cohen
2013-07-23 15:52:40 -07:00
parent bffe745b1e
commit ec40b2b90c
3 changed files with 20 additions and 5 deletions

View File

@@ -92,13 +92,15 @@ public class ShortcutAndWidgetContainer extends ViewGroup {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int count = getChildCount();
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(widthSpecSize, heightSpecSize);
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
measureChild(child);
}
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(widthSpecSize, heightSpecSize);
}
public void setupLp(CellLayout.LayoutParams lp) {
@@ -115,8 +117,15 @@ public class ShortcutAndWidgetContainer extends ViewGroup {
final int cellWidth = mCellWidth;
final int cellHeight = mCellHeight;
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, invertLayoutHorizontally(), mCountX);
if (!lp.isFullscreen) {
lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, invertLayoutHorizontally(),
mCountX);
} else {
lp.x = 0;
lp.y = 0;
lp.width = getMeasuredWidth();
lp.height = getMeasuredHeight();
}
int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);
int childheightMeasureSpec = MeasureSpec.makeMeasureSpec(lp.height,
MeasureSpec.EXACTLY);