Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.29] Nmc/2250 Notification tray icon customized #202

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down