summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-06-01 15:42:37 -0700
committerWinson Chung <winsonc@google.com>2015-06-01 22:43:32 +0000
commitdd5814c471c316091f59febcffedb8d58d693492 (patch)
treee72967e834992e5992174b5b5e84f1e60d73cedd
parente4ca4a9ca16d3007f44e3ef30dbeacd20815b402 (diff)
downloadandroid_packages_apps_Trebuchet-dd5814c471c316091f59febcffedb8d58d693492.tar.gz
android_packages_apps_Trebuchet-dd5814c471c316091f59febcffedb8d58d693492.tar.bz2
android_packages_apps_Trebuchet-dd5814c471c316091f59febcffedb8d58d693492.zip
Fixing crash on tablets from merging scheme changes.
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 7a9dfa16e..13e18289a 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -542,14 +542,14 @@ public class AlphabeticalAppsList {
int sectionAppCount = 0;
for (int i = 0; i < mSections.size() - 1; i++) {
SectionInfo section = mSections.get(i);
- SectionInfo nextSection = mSections.get(i + 1);
sectionAppCount = section.numApps;
int mergeCount = 1;
// Merge rows based on the current strategy
- while (mMergeAlgorithm.continueMerging(section, nextSection, sectionAppCount,
- mNumAppsPerRow, mergeCount)) {
- nextSection = mSections.remove(i + 1);
+ while (i < (mSections.size() - 1) &&
+ mMergeAlgorithm.continueMerging(section, mSections.get(i + 1),
+ sectionAppCount, mNumAppsPerRow, mergeCount)) {
+ SectionInfo nextSection = mSections.remove(i + 1);
// Remove the next section break
mAdapterItems.remove(nextSection.sectionBreakItem);