diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-31 18:40:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-31 18:40:15 +0200 |
commit | edb440a5a9a05e24c344a71b272b9238217e9c55 (patch) | |
tree | 13623ca7d0dac052ac35d693aac940d0727c87f9 /model/src/main | |
parent | 4e47691e70e85736c7eeb30ce02c73176e565a86 (diff) | |
download | AntennaPod-edb440a5a9a05e24c344a71b272b9238217e9c55.zip |
Restructure related UI classes together (#7044)
Diffstat (limited to 'model/src/main')
-rw-r--r-- | model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java | 9 | ||||
-rw-r--r-- | model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java | 16 |
2 files changed, 12 insertions, 13 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java b/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java index 8d36d24a3..15d256c24 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java +++ b/model/src/main/java/de/danoeh/antennapod/model/feed/Feed.java @@ -1,12 +1,11 @@ package de.danoeh.antennapod.model.feed; -import android.text.TextUtils; - import androidx.annotation.Nullable; import java.util.ArrayList; import java.util.Date; import java.util.List; +import org.apache.commons.lang3.StringUtils; /** * Data Object for a whole feed. @@ -205,9 +204,9 @@ public class Feed { } public String getHumanReadableIdentifier() { - if (!TextUtils.isEmpty(customTitle)) { + if (!StringUtils.isEmpty(customTitle)) { return customTitle; - } else if (!TextUtils.isEmpty(feedTitle)) { + } else if (!StringUtils.isEmpty(feedTitle)) { return feedTitle; } else { return downloadUrl; @@ -266,7 +265,7 @@ public class Feed { } public String getTitle() { - return !TextUtils.isEmpty(customTitle) ? customTitle : feedTitle; + return !StringUtils.isEmpty(customTitle) ? customTitle : feedTitle; } public void setTitle(String title) { diff --git a/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java b/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java index b963f3de1..c979488a6 100644 --- a/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java +++ b/model/src/main/java/de/danoeh/antennapod/model/playback/RemoteMedia.java @@ -3,7 +3,6 @@ package de.danoeh.antennapod.model.playback; import android.content.Context; import android.os.Parcel; import android.os.Parcelable; -import android.text.TextUtils; import androidx.annotation.Nullable; import de.danoeh.antennapod.model.feed.Chapter; import de.danoeh.antennapod.model.feed.Feed; @@ -13,6 +12,7 @@ import de.danoeh.antennapod.model.feed.FeedMedia; import java.util.Date; import java.util.List; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.HashCodeBuilder; /** @@ -68,7 +68,7 @@ public class RemoteMedia implements Playable { this.episodeTitle = item.getTitle(); this.episodeLink = item.getLink(); this.feedAuthor = item.getFeed().getAuthor(); - if (!TextUtils.isEmpty(item.getImageUrl())) { + if (!StringUtils.isEmpty(item.getImageUrl())) { this.imageUrl = item.getImageUrl(); } else { this.imageUrl = item.getFeed().getImageUrl(); @@ -280,21 +280,21 @@ public class RemoteMedia implements Playable { public boolean equals(Object other) { if (other instanceof RemoteMedia) { RemoteMedia rm = (RemoteMedia) other; - return TextUtils.equals(downloadUrl, rm.downloadUrl) - && TextUtils.equals(feedUrl, rm.feedUrl) - && TextUtils.equals(itemIdentifier, rm.itemIdentifier); + return StringUtils.equals(downloadUrl, rm.downloadUrl) + && StringUtils.equals(feedUrl, rm.feedUrl) + && StringUtils.equals(itemIdentifier, rm.itemIdentifier); } if (other instanceof FeedMedia) { FeedMedia fm = (FeedMedia) other; - if (!TextUtils.equals(downloadUrl, fm.getStreamUrl())) { + if (!StringUtils.equals(downloadUrl, fm.getStreamUrl())) { return false; } FeedItem fi = fm.getItem(); - if (fi == null || !TextUtils.equals(itemIdentifier, fi.getItemIdentifier())) { + if (fi == null || !StringUtils.equals(itemIdentifier, fi.getItemIdentifier())) { return false; } Feed feed = fi.getFeed(); - return feed != null && TextUtils.equals(feedUrl, feed.getDownloadUrl()); + return feed != null && StringUtils.equals(feedUrl, feed.getDownloadUrl()); } return false; } |