Android – Set the Background Color Notification Notification

private fun createTimerNotification(application: Application, body: String): Notification {
    return NotificationCompat.Builder(application, FOREGROUND_TIMER_NOTIFICATION_CHANNEL_ID)
        .setContentTitle("Title")
        .setContentText(body)
        .setColor(AccentPurple.toArgb())
        .setColorized(true)
        .setStyle(NotificationCompat.DecoratedCustomViewStyle())
        .setPriority(NotificationCompat.PRIORITY_MIN)
        .setWhen(0)
        .setSmallIcon(R.drawable.ic_launcher_foreground)
        .setOngoing(true)
        .build()
}

Leave a Reply