Add button to always refresh over mobile data

This commit is contained in:
ByteHamster 2022-03-16 22:57:06 +01:00
parent 60e2c2e113
commit 5cf6051d88
2 changed files with 7 additions and 3 deletions

View File

@ -123,7 +123,7 @@ public class AutoUpdateManager {
Log.d(TAG, "Run auto update immediately in background."); Log.d(TAG, "Run auto update immediately in background.");
if (!NetworkUtils.networkAvailable()) { if (!NetworkUtils.networkAvailable()) {
Log.d(TAG, "Ignoring: No network connection."); Log.d(TAG, "Ignoring: No network connection.");
} else if (NetworkUtils.isEpisodeDownloadAllowed()) { } else if (NetworkUtils.isFeedRefreshAllowed()) {
startRefreshAllFeeds(context); startRefreshAllFeeds(context);
} else { } else {
confirmMobileAllFeedsRefresh(context); confirmMobileAllFeedsRefresh(context);
@ -134,8 +134,12 @@ public class AutoUpdateManager {
AlertDialog.Builder builder = new AlertDialog.Builder(context) AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setTitle(R.string.feed_refresh_title) .setTitle(R.string.feed_refresh_title)
.setMessage(R.string.confirm_mobile_feed_refresh_dialog_message) .setMessage(R.string.confirm_mobile_feed_refresh_dialog_message)
.setPositiveButton(R.string.yes, .setPositiveButton(R.string.confirm_mobile_streaming_button_once,
(dialog, which) -> startRefreshAllFeeds(context)) (dialog, which) -> startRefreshAllFeeds(context))
.setNeutralButton(R.string.confirm_mobile_streaming_button_always, (dialog, which) -> {
UserPreferences.setAllowMobileFeedRefresh(true);
startRefreshAllFeeds(context);
})
.setNegativeButton(R.string.no, null); .setNegativeButton(R.string.no, null);
builder.show(); builder.show();
} }

View File

@ -188,7 +188,7 @@
</plurals> </plurals>
<string name="edit_tags">Edit tags</string> <string name="edit_tags">Edit tags</string>
<string name="rename_tag_label">Rename tag</string> <string name="rename_tag_label">Rename tag</string>
<string name="confirm_mobile_feed_refresh_dialog_message">Downloading episodes over mobile data connection is disabled in the settings.\n\nDo you still want to refresh all podcasts over mobile data?</string> <string name="confirm_mobile_feed_refresh_dialog_message">Refreshing podcasts over mobile data connection is disabled in the settings.\n\nDo you want to refresh anyway?</string>
<!-- actions on feeditems --> <!-- actions on feeditems -->
<string name="download_label">Download</string> <string name="download_label">Download</string>