Simplifying logic to create/destroy hardware layers in All Apps

Bug # 3422984
This commit is contained in:
Michael Jurka 2011-02-16 12:04:02 -08:00
parent aefd4e1f51
commit c5e49022be
3 changed files with 2 additions and 14 deletions

View File

@ -515,6 +515,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
layout.addViewToCellLayout(icon, -1, 0,
new PagedViewCellLayout.LayoutParams(0, 0, 4, 1));
}
layout.createHardwareLayers();
}
/*

View File

@ -597,21 +597,7 @@ public abstract class PagedView extends ViewGroup {
canvas.clipRect(mScrollX, mScrollY, mScrollX + mRight - mLeft,
mScrollY + mBottom - mTop);
for (int i = 0; i < pageCount; i++) {
View child = getChildAt(i);
if (child != null && child instanceof PagedViewCellLayout) {
boolean willBeDrawn = i >= leftScreen && i <= rightScreen;
if (!willBeDrawn) {
((PagedViewCellLayout)child).destroyHardwareLayers();
}
}
}
for (int i = leftScreen; i <= rightScreen; i++) {
View child = getChildAt(i);
if (child != null && child instanceof PagedViewCellLayout) {
((PagedViewCellLayout)child).createHardwareLayers();
}
drawChild(canvas, getChildAt(i), drawingTime);
}
canvas.restore();

View File

@ -141,6 +141,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
public void removeAllViewsOnPage() {
mChildren.removeAllViews();
mHolographicChildren.removeAllViews();
destroyHardwareLayers();
}
@Override