diff --git a/app/src/main/java/com/nextcloud/client/documentscan/GeneratePdfFromImagesWork.kt b/app/src/main/java/com/nextcloud/client/documentscan/GeneratePdfFromImagesWork.kt index f56b1b844003..c4990a3ea94d 100644 --- a/app/src/main/java/com/nextcloud/client/documentscan/GeneratePdfFromImagesWork.kt +++ b/app/src/main/java/com/nextcloud/client/documentscan/GeneratePdfFromImagesWork.kt @@ -98,7 +98,8 @@ class GeneratePdfFromImagesWork( .setContentText(message) .setAutoCancel(true) - viewThemeUtils.androidx.themeNotificationCompatBuilder(appContext, notificationBuilder) + //NMC Customization + notificationBuilder.color = appContext.resources.getColor(R.color.primary, null) notificationManager.notify(notificationId, notificationBuilder.build()) diff --git a/app/src/main/java/com/nextcloud/client/jobs/FilesExportWork.kt b/app/src/main/java/com/nextcloud/client/jobs/FilesExportWork.kt index 058500fa4cd2..400c9925f883 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/FilesExportWork.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/FilesExportWork.kt @@ -137,7 +137,8 @@ class FilesExportWork( .setContentTitle(message) .setAutoCancel(true) - viewThemeUtils.androidx.themeNotificationCompatBuilder(appContext, notificationBuilder) + //NMC Customization + notificationBuilder.color = appContext.resources.getColor(R.color.primary, null) val actionIntent = Intent(DownloadManager.ACTION_VIEW_DOWNLOADS).apply { flags = FLAG_ACTIVITY_NEW_TASK diff --git a/app/src/main/java/com/nextcloud/client/jobs/MediaFoldersDetectionWork.kt b/app/src/main/java/com/nextcloud/client/jobs/MediaFoldersDetectionWork.kt index eec737012c05..0a38440dd345 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/MediaFoldersDetectionWork.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/MediaFoldersDetectionWork.kt @@ -222,7 +222,8 @@ class MediaFoldersDetectionWork constructor( .setAutoCancel(true) .setContentIntent(pendingIntent) - viewThemeUtils.androidx.themeNotificationCompatBuilder(context, notificationBuilder) + //NMC Customization + notificationBuilder.color = context.resources.getColor(R.color.primary, null) val disableDetection = Intent(context, NotificationReceiver::class.java) disableDetection.putExtra(NOTIFICATION_ID, notificationId) diff --git a/app/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt b/app/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt index ea8b75ccddb3..ce5170b80bc8 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt @@ -162,7 +162,8 @@ class NotificationWork constructor( .setVisibility(NotificationCompat.VISIBILITY_PRIVATE) .setContentIntent(pendingIntent) - viewThemeUtils.androidx.themeNotificationCompatBuilder(context, notificationBuilder) + //NMC Customization + notificationBuilder.color = context.resources.getColor(R.color.primary, null) // Remove if (notification.getActions().isEmpty()) { @@ -218,9 +219,8 @@ class NotificationWork constructor( .setAutoCancel(true) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setContentIntent(pendingIntent) - .also { - viewThemeUtils.androidx.themeNotificationCompatBuilder(context, it) - } + //NMC Customization + .setColor(context.resources.getColor(R.color.primary, null)) .build() ) val notificationManager = NotificationManagerCompat.from(context) diff --git a/app/src/main/java/com/nextcloud/client/media/PlayerService.kt b/app/src/main/java/com/nextcloud/client/media/PlayerService.kt index 6e4be1613ac3..32c516500294 100644 --- a/app/src/main/java/com/nextcloud/client/media/PlayerService.kt +++ b/app/src/main/java/com/nextcloud/client/media/PlayerService.kt @@ -92,7 +92,8 @@ class PlayerService : Service() { AndroidInjection.inject(this) player = Player(applicationContext, clientFactory, playerListener, audioManager) notificationBuilder = NotificationCompat.Builder(this) - viewThemeUtils.androidx.themeNotificationCompatBuilder(this, notificationBuilder) + //NMC Customization + notificationBuilder.color = resources.getColor(R.color.primary, null) val stop = Intent(this, PlayerService::class.java) stop.action = ACTION_STOP diff --git a/app/src/main/java/com/nextcloud/client/notifications/AppNotificationManagerImpl.kt b/app/src/main/java/com/nextcloud/client/notifications/AppNotificationManagerImpl.kt index 78f31f893a44..f7b6129bde84 100644 --- a/app/src/main/java/com/nextcloud/client/notifications/AppNotificationManagerImpl.kt +++ b/app/src/main/java/com/nextcloud/client/notifications/AppNotificationManagerImpl.kt @@ -43,7 +43,8 @@ class AppNotificationManagerImpl @Inject constructor( } else { NotificationCompat.Builder(context) } - viewThemeUtils.androidx.themeNotificationCompatBuilder(context, builder) + //NMC Customization + builder.color = context.resources.getColor(R.color.primary, null) return builder } diff --git a/app/src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java b/app/src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java index 1dc10c93d8c1..af3ba440dbe8 100644 --- a/app/src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java +++ b/app/src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java @@ -512,7 +512,8 @@ private void notifyForgottenLocalFiles() { private NotificationCompat.Builder createNotificationBuilder() { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(getContext()); notificationBuilder.setSmallIcon(R.drawable.notification_icon).setAutoCancel(true); - viewThemeUtils.androidx.themeNotificationCompatBuilder(getContext(), notificationBuilder); + //NMC Customization + notificationBuilder.setColor(getContext().getResources().getColor(R.color.primary, null)); return notificationBuilder; } diff --git a/app/src/main/java/com/owncloud/android/ui/notifications/NotificationUtils.java b/app/src/main/java/com/owncloud/android/ui/notifications/NotificationUtils.java index ee4de5f4a9b4..3685ff069416 100644 --- a/app/src/main/java/com/owncloud/android/ui/notifications/NotificationUtils.java +++ b/app/src/main/java/com/owncloud/android/ui/notifications/NotificationUtils.java @@ -16,6 +16,7 @@ import android.os.HandlerThread; import android.os.Process; +import com.owncloud.android.R; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.utils.theme.ViewThemeUtils; @@ -55,7 +56,8 @@ private NotificationUtils() { */ public static NotificationCompat.Builder newNotificationBuilder(Context context, final ViewThemeUtils viewThemeUtils) { final NotificationCompat.Builder builder = new NotificationCompat.Builder(context); - viewThemeUtils.androidx.themeNotificationCompatBuilder(context, builder); + //NMC Customization + builder.setColor(context.getResources().getColor(R.color.primary, null)); return builder; }