Lazily binding folder pages and icons
Folders are bound before they are opened and unbound on close. This
allows us to recycle the views in folders
Bug: 139051851
Change-Id: Ic1ed3265c0f583af54d73dab6f2751bc95266ea9
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index aa02441..886fd8e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2340,6 +2340,11 @@
// override the previous page so we don't log the page switch.
mWorkspace.setCurrentPage(pageBoundFirst, pageBoundFirst /* overridePrevPage */);
+ // Cache one page worth of icons
+ getViewCache().setCacheSize(R.layout.folder_application,
+ mDeviceProfile.inv.numFolderColumns * mDeviceProfile.inv.numFolderRows);
+ getViewCache().setCacheSize(R.layout.folder_page, 2);
+
TraceHelper.endSection("finishBindingItems");
}