summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-05-05 23:09:03 +0200
committerGitHub <noreply@github.com>2023-05-05 23:09:03 +0200
commit6d7bfef8a5fe8180f13904739996bb2b8de8a0d4 (patch)
tree84f246b74fe7254678788e9f206d81d1a30ffa5e /ui
parent4c286931cd2dbd9038022f808f9d8a73ccbb6759 (diff)
downloadAntennaPod-6d7bfef8a5fe8180f13904739996bb2b8de8a0d4.zip
Download Service Rewrite (#6420)
Diffstat (limited to 'ui')
-rw-r--r--ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/DownloadAuthenticationActivityStarter.java39
-rw-r--r--ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/MainActivityStarter.java9
-rw-r--r--ui/common/src/main/java/de/danoeh/antennapod/ui/common/CircularProgressBar.java11
-rw-r--r--ui/i18n/src/main/res/values/strings.xml18
-rw-r--r--ui/png-icons/src/main/res/drawable/ic_notification_cancel.xml5
-rw-r--r--ui/png-icons/src/main/res/drawable/ic_notification_key.xml6
6 files changed, 25 insertions, 63 deletions
diff --git a/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/DownloadAuthenticationActivityStarter.java b/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/DownloadAuthenticationActivityStarter.java
deleted file mode 100644
index 03c5e915e..000000000
--- a/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/DownloadAuthenticationActivityStarter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package de.danoeh.antennapod.ui.appstartintent;
-
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
-import android.os.Parcelable;
-
-/**
- * Launches the download authentication activity of the app with specific arguments.
- * Does not require a dependency on the actual implementation of the activity.
- */
-public class DownloadAuthenticationActivityStarter {
- public static final String INTENT = "de.danoeh.antennapod.intents.DOWNLOAD_AUTH_ACTIVITY";
- public static final String EXTRA_DOWNLOAD_REQUEST = "download_request";
-
- private final Intent intent;
- private final Context context;
- private final long feedFileId;
-
- public DownloadAuthenticationActivityStarter(Context context, long feedFileId, Parcelable downloadRequest) {
- this.context = context;
- this.feedFileId = feedFileId;
- intent = new Intent(INTENT);
- intent.setAction("request" + feedFileId);
- intent.putExtra(EXTRA_DOWNLOAD_REQUEST, downloadRequest);
- intent.setPackage(context.getPackageName());
- }
-
- public Intent getIntent() {
- return intent;
- }
-
- public PendingIntent getPendingIntent() {
- return PendingIntent.getActivity(context.getApplicationContext(),
- ("downloadAuth" + feedFileId).hashCode(), getIntent(),
- PendingIntent.FLAG_ONE_SHOT | (Build.VERSION.SDK_INT >= 23 ? PendingIntent.FLAG_IMMUTABLE : 0));
- }
-}
diff --git a/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/MainActivityStarter.java b/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/MainActivityStarter.java
index 1463978ee..c635ff0cc 100644
--- a/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/MainActivityStarter.java
+++ b/ui/app-start-intent/src/main/java/de/danoeh/antennapod/ui/appstartintent/MainActivityStarter.java
@@ -17,6 +17,7 @@ public class MainActivityStarter {
public static final String EXTRA_ADD_TO_BACK_STACK = "add_to_back_stack";
public static final String EXTRA_FRAGMENT_TAG = "fragment_tag";
public static final String EXTRA_OPEN_DRAWER = "open_drawer";
+ public static final String EXTRA_OPEN_DOWNLOAD_LOGS = "open_download_logs";
public static final String EXTRA_FRAGMENT_ARGS = "fragment_args";
private final Intent intent;
@@ -30,6 +31,9 @@ public class MainActivityStarter {
}
public Intent getIntent() {
+ if (fragmentArgs != null) {
+ intent.putExtra(EXTRA_FRAGMENT_ARGS, fragmentArgs);
+ }
return intent;
}
@@ -67,6 +71,11 @@ public class MainActivityStarter {
return this;
}
+ public MainActivityStarter withDownloadLogsOpen() {
+ intent.putExtra(EXTRA_OPEN_DOWNLOAD_LOGS, true);
+ return this;
+ }
+
public MainActivityStarter withFragmentArgs(String name, boolean value) {
if (fragmentArgs == null) {
fragmentArgs = new Bundle();
diff --git a/ui/common/src/main/java/de/danoeh/antennapod/ui/common/CircularProgressBar.java b/ui/common/src/main/java/de/danoeh/antennapod/ui/common/CircularProgressBar.java
index a693c28b0..42f63bd9d 100644
--- a/ui/common/src/main/java/de/danoeh/antennapod/ui/common/CircularProgressBar.java
+++ b/ui/common/src/main/java/de/danoeh/antennapod/ui/common/CircularProgressBar.java
@@ -4,7 +4,9 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.DashPathEffect;
import android.graphics.Paint;
+import android.graphics.PathEffect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
@@ -13,11 +15,13 @@ import androidx.annotation.Nullable;
public class CircularProgressBar extends View {
public static final float MINIMUM_PERCENTAGE = 0.005f;
public static final float MAXIMUM_PERCENTAGE = 1 - MINIMUM_PERCENTAGE;
+ private static final PathEffect DASHED = new DashPathEffect(new float[] {5f, 5f}, 0f);
private final Paint paintBackground = new Paint();
private final Paint paintProgress = new Paint();
private float percentage = 0;
private float targetPercentage = 0;
+ private boolean isIndeterminate = false;
private Object tag = null;
private final RectF bounds = new RectF();
@@ -73,9 +77,10 @@ public class CircularProgressBar extends View {
float padding = getHeight() * 0.07f;
paintBackground.setStrokeWidth(getHeight() * 0.02f);
+ paintBackground.setPathEffect(isIndeterminate ? DASHED : null);
paintProgress.setStrokeWidth(padding);
bounds.set(padding, padding, getWidth() - padding, getHeight() - padding);
- canvas.drawArc(bounds, 0, 360, false, paintBackground);
+ canvas.drawArc(bounds, -90, 360, false, paintBackground);
if (MINIMUM_PERCENTAGE <= percentage && percentage <= MAXIMUM_PERCENTAGE) {
canvas.drawArc(bounds, -90, percentage * 360, false, paintProgress);
@@ -92,4 +97,8 @@ public class CircularProgressBar extends View {
invalidate();
}
}
+
+ public void setIndeterminate(boolean indeterminate) {
+ isIndeterminate = indeterminate;
+ }
}
diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml
index 59fc8b4e5..1959a2252 100644
--- a/ui/i18n/src/main/res/values/strings.xml
+++ b/ui/i18n/src/main/res/values/strings.xml
@@ -130,7 +130,6 @@
<string name="feed_volume_reduction_off">Off</string>
<string name="feed_volume_reduction_light">Light</string>
<string name="feed_volume_reduction_heavy">Heavy</string>
- <string name="parallel_downloads">%1$d parallel downloads</string>
<string name="feed_auto_download_always">Always</string>
<string name="feed_auto_download_never">Never</string>
<string name="feed_new_episodes_action_add_to_inbox">Add to Inbox</string>
@@ -239,7 +238,6 @@
<item quantity="other">%d episodes marked as unplayed.</item>
</plurals>
<string name="add_to_queue_label">Add to Queue</string>
- <string name="added_to_queue_label">Added to Queue</string>
<plurals name="added_to_queue_batch_label">
<item quantity="one">%d episode added to queue.</item>
<item quantity="other">%d episodes added to queue.</item>
@@ -266,6 +264,8 @@
<string name="download_running">Download running</string>
<string name="download_error_details">Details</string>
<string name="download_log_details_message">%1$s \n\nTechnical reason: \n%2$s \n\nFile URL:\n%3$s</string>
+ <string name="download_error_retrying">Download of \"%1$s\" failed. Will be retried later.</string>
+ <string name="download_error_not_retrying">Download of \"%1$s\" failed.</string>
<string name="download_error_tap_for_details">Tap to view details.</string>
<string name="download_error_device_not_found">Storage Device not found</string>
<string name="download_error_insufficient_space">There is not enough space left on your device.</string>
@@ -277,7 +277,7 @@
<string name="download_error_not_found">The podcast host\'s server does not know where to find the file. It may have been deleted.</string>
<string name="download_error_connection_error">Connection Error</string>
<string name="download_error_unknown_host">Cannot find the server. Check if the address is typed correctly and if you have a working network connection.</string>
- <string name="download_error_unauthorized">Authentication Error</string>
+ <string name="download_error_unauthorized">Authentication Error. Make sure that username and password are correct.</string>
<string name="download_error_file_type_type">File Type Error</string>
<string name="download_error_forbidden">The podcast host\'s server refuses to respond.</string>
<string name="download_canceled_msg">Download canceled</string>
@@ -285,7 +285,6 @@
<string name="download_error_blocked">The download was blocked by another app on your device (like a VPN or ad blocker).</string>
<string name="download_error_certificate">Unable to establish a secure connection. This can mean that another app on your device (like a VPN or an ad blocker) blocked the download, or that something is wrong with the server certificates.</string>
<string name="download_report_title">Downloads completed with error(s)</string>
- <string name="auto_download_report_title">Auto-downloads completed</string>
<string name="download_error_io_error">IO Error</string>
<string name="download_error_request_error">Request Error</string>
<string name="download_error_db_access">Database Access Error</string>
@@ -293,8 +292,6 @@
<item quantity="one">%d download left</item>
<item quantity="other">%d downloads left</item>
</plurals>
- <string name="completing">Completing…</string>
- <string name="download_notification_title">Downloading podcast data</string>
<string name="download_notification_title_feeds">Refreshing podcasts</string>
<string name="download_notification_title_episodes">Downloading episodes</string>
<string name="download_log_title_unknown">Unknown Title</string>
@@ -303,16 +300,14 @@
<string name="null_value_podcast_error">No podcast was provided that could be shown.</string>
<string name="no_feed_url_podcast_found_by_search">The suggested podcast did not have an RSS link, AntennaPod found a podcast that could match</string>
<string name="authentication_notification_title">Authentication required</string>
- <string name="authentication_notification_msg">The resource you requested requires a username and a password</string>
<string name="confirm_mobile_download_dialog_title">Confirm Mobile Download</string>
- <string name="confirm_mobile_download_dialog_message_not_in_queue">Downloading over mobile data connection is disabled in the settings.\n\nYou can choose to either only add the episode to the queue or you can allow downloading temporarily.\n\n<small>Your choice will be remembered for 10 minutes.</small></string>
- <string name="confirm_mobile_download_dialog_message">Downloading over mobile data connection is disabled in the settings.\n\nDo you want to allow downloading temporarily?\n\n<small>Your choice will be remembered for 10 minutes.</small></string>
+ <string name="confirm_mobile_download_dialog_message">Downloading over mobile data connection is disabled in the settings. AntennaPod can download the episode later automatically when Wi-Fi is available.</string>
+ <string name="confirm_mobile_download_dialog_download_later">Download later</string>
+ <string name="confirm_mobile_download_dialog_allow_this_time">Download anyway</string>
<string name="confirm_mobile_streaming_notification_title">Confirm Mobile streaming</string>
<string name="confirm_mobile_streaming_notification_message">Streaming over mobile data connection is disabled in the settings. Tap to stream anyway.</string>
<string name="confirm_mobile_streaming_button_always">Always</string>
<string name="confirm_mobile_streaming_button_once">Once</string>
- <string name="confirm_mobile_download_dialog_only_add_to_queue">Enqueue</string>
- <string name="confirm_mobile_download_dialog_enable_temporarily">Allow temporarily</string>
<!-- Mediaplayer messages -->
<string name="playback_error_generic"><![CDATA[The media file could not be played.\n\n- Try deleting and re-downloading the episode.\n- Check your network connection, and make sure no VPN or login page is blocking access.\n- Try long-pressing and sharing the \"Media address\" to your web browser to see if it can be played there. If not, contact the podcast creators.]]></string>
@@ -453,7 +448,6 @@
<string name="pref_autodl_wifi_filter_sum">Allow automatic download only for selected Wi-Fi networks.</string>
<string name="pref_automatic_download_on_battery_title">Download when not charging</string>
<string name="pref_automatic_download_on_battery_sum">Allow automatic download when the battery is not charging</string>
- <string name="pref_parallel_downloads_title">Parallel Downloads</string>
<string name="pref_episode_cache_title">Episode Cache</string>
<string name="pref_episode_cache_summary">Total number of downloaded episodes cached on the device. Automatic download will be suspended if this number is reached.</string>
<string name="pref_episode_cover_title">Use Episode Cover</string>
diff --git a/ui/png-icons/src/main/res/drawable/ic_notification_cancel.xml b/ui/png-icons/src/main/res/drawable/ic_notification_cancel.xml
deleted file mode 100644
index a5480c71f..000000000
--- a/ui/png-icons/src/main/res/drawable/ic_notification_cancel.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<vector android:height="24dp"
- android:viewportHeight="24.0" android:viewportWidth="24.0"
- android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
- <path android:fillColor="#FFFFFFFF" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
-</vector>
diff --git a/ui/png-icons/src/main/res/drawable/ic_notification_key.xml b/ui/png-icons/src/main/res/drawable/ic_notification_key.xml
deleted file mode 100644
index c8a817eeb..000000000
--- a/ui/png-icons/src/main/res/drawable/ic_notification_key.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:height="24dp" android:viewportHeight="24.0"
- android:viewportWidth="24.0" android:width="24dp">
- <path android:fillColor="#FFFFFFFF"
- android:pathData="M12.65,10C11.83,7.67 9.61,6 7,6c-3.31,0 -6,2.69 -6,6s2.69,6 6,6c2.61,0 4.83,-1.67 5.65,-4H17v4h4v-4h2v-4H12.65zM7,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
-</vector>