From ad9f975b5fd719b340d75195eb324cb1e1a87380 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Sat, 17 Sep 2022 15:57:24 +0530 Subject: [PATCH] Use NotificationChannelCompat. --- app/src/main/AndroidManifest.xml | 2 +- .../libretube/{MyApp.kt => LibreTubeApp.kt} | 68 +++++++------------ app/src/main/res/values/strings.xml | 8 +++ 3 files changed, 32 insertions(+), 46 deletions(-) rename app/src/main/java/com/github/libretube/{MyApp.kt => LibreTubeApp.kt} (53%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b2d5fd716..4491ea9e2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,7 @@ = Build.VERSION_CODES.O) { - val channel = NotificationChannel(id, name, importance) - channel.description = descriptionText - // Register the channel in the system - val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager - notificationManager.createNotificationChannel(channel) - } + val notificationManager = NotificationManagerCompat.from(this) + notificationManager.createNotificationChannelsCompat(listOf(downloadChannel, + backgroundChannel, pushChannel)) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 62009f659..10d021479 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -324,4 +324,12 @@ Skip segment Skip manually Don\'t skip segments automatically, always prompt before. + + + Download Service + Shows a notification when downloading media. + Background Mode + Shows a notification with buttons to control the audio player. + Notification Worker + Shows a notification when new streams are available.