summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-06-09 14:41:33 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-06-22 12:29:44 +0000
commitf8832497a94ea4ae07411b7f27feb13a607ac4d7 (patch)
tree6eee3b606c4b1c719f737d1039d2fb1d3a33575d /android/src
parent9f59403aaaad0c31120046d75acfa472f6b96ad2 (diff)
downloadmullvadvpn-f8832497a94ea4ae07411b7f27feb13a607ac4d7.tar.xz
mullvadvpn-f8832497a94ea4ae07411b7f27feb13a607ac4d7.zip
Add `buildNotification` method overloads
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt
index 2546c8955f..037a01033d 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/NotificationChannel.kt
@@ -37,6 +37,10 @@ class NotificationChannel(
}
}
+ fun buildNotification(intent: PendingIntent, title: String): Notification {
+ return buildNotification(intent, title, emptyList())
+ }
+
fun buildNotification(intent: PendingIntent, title: Int): Notification {
return buildNotification(intent, title, emptyList())
}
@@ -46,10 +50,18 @@ class NotificationChannel(
title: Int,
actions: List<NotificationCompat.Action>
): Notification {
+ return buildNotification(pendingIntent, context.getString(title), actions)
+ }
+
+ fun buildNotification(
+ pendingIntent: PendingIntent,
+ title: String,
+ actions: List<NotificationCompat.Action>
+ ): Notification {
val builder = NotificationCompat.Builder(context, id)
.setSmallIcon(R.drawable.small_logo_black)
.setColor(badgeColor)
- .setContentTitle(context.getString(title))
+ .setContentTitle(title)
.setContentIntent(pendingIntent)
for (action in actions) {