commit | dc016f37a29b42fe3b825acde0529a2e39471a18 | [log] [tgz] |
---|---|---|
author | Samuel Fufa <sfufa@google.com> | Tue Mar 09 09:57:40 2021 -0600 |
committer | Samuel Fufa <sfufa@google.com> | Tue Mar 09 10:00:05 2021 -0600 |
tree | fdd8a98a700c354ab17f734b683f6a0f8ffcedbd | |
parent | c2b750797c100ff8896d483b1e0633e293a955b7 [diff] |
Fix QSB tap crash Launcher should use LCM of supported getSupportedItemsPerRowArray instead of product. Bug: 182236647 Test: Manual Change-Id: Ia0ad1158a841068c29ed09bf7f598f14c410092f
diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index a05e036..bb175ea 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
@@ -290,8 +290,10 @@ public void setAppsPerRow(int appsPerRow) { mAppsPerRow = appsPerRow; int totalSpans = mAppsPerRow; - for (int itemPerRow : mSearchAdapterProvider.getSupportedItemsPerRow()) { - totalSpans *= itemPerRow; + for (int itemPerRow : mSearchAdapterProvider.getSupportedItemsPerRowArray()) { + if (totalSpans % itemPerRow != 0) { + totalSpans *= itemPerRow; + } } mGridLayoutMgr.setSpanCount(totalSpans); }
diff --git a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java index 6d491fd..fdacd3d 100644 --- a/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java +++ b/src/com/android/launcher3/allapps/search/SearchAdapterProvider.java
@@ -53,7 +53,7 @@ /** * Returns supported item per row combinations supported */ - public int[] getSupportedItemsPerRow() { + public int[] getSupportedItemsPerRowArray() { return new int[]{}; }