Split notification channel of downloading and refreshing (#7610)

This commit is contained in:
NWuensche 2025-01-17 19:45:40 +00:00 committed by GitHub
parent 99a6c9628e
commit c0077192d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View File

@ -123,7 +123,7 @@ public class FeedUpdateWorker extends Worker {
}
}
}
return new NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID_DOWNLOADING)
return new NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID_REFRESHING)
.setContentTitle(context.getString(R.string.download_notification_title_feeds))
.setContentText(contentText)
.setStyle(new NotificationCompat.BigTextStyle().bigText(bigText))

View File

@ -860,8 +860,10 @@
<string name="notification_group_news">News</string>
<string name="notification_channel_user_action">Action required</string>
<string name="notification_channel_user_action_description">Shown if your action is required, for example if you need to enter a password.</string>
<string name="notification_channel_downloading">Downloading</string>
<string name="notification_channel_downloading_description">Shown while currently downloading.</string>
<string name="notification_channel_downloading">Downloading episodes</string>
<string name="notification_channel_downloading_description">Shown while currently downloading episodes.</string>
<string name="notification_channel_refreshing">Refreshing podcasts</string>
<string name="notification_channel_refreshing_description">Shown while checking for new episodes.</string>
<string name="notification_channel_playing">Currently playing</string>
<string name="notification_channel_playing_description">Allows to control playback. This is the main notification you see while playing a podcast.</string>
<string name="notification_channel_download_error">Download failed</string>

View File

@ -14,6 +14,7 @@ import de.danoeh.antennapod.storage.preferences.UserPreferences;
public class NotificationUtils {
public static final String CHANNEL_ID_USER_ACTION = "user_action";
public static final String CHANNEL_ID_DOWNLOADING = "downloading";
public static final String CHANNEL_ID_REFRESHING = "refreshing";
public static final String CHANNEL_ID_PLAYING = "playing";
public static final String CHANNEL_ID_DOWNLOAD_ERROR = "error";
public static final String CHANNEL_ID_SYNC_ERROR = "sync_error";
@ -33,6 +34,7 @@ public class NotificationUtils {
final List<NotificationChannelCompat> channels = Arrays.asList(
createChannelUserAction(context),
createChannelDownloading(context),
createChannelRefreshing(context),
createChannelPlaying(context),
createChannelError(context),
createChannelSyncError(context),
@ -58,6 +60,15 @@ public class NotificationUtils {
.build();
}
private static NotificationChannelCompat createChannelRefreshing(final Context c) {
return new NotificationChannelCompat.Builder(
CHANNEL_ID_REFRESHING, NotificationManagerCompat.IMPORTANCE_LOW)
.setName(c.getString(R.string.notification_channel_refreshing))
.setDescription(c.getString(R.string.notification_channel_refreshing_description))
.setShowBadge(false)
.build();
}
private static NotificationChannelCompat createChannelPlaying(final Context c) {
return new NotificationChannelCompat.Builder(
CHANNEL_ID_PLAYING, NotificationManagerCompat.IMPORTANCE_LOW)