Enable transition to "read" and "unread" states for "in progress" items

This commit is contained in:
Michael Kaiser 2012-10-23 15:24:36 +02:00
parent d32f49b274
commit 37e58f8b8a
2 changed files with 13 additions and 2 deletions

View File

@ -380,6 +380,17 @@ public class FeedManager {
Log.d(TAG, "Setting item with title " + item.getTitle() Log.d(TAG, "Setting item with title " + item.getTitle()
+ " as read/unread"); + " as read/unread");
item.read = read; item.read = read;
FeedMedia media = item.getMedia();
if (media != null) {
if (read) {
media.setPlaybackCompletionDate(new Date());
} else {
media.setPlaybackCompletionDate(null);
media.setPosition(0);
}
}
setFeedItem(context, item); setFeedItem(context, item);
contentChanger.post(new Runnable() { contentChanger.post(new Runnable() {

View File

@ -50,8 +50,8 @@ public class FeedItemMenuHandler {
selectedItem.getLink() != null); selectedItem.getLink() != null);
menu.findItem(R.id.mark_unread_item).setVisible( menu.findItem(R.id.mark_unread_item).setVisible(
selectedItem.isRead() && AppConfig.DEBUG); selectedItem.isRead() || selectedItem.isInProgress());
menu.findItem(R.id.mark_read_item).setVisible(!selectedItem.isRead()); menu.findItem(R.id.mark_read_item).setVisible(!selectedItem.isRead() || selectedItem.isInProgress());
if (selectedItem.getLink() != null) { if (selectedItem.getLink() != null) {
menu.findItem(R.id.visit_website_item).setVisible(true); menu.findItem(R.id.visit_website_item).setVisible(true);