diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-05-05 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 23:09:03 +0200 |
commit | 6d7bfef8a5fe8180f13904739996bb2b8de8a0d4 (patch) | |
tree | 84f246b74fe7254678788e9f206d81d1a30ffa5e /event/src/main/java/de | |
parent | 4c286931cd2dbd9038022f808f9d8a73ccbb6759 (diff) | |
download | AntennaPod-6d7bfef8a5fe8180f13904739996bb2b8de8a0d4.zip |
Download Service Rewrite (#6420)
Diffstat (limited to 'event/src/main/java/de')
-rw-r--r-- | event/src/main/java/de/danoeh/antennapod/event/EpisodeDownloadEvent.java | 18 | ||||
-rw-r--r-- | event/src/main/java/de/danoeh/antennapod/event/MessageEvent.java | 14 |
2 files changed, 28 insertions, 4 deletions
diff --git a/event/src/main/java/de/danoeh/antennapod/event/EpisodeDownloadEvent.java b/event/src/main/java/de/danoeh/antennapod/event/EpisodeDownloadEvent.java new file mode 100644 index 000000000..c9790d18a --- /dev/null +++ b/event/src/main/java/de/danoeh/antennapod/event/EpisodeDownloadEvent.java @@ -0,0 +1,18 @@ +package de.danoeh.antennapod.event; + +import de.danoeh.antennapod.model.download.DownloadStatus; + +import java.util.Map; +import java.util.Set; + +public class EpisodeDownloadEvent { + private final Map<String, DownloadStatus> map; + + public EpisodeDownloadEvent(Map<String, DownloadStatus> map) { + this.map = map; + } + + public Set<String> getUrls() { + return map.keySet(); + } +} diff --git a/event/src/main/java/de/danoeh/antennapod/event/MessageEvent.java b/event/src/main/java/de/danoeh/antennapod/event/MessageEvent.java index 3f6b2db32..7f1cb20e2 100644 --- a/event/src/main/java/de/danoeh/antennapod/event/MessageEvent.java +++ b/event/src/main/java/de/danoeh/antennapod/event/MessageEvent.java @@ -1,21 +1,27 @@ package de.danoeh.antennapod.event; +import android.content.Context; import androidx.annotation.Nullable; +import androidx.core.util.Consumer; + public class MessageEvent { public final String message; @Nullable - public final Runnable action; + public final Consumer<Context> action; + + @Nullable + public final String actionText; public MessageEvent(String message) { - this(message, null); + this(message, null, null); } - public MessageEvent(String message, Runnable action) { + public MessageEvent(String message, Consumer<Context> action, String actionText) { this.message = message; this.action = action; + this.actionText = actionText; } - } |