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 c1115de62e35..af172c02d992 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 018267e06822..75e1bae42ee3 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 b1dd6e2143bb..e54885488572 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 e6f37a16e2cd..1000da8bdc3e 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt @@ -163,7 +163,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()) { @@ -219,9 +220,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 ec6012f533ff..93ddf8f74131 100644 --- a/app/src/main/java/com/nextcloud/client/media/PlayerService.kt +++ b/app/src/main/java/com/nextcloud/client/media/PlayerService.kt @@ -110,7 +110,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).apply { 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 5c29b972134f..e2c141a36243 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 64a80fb345aa..e04093d06c01 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 184517f4a8c8..e381fee35aec 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, String channelId, final ViewThemeUtils viewThemeUtils) { final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId); - viewThemeUtils.androidx.themeNotificationCompatBuilder(context, builder); + // NMC Customization + builder.setColor(context.getResources().getColor(R.color.primary, null)); return builder; }