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:
1 parent
7924f2592f
commit
c0759f5090
6 files changed
+54
-4
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user