From b6acd14d0f65a679932ed7573f5b0507bc1d4e47 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 13 Jul 2021 01:31:59 -0700 Subject: [PATCH] Fix hole in recycler view Bug: 153780395 Test: manual Without this change, typing single character and then backspace, and then scrolling down and up will result in hole in recycler view. Change-Id: Iff6fa3f147d8bfdb8a7e84847b96e5390941dd4e --- src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index 9a5f3f2be9..2c84a3d4b9 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -109,7 +109,8 @@ public class AllAppsRecyclerView extends BaseRecyclerView { pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1); pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER, 1); pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET, 1); - pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows * mNumAppsPerRow); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows + * (mNumAppsPerRow + 1)); mViewHeights.clear(); mViewHeights.put(AllAppsGridAdapter.VIEW_TYPE_ICON, grid.allAppsCellHeightPx);