Loading src/com/android/settings/dashboard/DashboardAdapter.java +2 −2 Original line number Diff line number Diff line Loading @@ -155,8 +155,8 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash // remain as the dashboard item. Need to refresh the dashboard list. setSuggestions(null); } else { mSuggestionAdapter.removeSuggestion(suggestion); notifyItemChanged(0, null); list.remove(suggestion); setSuggestions(list); } } Loading src/com/android/settings/dashboard/DashboardData.java +5 −1 Original line number Diff line number Diff line Loading @@ -246,7 +246,11 @@ public class DashboardData { if (suggestions.size() <= MAX_SUGGESTION_COUNT) { return suggestions; } return suggestions.subList(0, MAX_SUGGESTION_COUNT); final List<Suggestion> suggestionsToShow = new ArrayList<>(MAX_SUGGESTION_COUNT); for (int i = 0; i < MAX_SUGGESTION_COUNT; i++) { suggestionsToShow.add(suggestions.get(i)); } return suggestionsToShow; } /** Loading tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -124,10 +124,9 @@ public class DashboardAdapterTest { final Suggestion suggestionToRemove = suggestions.get(1); adapter.onSuggestionClosed(suggestionToRemove); assertThat(adapter.mDashboardData).isEqualTo(dashboardData); assertThat(suggestions.size()).isEqualTo(2); assertThat(suggestions.contains(suggestionToRemove)).isFalse(); verify(adapter, never()).notifyDashboardDataChanged(any()); verify(adapter).notifyDashboardDataChanged(any()); } @Test Loading Loading
src/com/android/settings/dashboard/DashboardAdapter.java +2 −2 Original line number Diff line number Diff line Loading @@ -155,8 +155,8 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash // remain as the dashboard item. Need to refresh the dashboard list. setSuggestions(null); } else { mSuggestionAdapter.removeSuggestion(suggestion); notifyItemChanged(0, null); list.remove(suggestion); setSuggestions(list); } } Loading
src/com/android/settings/dashboard/DashboardData.java +5 −1 Original line number Diff line number Diff line Loading @@ -246,7 +246,11 @@ public class DashboardData { if (suggestions.size() <= MAX_SUGGESTION_COUNT) { return suggestions; } return suggestions.subList(0, MAX_SUGGESTION_COUNT); final List<Suggestion> suggestionsToShow = new ArrayList<>(MAX_SUGGESTION_COUNT); for (int i = 0; i < MAX_SUGGESTION_COUNT; i++) { suggestionsToShow.add(suggestions.get(i)); } return suggestionsToShow; } /** Loading
tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -124,10 +124,9 @@ public class DashboardAdapterTest { final Suggestion suggestionToRemove = suggestions.get(1); adapter.onSuggestionClosed(suggestionToRemove); assertThat(adapter.mDashboardData).isEqualTo(dashboardData); assertThat(suggestions.size()).isEqualTo(2); assertThat(suggestions.contains(suggestionToRemove)).isFalse(); verify(adapter, never()).notifyDashboardDataChanged(any()); verify(adapter).notifyDashboardDataChanged(any()); } @Test Loading