diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2021-08-28 10:54:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 10:54:17 +0200 |
commit | e75d8db2981ffe9abbb9b0e9395862e83dda34df (patch) | |
tree | e903d0beb123802bfec0367f772d66b1cb7c3c30 /app/src | |
parent | 87c50ac7a03169b5213b2dce37ac3f8415f6e0cb (diff) | |
parent | 24389d42e89037b205fff2bc681e4ad998895286 (diff) | |
download | AntennaPod-e75d8db2981ffe9abbb9b0e9395862e83dda34df.zip |
Merge pull request #5360 from ByteHamster/parser
Moved feed parser to its own module
Diffstat (limited to 'app/src')
7 files changed, 18 insertions, 18 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java index 9361c23df..6b294244a 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java +++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java @@ -11,8 +11,8 @@ import java.util.ArrayList; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.model.feed.FeedFunding; import de.danoeh.antennapod.model.feed.FeedItem; -import de.danoeh.antennapod.core.syndication.namespace.PodcastIndex; -import de.danoeh.antennapod.core.util.DateUtils; +import de.danoeh.antennapod.parser.feed.namespace.PodcastIndex; +import de.danoeh.antennapod.core.util.DateFormatter; /** * Creates RSS 2.0 feeds. See FeedGenerator for more information. @@ -98,7 +98,7 @@ public class Rss2Generator implements FeedGenerator { } if (item.getPubDate() != null) { xml.startTag(null, "pubDate"); - xml.text(DateUtils.formatRFC822Date(item.getPubDate())); + xml.text(DateFormatter.formatRfc822Date(item.getPubDate())); xml.endTag(null, "pubDate"); } if ((flags & FEATURE_WRITE_GUID) != 0) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 575e94f8c..ec9e20dea 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -46,9 +46,8 @@ import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; -import de.danoeh.antennapod.core.syndication.handler.FeedHandler; -import de.danoeh.antennapod.core.syndication.handler.FeedHandlerResult; -import de.danoeh.antennapod.core.syndication.handler.UnsupportedFeedtypeException; +import de.danoeh.antennapod.parser.feed.FeedHandler; +import de.danoeh.antennapod.parser.feed.FeedHandlerResult; import de.danoeh.antennapod.core.util.DownloadError; import de.danoeh.antennapod.core.util.FileNameGenerator; import de.danoeh.antennapod.core.util.IntentUtils; @@ -63,6 +62,7 @@ import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.model.feed.VolumeAdaptionSetting; import de.danoeh.antennapod.model.playback.RemoteMedia; +import de.danoeh.antennapod.parser.feed.UnsupportedFeedtypeException; import io.reactivex.Maybe; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java index 62a97e849..2ab96e84d 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java @@ -17,7 +17,7 @@ import de.danoeh.antennapod.core.util.NetworkUtils; import de.danoeh.antennapod.model.playback.RemoteMedia; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.core.service.playback.PlaybackService; -import de.danoeh.antennapod.core.util.DateUtils; +import de.danoeh.antennapod.core.util.DateFormatter; import de.danoeh.antennapod.model.playback.Playable; import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter; import de.danoeh.antennapod.core.util.syndication.HtmlToPlainText; @@ -58,7 +58,7 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> { } holder.title.setText(item.getTitle()); - holder.pubDate.setText(DateUtils.formatAbbrev(getContext(), item.getPubDate())); + holder.pubDate.setText(DateFormatter.formatAbbrev(getContext(), item.getPubDate())); if (item.getDescription() != null) { String description = HtmlToPlainText.getPlainText(item.getDescription()) .replaceAll("\n", " ") diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/PlaybackStatisticsListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/PlaybackStatisticsListAdapter.java index a71595c55..5fec5f063 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/PlaybackStatisticsListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/PlaybackStatisticsListAdapter.java @@ -7,7 +7,7 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.StatisticsItem; import de.danoeh.antennapod.core.util.Converter; -import de.danoeh.antennapod.core.util.DateUtils; +import de.danoeh.antennapod.core.util.DateFormatter; import de.danoeh.antennapod.view.PieChartView; import java.util.Date; @@ -32,7 +32,7 @@ public class PlaybackStatisticsListAdapter extends StatisticsListAdapter { String getHeaderCaption() { long usageCounting = UserPreferences.getUsageCountingDateMillis(); if (usageCounting > 0) { - String date = DateUtils.formatAbbrev(context, new Date(usageCounting)); + String date = DateFormatter.formatAbbrev(context, new Date(usageCounting)); return context.getString(R.string.statistics_counting_since, date); } else { return context.getString(R.string.total_time_listened_to_podcasts); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 5dbadaefa..67d1757ac 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -50,7 +50,7 @@ import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.core.feed.util.ImageResourceUtils; import de.danoeh.antennapod.core.glide.ApGlideSettings; import de.danoeh.antennapod.core.util.ChapterUtils; -import de.danoeh.antennapod.core.util.DateUtils; +import de.danoeh.antennapod.core.util.DateFormatter; import de.danoeh.antennapod.core.util.EmbeddedChapterImage; import de.danoeh.antennapod.core.util.playback.PlaybackController; import de.danoeh.antennapod.model.feed.Chapter; @@ -150,7 +150,7 @@ public class CoverFragment extends Fragment { } private void displayMediaInfo(@NonNull Playable media) { - String pubDateStr = DateUtils.formatAbbrev(getActivity(), media.getPubDate()); + String pubDateStr = DateFormatter.formatAbbrev(getActivity(), media.getPubDate()); txtvPodcastTitle.setText(StringUtils.stripToEmpty(media.getFeedTitle()) + "\u00A0" + "・" diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 5a2061a5f..31c6da8cd 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -55,7 +55,7 @@ import de.danoeh.antennapod.core.service.download.Downloader; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.Converter; -import de.danoeh.antennapod.core.util.DateUtils; +import de.danoeh.antennapod.core.util.DateFormatter; import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.ui.common.ThemeUtils; import de.danoeh.antennapod.core.util.playback.PlaybackController; @@ -291,9 +291,9 @@ public class ItemFragment extends Fragment { txtvTitle.setText(item.getTitle()); if (item.getPubDate() != null) { - String pubDateStr = DateUtils.formatAbbrev(getActivity(), item.getPubDate()); + String pubDateStr = DateFormatter.formatAbbrev(getActivity(), item.getPubDate()); txtvPublished.setText(pubDateStr); - txtvPublished.setContentDescription(DateUtils.formatForAccessibility(getContext(), item.getPubDate())); + txtvPublished.setContentDescription(DateFormatter.formatForAccessibility(getContext(), item.getPubDate())); } RequestOptions options = new RequestOptions() diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java index 02d45b2a0..cd3af5003 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java @@ -22,6 +22,7 @@ import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.adapter.CoverLoader; import de.danoeh.antennapod.adapter.actionbutton.ItemActionButton; import de.danoeh.antennapod.core.event.PlaybackPositionEvent; +import de.danoeh.antennapod.core.util.DateFormatter; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.model.playback.MediaType; @@ -31,7 +32,6 @@ import de.danoeh.antennapod.core.service.download.DownloadRequest; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.Converter; -import de.danoeh.antennapod.core.util.DateUtils; import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.core.util.NetworkUtils; import de.danoeh.antennapod.ui.common.CircularProgressBar; @@ -103,8 +103,8 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder { placeholder.setText(item.getFeed().getTitle()); title.setText(item.getTitle()); leftPadding.setContentDescription(item.getTitle()); - pubDate.setText(DateUtils.formatAbbrev(activity, item.getPubDate())); - pubDate.setContentDescription(DateUtils.formatForAccessibility(activity, item.getPubDate())); + pubDate.setText(DateFormatter.formatAbbrev(activity, item.getPubDate())); + pubDate.setContentDescription(DateFormatter.formatForAccessibility(activity, item.getPubDate())); isNew.setVisibility(item.isNew() ? View.VISIBLE : View.GONE); isFavorite.setVisibility(item.isTagged(FeedItem.TAG_FAVORITE) ? View.VISIBLE : View.GONE); isInQueue.setVisibility(item.isTagged(FeedItem.TAG_QUEUE) ? View.VISIBLE : View.GONE); |