blob: 41d79a711f54cdbf5fe11e57301d4b23223a2f12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
package de.danoeh.antennapod.fragment.swipeactions;
import android.content.Context;
import androidx.fragment.app.Fragment;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedItemFilter;
public class RemoveFromInboxSwipeAction implements SwipeAction {
@Override
public String getId() {
return REMOVE_FROM_INBOX;
}
@Override
public int getActionIcon() {
return R.drawable.ic_check;
}
@Override
public int getActionColor() {
return R.attr.icon_purple;
}
@Override
public String getTitle(Context context) {
return context.getString(R.string.remove_inbox_label);
}
@Override
public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filter) {
if (item.isNew()) {
FeedItemMenuHandler.markReadWithUndo(fragment, item, FeedItem.UNPLAYED, willRemove(filter, item));
}
}
@Override
public boolean willRemove(FeedItemFilter filter, FeedItem item) {
return filter.showNew;
}
}
|