summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/allapps/AlphabeticalAppsList.java')
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index e284f77c4..a0cf5b6dc 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -235,11 +235,10 @@ public class AlphabeticalAppsList {
private int mNumAppsPerRow;
private int mNumPredictedAppsPerRow;
- public AlphabeticalAppsList(Context context, int numAppsPerRow, int numPredictedAppsPerRow) {
+ public AlphabeticalAppsList(Context context) {
mLauncher = (Launcher) context;
mIndexer = new AlphabeticIndexCompat(context);
mAppNameComparator = new AppNameComparator(context);
- setNumAppsPerRow(numAppsPerRow, numPredictedAppsPerRow);
}
/**
@@ -249,10 +248,6 @@ public class AlphabeticalAppsList {
mAdapterChangedCallback = cb;
}
- public SimpleAppSearchManagerImpl newSimpleAppSearchManager() {
- return new SimpleAppSearchManagerImpl(mApps);
- }
-
/**
* Sets the number of apps per row. Used only for AppsContainerView.SECTIONED_GRID_COALESCED.
*/
@@ -269,7 +264,7 @@ public class AlphabeticalAppsList {
mNumAppsPerRow = numAppsPerRow;
mNumPredictedAppsPerRow = numPredictedAppsPerRow;
- onAppsUpdated();
+ updateAdapterItems();
}
/**
@@ -280,6 +275,13 @@ public class AlphabeticalAppsList {
}
/**
+ * Returns all the apps.
+ */
+ public List<AppInfo> getApps() {
+ return mApps;
+ }
+
+ /**
* Returns sections of all the current filtered applications.
*/
public List<SectionInfo> getSections() {
@@ -597,6 +599,11 @@ public class AlphabeticalAppsList {
* Merges multiple sections to reduce visual raggedness.
*/
private void mergeSections() {
+ // Ignore merging until we have a valid row size
+ if (mNumAppsPerRow == 0) {
+ return;
+ }
+
// Go through each section and try and merge some of the sections
if (AllAppsContainerView.GRID_MERGE_SECTIONS && !hasFilter()) {
int sectionAppCount = 0;