Loading app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt +1 −3 Original line number Diff line number Diff line Loading @@ -65,12 +65,10 @@ class NotificationService(val context: Context) { val channelId = toChannelId(notification.priority) val builder = NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.ic_notification) .setColor(ContextCompat.getColor(context, Colors.notificationIcon(context))) .setContentTitle(title) .setOnlyAlertOnce(true) // Do not vibrate or play sound if already showing (updates!) .setAutoCancel(true) // Cancel when notification is clicked if (!isDarkThemeOn(context)) { builder.setColor(ContextCompat.getColor(context, Colors.notificationIcon)) } setStyleAndText(builder, subscription, notification) // Preview picture or big text style setClickAction(builder, subscription, notification) maybeSetSound(builder, update) Loading app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt +3 −5 Original line number Diff line number Diff line Loading @@ -290,18 +290,16 @@ class SubscriberService : Service() { val pendingIntent: PendingIntent = Intent(this, MainActivity::class.java).let { notificationIntent -> PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE) } val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) return NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_instant) .setColor(ContextCompat.getColor(this, Colors.notificationIcon(this))) .setContentTitle(title) .setContentText(text) .setContentIntent(pendingIntent) .setSound(null) .setShowWhen(false) // Don't show date/time .setGroup(NOTIFICATION_GROUP_ID) // Do not group with other notifications if (!isDarkThemeOn(this)) { builder.setColor(ContextCompat.getColor(this, Colors.notificationIcon)) } return builder.build() .build() } override fun onBind(intent: Intent): IBinder? { Loading app/src/main/java/io/heckel/ntfy/ui/Colors.kt +4 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,10 @@ import io.heckel.ntfy.util.isDarkThemeOn class Colors { companion object { const val refreshProgressIndicator = R.color.teal const val notificationIcon = R.color.teal fun notificationIcon(context: Context): Int { return if (isDarkThemeOn(context)) R.color.teal_light else R.color.teal } fun itemSelectedBackground(context: Context): Int { return if (isDarkThemeOn(context)) R.color.black_800b else R.color.gray_400 Loading Loading
app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt +1 −3 Original line number Diff line number Diff line Loading @@ -65,12 +65,10 @@ class NotificationService(val context: Context) { val channelId = toChannelId(notification.priority) val builder = NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.ic_notification) .setColor(ContextCompat.getColor(context, Colors.notificationIcon(context))) .setContentTitle(title) .setOnlyAlertOnce(true) // Do not vibrate or play sound if already showing (updates!) .setAutoCancel(true) // Cancel when notification is clicked if (!isDarkThemeOn(context)) { builder.setColor(ContextCompat.getColor(context, Colors.notificationIcon)) } setStyleAndText(builder, subscription, notification) // Preview picture or big text style setClickAction(builder, subscription, notification) maybeSetSound(builder, update) Loading
app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt +3 −5 Original line number Diff line number Diff line Loading @@ -290,18 +290,16 @@ class SubscriberService : Service() { val pendingIntent: PendingIntent = Intent(this, MainActivity::class.java).let { notificationIntent -> PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE) } val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) return NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_instant) .setColor(ContextCompat.getColor(this, Colors.notificationIcon(this))) .setContentTitle(title) .setContentText(text) .setContentIntent(pendingIntent) .setSound(null) .setShowWhen(false) // Don't show date/time .setGroup(NOTIFICATION_GROUP_ID) // Do not group with other notifications if (!isDarkThemeOn(this)) { builder.setColor(ContextCompat.getColor(this, Colors.notificationIcon)) } return builder.build() .build() } override fun onBind(intent: Intent): IBinder? { Loading
app/src/main/java/io/heckel/ntfy/ui/Colors.kt +4 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,10 @@ import io.heckel.ntfy.util.isDarkThemeOn class Colors { companion object { const val refreshProgressIndicator = R.color.teal const val notificationIcon = R.color.teal fun notificationIcon(context: Context): Int { return if (isDarkThemeOn(context)) R.color.teal_light else R.color.teal } fun itemSelectedBackground(context: Context): Int { return if (isDarkThemeOn(context)) R.color.black_800b else R.color.gray_400 Loading