Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Fixed issue when only some post were removed
Browse files Browse the repository at this point in the history
  • Loading branch information
rosenpin committed Nov 15, 2015
1 parent c171ce9 commit 7ed424f
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.view.View;
import android.view.ViewGroup;

import java.util.Iterator;
import java.util.concurrent.ExecutionException;

import me.ccrama.redditslide.Activities.Submit;
Expand Down Expand Up @@ -138,7 +139,15 @@ public void onClick(View v) {
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
adapter.dataSet.posts.removeAll(adapter.seen);
int i = 0;
Iterator<?> it = adapter.dataSet.posts.iterator();
while (it.hasNext()) {
i++;
if (adapter.seen.contains(it.next())) {
it.remove();
//adapter.notifyItemRemoved(i);
}
}
adapter.notifyDataSetChanged();
}
});
Expand Down

0 comments on commit 7ed424f

Please sign in to comment.