Improved performance when marking all feeditems of a feed as read
This commit is contained in:
parent
1f31dff47f
commit
a66580bfc6
|
@ -145,6 +145,18 @@ public class FeedManager {
|
|||
unreadItems.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the 'read' attribute of all FeedItems of a specific feed to true
|
||||
* @param context
|
||||
*/
|
||||
public void markFeedRead(Context context, Feed feed) {
|
||||
for (FeedItem item : feed.getItems()) {
|
||||
if (unreadItems.contains(item)) {
|
||||
markItemRead(context, item, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshAllFeeds(Context context) {
|
||||
Log.d(TAG, "Refreshing all feeds.");
|
||||
|
|
|
@ -85,6 +85,7 @@ public class ItemlistFragment extends SherlockListFragment {
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
fila.notifyDataSetChanged();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(DownloadService.ACTION_DOWNLOAD_HANDLED);
|
||||
filter.addAction(DownloadRequester.ACTION_DOWNLOAD_QUEUED);
|
||||
|
|
|
@ -31,10 +31,7 @@ public class FeedMenuHandler {
|
|||
FeedManager manager = FeedManager.getInstance();
|
||||
switch (item.getItemId()) {
|
||||
case R.id.mark_all_read_item:
|
||||
for (FeedItem feeditem : selectedFeed.getItems()) {
|
||||
manager.markItemRead(context, feeditem, true);
|
||||
}
|
||||
|
||||
manager.markFeedRead(context, selectedFeed);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue