| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
|
| index c9a636a0372293e4644312c450931a05182a2974..b34a0e46d6034ad54343341762467f1b2a94d8de 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
|
| @@ -267,6 +267,27 @@ public void onItemRangeRemoved(TreeNode child, int index, int count) {
|
| }
|
|
|
| @Override
|
| + protected void notifyItemRangeInserted(int index, int count) {
|
| + super.notifyItemRangeInserted(index, count);
|
| + notifyNeighboursModified(index - 1, index + count);
|
| + }
|
| +
|
| + @Override
|
| + protected void notifyItemRangeRemoved(int index, int count) {
|
| + super.notifyItemRangeRemoved(index, count);
|
| + notifyNeighboursModified(index - 1, index);
|
| + }
|
| +
|
| + /** Sends a notification to the items at the provided indices to refresh their background. */
|
| + private void notifyNeighboursModified(int aboveNeighbour, int belowNeighbour) {
|
| + assert aboveNeighbour < belowNeighbour;
|
| + if (aboveNeighbour >= 0) notifyItemChanged(aboveNeighbour, PartialUpdateId.CARD_BACKGROUND);
|
| + if (belowNeighbour < getItemCount()) {
|
| + notifyItemChanged(belowNeighbour, PartialUpdateId.CARD_BACKGROUND);
|
| + }
|
| + }
|
| +
|
| + @Override
|
| public void onBindViewHolder(NewTabPageViewHolder holder, int position) {
|
| super.onBindViewHolder(holder, position);
|
| childSeen(position);
|
|
|