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