DO NOT MERGE Dynamically determine size of customize tray.
This commit is contained in:
1 parent
e72300ee59
commit
1a0093367d
10 files changed
+139
-52
No files matched your search
@@ -70,6 +70,8 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||
private int mLastMeasureWidth = -1;
|
||||
private int mLastMeasureHeight = -1;
|
||||
|
||||
private int mMaxCellCountY;
|
||||
|
||||
public AllAppsPagedView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -87,7 +89,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||
a.recycle();
|
||||
setSoundEffectsEnabled(false);
|
||||
|
||||
Resources r = context.getResources();
|
||||
final Resources r = context.getResources();
|
||||
setDragSlopeThreshold(
|
||||
r.getInteger(R.integer.config_allAppsDrawerDragSlopeThreshold) / 100.0f);
|
||||
|
||||
@@ -95,6 +97,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||
PagedViewCellLayout layout = new PagedViewCellLayout(getContext());
|
||||
setupPage(layout);
|
||||
mPageContentWidth = layout.getContentWidth();
|
||||
mMaxCellCountY = r.getInteger(R.integer.all_apps_view_maxCellCountY);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,7 +177,19 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
||||
availableHeight -= mPageLayoutPaddingTop + mPageLayoutPaddingBottom;
|
||||
availableHeight -= cellHeight; // Assume at least one row
|
||||
availableHeight -= screenHeight * 0.16f;
|
||||
return (1 + availableHeight / (cellHeight + mPageLayoutHeightGap));
|
||||
if (availableHeight > 0) {
|
||||
return Math.min(mMaxCellCountY,
|
||||
1 + availableHeight / (cellHeight + mPageLayoutHeightGap));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getCellCountX() {
|
||||
return mCellCountX;
|
||||
}
|
||||
|
||||
int getCellCountY() {
|
||||
return mCellCountY;
|
||||
}
|
||||
|
||||
void allowHardwareLayerCreation() {
|
||||
|
||||
Reference in new issue
Block a user