diff options
author | Winson Chung <winsonc@google.com> | 2015-05-21 14:39:54 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2015-05-21 14:39:54 -0700 |
commit | db0b572862b1c34ddee35fefb1197d9057717b6b (patch) | |
tree | f81ce96666b61b73099828aef4d68a0a3f92ad5e /src/com/android | |
parent | aa78b3dea3427ca65d0c0a316a72f769feecdac1 (diff) | |
download | android_packages_apps_Trebuchet-db0b572862b1c34ddee35fefb1197d9057717b6b.tar.gz android_packages_apps_Trebuchet-db0b572862b1c34ddee35fefb1197d9057717b6b.tar.bz2 android_packages_apps_Trebuchet-db0b572862b1c34ddee35fefb1197d9057717b6b.zip |
Fixing crash in previous CL.
- Shouldn't be referencing mApps before it is set.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/AlphabeticalAppsList.java | 11 | ||||
-rw-r--r-- | src/com/android/launcher3/AppsContainerView.java | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/launcher3/AlphabeticalAppsList.java b/src/com/android/launcher3/AlphabeticalAppsList.java index 5e05d11bc..2505c803a 100644 --- a/src/com/android/launcher3/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/AlphabeticalAppsList.java @@ -199,16 +199,21 @@ public class AlphabeticalAppsList { private int mNumAppsPerRow; private int mNumPredictedAppsPerRow; - public AlphabeticalAppsList(Context context, AdapterChangedCallback auCb, int numAppsPerRow, - int numPredictedAppsPerRow) { + public AlphabeticalAppsList(Context context, int numAppsPerRow, int numPredictedAppsPerRow) { mContext = context; mIndexer = new AlphabeticIndexCompat(context); mAppNameComparator = new AppNameComparator(context); - mAdapterChangedCallback = auCb; setNumAppsPerRow(numAppsPerRow, numPredictedAppsPerRow); } /** + * Sets the apps updated callback. + */ + public void setAppsUpdatedCallback(AdapterChangedCallback auCb) { + mAdapterChangedCallback = auCb; + } + + /** * Sets the number of apps per row. Used only for AppsContainerView.SECTIONED_GRID_COALESCED. */ public void setNumAppsPerRow(int numAppsPerRow, int numPredictedAppsPerRow) { diff --git a/src/com/android/launcher3/AppsContainerView.java b/src/com/android/launcher3/AppsContainerView.java index 612c19c0f..5661df648 100644 --- a/src/com/android/launcher3/AppsContainerView.java +++ b/src/com/android/launcher3/AppsContainerView.java @@ -210,7 +210,8 @@ public class AppsContainerView extends BaseContainerView implements DragSource, mLayoutInflater = LayoutInflater.from(context); mNumAppsPerRow = grid.appsViewNumCols; mNumPredictedAppsPerRow = grid.appsViewNumPredictiveCols; - mApps = new AlphabeticalAppsList(context, this, mNumAppsPerRow, mNumPredictedAppsPerRow); + mApps = new AlphabeticalAppsList(context, mNumAppsPerRow, mNumPredictedAppsPerRow); + mApps.setAppsUpdatedCallback(this); mAdapter = new AppsGridAdapter(context, mApps, mNumAppsPerRow, this, this, mLauncher, this); mAdapter.setEmptySearchText(res.getString(R.string.loading_apps_message)); mAdapter.setNumAppsPerRow(mNumAppsPerRow); |