Fix calculation of all apps recyclerview pool size of app icons
grid.numShownAllAppsColumns is the column size of all apps, whereas mNumAppsPerRow is the column size of workspace, we should use the former one to calculate num of all apps icons
Bug: 287523421
Flag: N/A
Test: Open all apps from launcher and taskbar and scroll it, Expect scorlling works without jank.
Change-Id: Ife488e5853c84f6cc94e1e9e7edae67844275439
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 7c5c003..602d1a3 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -96,8 +96,8 @@
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER, 1);
- pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows
- * (mNumAppsPerRow + 1));
+ pool.setMaxRecycledViews(
+ AllAppsGridAdapter.VIEW_TYPE_ICON, (approxRows + 1) * grid.numShownAllAppsColumns);
}
@Override