Index: chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java |
index eb37562a1c446300257ba9fc258bf7beafff9ce2..003498dfac2ddc17d37384982a0356d1681fc094 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java |
@@ -108,7 +108,7 @@ public abstract class DateDividedAdapter extends Adapter<RecyclerView.ViewHolder |
/** |
* A bucket of items with the same date. |
*/ |
- private static class ItemGroup { |
+ protected static class ItemGroup { |
private final Date mDate; |
private final List<TimedItem> mItems = new ArrayList<>(); |
@@ -128,6 +128,10 @@ public abstract class DateDividedAdapter extends Adapter<RecyclerView.ViewHolder |
mIsSorted = false; |
} |
+ public void removeItem(TimedItem item) { |
+ mItems.remove(item); |
+ } |
+ |
/** Records the position of all the TimedItems in this group, relative to the full list. */ |
public void setPosition(int index) { |
assert mIndex == 0; |
@@ -329,7 +333,7 @@ public abstract class DateDividedAdapter extends Adapter<RecyclerView.ViewHolder |
/** |
* Utility method to traverse all groups and find the {@link ItemGroup} for the given position. |
*/ |
- private Pair<ItemGroup, Integer> getGroupAt(int position) { |
+ protected Pair<ItemGroup, Integer> getGroupAt(int position) { |
// TODO(ianwen): Optimize the performance if the number of groups becomes too large. |
int i = position; |
for (ItemGroup group : mGroups) { |
@@ -344,6 +348,13 @@ public abstract class DateDividedAdapter extends Adapter<RecyclerView.ViewHolder |
} |
/** |
+ * @param group The group to remove from the adapter. |
+ */ |
+ protected void removeGroup(ItemGroup group) { |
+ mGroups.remove(group); |
+ } |
+ |
+ /** |
* Creates a long ID that identifies a particular day in history. |
* @param date Date to process. |
* @return Long that has the day of the year (1-365) in the lowest 16 bits and the year in the |