Initial changes to support AllApps on various form factors.

Change-Id: I7bacb36f8a70c8ac920426899193a7bb7b7abbcb
This commit is contained in:
Winson Chung
2013-10-31 16:53:19 -07:00
parent d77057a77b
commit 67ca7e4cc5
9 changed files with 100 additions and 27 deletions

View File

@@ -187,6 +187,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private PagedViewCellLayout mWidgetSpacingLayout;
private int mNumAppsPages;
private int mNumWidgetPages;
private Rect mAllAppsPadding = new Rect();
// Relating to the scroll and overscroll effects
Workspace.ZInterpolator mZInterpolator = new Workspace.ZInterpolator(0.5f);
@@ -293,6 +294,13 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
grid.edgeMarginPx, 2 * grid.edgeMarginPx);
}
void setAllAppsPadding(Rect r) {
mAllAppsPadding.set(r);
}
void setWidgetsPageIndicatorPadding(int pageIndicatorHeight) {
mPageLayoutPaddingBottom = pageIndicatorHeight;
}
/** Returns the item index of the center item on this page so that we can restore to this
* item index when we rotate. */
private int getMiddleComponentIndexOnCurrentPage() {
@@ -995,6 +1003,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST);
layout.setMinimumWidth(getPageContentWidth());
layout.measure(widthSpec, heightSpec);
layout.setPadding(mAllAppsPadding.left, mAllAppsPadding.top, mAllAppsPadding.right,
mAllAppsPadding.bottom);
setVisibilityOnChildren(layout, View.VISIBLE);
}