mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user