Reducing memory impact of hardware layers in Launcher

- Disabling hardware layers in customize tray
- Destroying hardware layers for pages in All Apps that are not visible
- Re-adding CachedTextView for icons in customize tray (to regain some of the lost performance there)
This commit is contained in:
Michael Jurka committed 2011-02-03 16:56:22 -08:00
1 parent 7924f2592f
commit c0759f5090
6 files changed
+54 -4

No files matched your search

+14
View File
@@ -596,7 +596,21 @@ 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();