Initial changes to restore AllApps.

- Removes unused all apps code due to dynamic grid/spacing
- Attempts to use CellLayout instead of PagedViewCellLayout

Change-Id: I3c49bca9fc35dfeaf250591fd63bc7f36119968f
This commit is contained in:
Winson Chung
2013-09-03 17:48:37 -07:00
parent 2d8de5845b
commit c58497ee61
28 changed files with 434 additions and 347 deletions

View File

@@ -42,7 +42,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
private int mOriginalHeightGap;
private int mWidthGap;
private int mHeightGap;
private int mMaxGap;
protected PagedViewCellLayoutChildren mChildren;
public PagedViewCellLayout(Context context) {
@@ -67,7 +66,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
mCellCountX = (int) grid.numColumns;
mCellCountY = (int) grid.numRows;
mOriginalWidthGap = mOriginalHeightGap = mWidthGap = mHeightGap = -1;
mMaxGap = resources.getDimensionPixelSize(R.dimen.apps_customize_max_gap);
mChildren = new PagedViewCellLayoutChildren(context);
mChildren.setCellDimensions(mCellWidth, mCellHeight);
@@ -184,8 +182,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
int vSpace = heightSpecSize - getPaddingTop() - getPaddingBottom();
int hFreeSpace = hSpace - (mCellCountX * mOriginalCellWidth);
int vFreeSpace = vSpace - (mCellCountY * mOriginalCellHeight);
mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0);
mHeightGap = Math.min(mMaxGap,numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0);
mWidthGap = numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0;
mHeightGap = numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0;
mChildren.setGap(mWidthGap, mHeightGap);
} else {
@@ -493,12 +491,4 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
this.cellHSpan + ", " + this.cellVSpan + ")";
}
}
}
interface Page {
public int getPageChildCount();
public View getChildOnPageAt(int i);
public void removeAllViewsOnPage();
public void removeViewOnPageAt(int i);
public int indexOfChildOnPage(View v);
}
}