From 8d5d90f4575f92a9cd282f6963af9b92733f6724 Mon Sep 17 00:00:00 2001 From: darken Date: Wed, 12 Jan 2022 16:56:13 +0100 Subject: [PATCH] Fix notifications not being reset when there is no device. --- .../java/eu/darken/capod/monitor/ui/MonitorNotifications.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/monitor/ui/MonitorNotifications.kt b/app/src/main/java/eu/darken/capod/monitor/ui/MonitorNotifications.kt index a27d4521..fa868e3f 100644 --- a/app/src/main/java/eu/darken/capod/monitor/ui/MonitorNotifications.kt +++ b/app/src/main/java/eu/darken/capod/monitor/ui/MonitorNotifications.kt @@ -59,6 +59,8 @@ class MonitorNotifications @Inject constructor( fun getBuilder(device: PodDevice?): NotificationCompat.Builder { if (device == null) { return builder.apply { + setCustomContentView(null) + setStyle(NotificationCompat.BigTextStyle()) setContentTitle(context.getString(R.string.pods_none_label_short)) setSubText(context.getString(R.string.app_name)) setSmallIcon(R.drawable.ic_device_generic_earbuds) @@ -66,10 +68,10 @@ class MonitorNotifications @Inject constructor( } return builder.apply { - setSmallIcon(device.iconRes) - setSubText(null) setStyle(NotificationCompat.DecoratedCustomViewStyle()) setCustomContentView(notificationViewFactory.createContentView(device)) + setSmallIcon(device.iconRes) + setSubText(null) log(TAG, VERBOSE) { "updatingNotification(): $device" } } }