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

@@ -118,9 +118,8 @@ public class DashboardSummaryTest {
}
@Test
public void onSuggestionDismissed_categoryShouldBeRefreshed() {
doNothing().when(mSummary).rebuildUI();
public void onSuggestionDismissed_shouldNotRebuildUI() {
mSummary.onSuggestionDismissed(mock(Tile.class));
verify(mSummary).rebuildUI();
verify(mSummary, never()).rebuildUI();
}
}