From c7020376199cec2130051c0f01250c517b5763d6 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 30 Oct 2021 11:59:27 +0200 Subject: Use data folder for initial subscriptions --- .../de/danoeh/antennapod/activity/OnlineFeedViewActivity.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/src/main') 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 ec9e20dea..4dca1fda7 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -46,10 +46,10 @@ 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.util.FileNameGenerator; 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; import de.danoeh.antennapod.core.util.StorageUtils; import de.danoeh.antennapod.core.util.URLChecker; @@ -261,8 +261,13 @@ public class OnlineFeedViewActivity extends AppCompatActivity { feed.setPreferences(new FeedPreferences(0, false, FeedPreferences.AutoDeleteAction.GLOBAL, VolumeAdaptionSetting.OFF, username, password)); } - String fileUrl = new File(getExternalCacheDir(), - FileNameGenerator.generateFileName(feed.getDownload_url())).toString(); + String fileUrl; + try { + fileUrl = DownloadRequester.getInstance().getDownloadPathForFeed(feed).getAbsolutePath(); + } catch (DownloadRequestException e) { + e.printStackTrace(); + fileUrl = new File(getCacheDir(), FileNameGenerator.generateFileName(feed.getDownload_url())).toString(); + } feed.setFile_url(fileUrl); final DownloadRequest request = new DownloadRequest(feed.getFile_url(), feed.getDownload_url(), "OnlineFeed", 0, Feed.FEEDFILETYPE_FEED, username, password, -- cgit v1.2.3 From 218e3dd47d00915b5bf8f290fc6715a49c77d577 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 21 Nov 2021 19:33:01 +0100 Subject: Fix crash on API 21 when showing subscriptions screen --- .../de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java | 5 +++++ app/src/main/res/layout/subscription_item.xml | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java index 06bfbedf1..73f67d016 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.adapter; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; +import android.graphics.drawable.Drawable; import android.view.ContextMenu; import android.view.LayoutInflater; import android.view.MenuInflater; @@ -15,6 +16,7 @@ import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.appcompat.content.res.AppCompatResources; import androidx.core.text.TextUtilsCompat; import androidx.core.view.ViewCompat; import androidx.fragment.app.Fragment; @@ -188,6 +190,9 @@ public class SubscriptionsRecyclerAdapter extends SelectableAdapter + android:layout_height="wrap_content">