Dismiss suggestion when close button is clicked.

- add handling to the suggestion card to dismiss the suggestion when
the close button is clicked.

Bug: 70573674
Test: make RunSettingsRoboTests
Change-Id: I8155efc326242abde753a633009e2579a9b3aa9b
This commit is contained in:
Doris Ling
2018-01-23 12:08:50 -08:00
parent 35a7f0d642
commit 0e32252111
3 changed files with 14 additions and 12 deletions

View File

@@ -151,13 +151,10 @@ public class DashboardAdapterV2 extends RecyclerView.Adapter<DashboardAdapterV2.
if (list.size() == 1) {
// The only suggestion is dismissed, and the the empty suggestion container will
// remain as the dashboard item. Need to refresh the dashboard list.
final DashboardDataV2 prevData = mDashboardData;
mDashboardData = new DashboardDataV2.Builder(prevData)
.setSuggestions(null)
.build();
notifyDashboardDataChanged(prevData);
setSuggestions(null);
} else {
mSuggestionAdapter.removeSuggestion(suggestion);
notifyItemChanged(0, null);
}
}