From 1acda93e26ae714e6e76d948a8032a61e338fe90 Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Wed, 5 Jul 2023 12:54:45 -0700 Subject: [PATCH] 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 --- src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index 7c5c003915..602d1a38a5 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -96,8 +96,8 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView { 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