Code cleanup: DashboardAdapter.category is no longer a list

We only ever display a single DashboardCategory in homepaeg, so the
category doesn't need to be a list in DashboardData/Adapter

Change-Id: I57db02bb45cbc511f0fce1bf33043b51ef9db15c
Fix: 33861822
Test: updated robotests
This commit is contained in:
Fan Zhang
2017-06-29 14:35:41 -07:00
parent 283895c03b
commit b487fae5d8
5 changed files with 58 additions and 80 deletions

View File

@@ -292,15 +292,12 @@ public class DashboardSummary extends InstrumentedFragment
return;
}
// Temporary hack to wrap homepage category into a list. Soon we will create adapter
// API that takes a single category.
List<DashboardCategory> categories = new ArrayList<>();
categories.add(mDashboardFeatureProvider.getTilesForCategory(
CategoryKey.CATEGORY_HOMEPAGE));
final DashboardCategory category = mDashboardFeatureProvider.getTilesForCategory(
CategoryKey.CATEGORY_HOMEPAGE);
if (suggestions != null) {
mAdapter.setCategoriesAndSuggestions(categories, suggestions);
mAdapter.setCategoriesAndSuggestions(category, suggestions);
} else {
mAdapter.setCategory(categories);
mAdapter.setCategory(category);
}
}
}