Merge "Fixing crash in previous CL." into ub-launcher3-burnaby

This commit is contained in:
Winson Chung
2015-05-21 22:43:45 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 4 deletions
@@ -199,15 +199,20 @@ 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.
*/
@@ -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);