summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2021-11-07 14:56:57 +0100
committerGitHub <noreply@github.com>2021-11-07 14:56:57 +0100
commit43289dfd26caf766c73e70bfea660f8bfa10f1f1 (patch)
tree0ffcedfd6ee529336f623e331f7e21034194ab18
parente5325c6d1d8cf356cf2b5f1aa294a15043a910c2 (diff)
parent176cac660265f28c9fd6f11a7199936bdc04e691 (diff)
downloadAntennaPod-43289dfd26caf766c73e70bfea660f8bfa10f1f1.zip
Merge pull request #5533 from ByteHamster/fix-cover-preview
Fix CoverFragment crashing when showing RemoteMedia
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java9
2 files changed, 8 insertions, 3 deletions
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 2ab96e84d..5ddb6407c 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java
@@ -95,7 +95,7 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> {
holder.preview.setVisibility(View.GONE);
holder.description.setTag(Boolean.FALSE);
} else {
- holder.description.setMaxLines(2000);
+ holder.description.setMaxLines(30);
holder.description.setTag(Boolean.TRUE);
holder.preview.setVisibility(item.getMedia() != null ? View.VISIBLE : View.GONE);
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 dd69e5fbd..e833d0777 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java
@@ -156,8 +156,13 @@ public class CoverFragment extends Fragment {
+ "・"
+ "\u00A0"
+ StringUtils.replace(StringUtils.stripToEmpty(pubDateStr), " ", "\u00A0"));
- Intent openFeed = MainActivity.getIntentToOpenFeed(requireContext(), ((FeedMedia) media).getItem().getFeedId());
- txtvPodcastTitle.setOnClickListener(v -> startActivity(openFeed));
+ if (media instanceof FeedMedia) {
+ Intent openFeed = MainActivity.getIntentToOpenFeed(requireContext(),
+ ((FeedMedia) media).getItem().getFeedId());
+ txtvPodcastTitle.setOnClickListener(v -> startActivity(openFeed));
+ } else {
+ txtvPodcastTitle.setOnClickListener(null);
+ }
txtvPodcastTitle.setOnLongClickListener(v -> copyText(media.getFeedTitle()));
txtvEpisodeTitle.setText(media.getEpisodeTitle());
txtvEpisodeTitle.setOnLongClickListener(v -> copyText(media.getEpisodeTitle()));