Limit the suggestions to be shown to 5.

- when creating the dashboard data, pass the sublist of suggestions to
cap the total number of suggestions to be shown to 5.
- if user swipe away the suggestion, it will only remove the suggestion
from the suggestion adapater, and will not trigger rebuilding the whole
UI.

Bug: 64072051
Change-Id: I1efabeb2a805c670007c631d3ccb0fdfbde7b55a
Fix: 63309218
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-07-27 10:45:30 -07:00
parent d6ab7dee09
commit 4940539479
4 changed files with 48 additions and 16 deletions

View File

@@ -251,10 +251,7 @@ public class DashboardSummary extends InstrumentedFragment
@Override
public void onSuggestionDismissed(Tile suggestion) {
mAdapter.onSuggestionDismissed();
// Refresh the UI to pick up suggestions that can now be shown because, say, a higher
// priority suggestion has been dismissed, or an exclusive suggestion category is emptied.
rebuildUI();
mAdapter.onSuggestionDismissed(suggestion);
}
private class SuggestionLoader extends AsyncTask<Void, Void, List<Tile>> {