|
|
|
@ -22,6 +22,7 @@ package org.isoron.uhabits.notifications
|
|
|
|
|
import android.app.*
|
|
|
|
|
import android.content.*
|
|
|
|
|
import android.graphics.BitmapFactory.*
|
|
|
|
|
import android.graphics.Color
|
|
|
|
|
import android.support.v4.app.*
|
|
|
|
|
import android.support.v4.app.NotificationCompat.*
|
|
|
|
|
import org.isoron.androidbase.*
|
|
|
|
@ -71,7 +72,7 @@ class AndroidNotificationTray
|
|
|
|
|
.addAction(checkAction)
|
|
|
|
|
.addAction(snoozeAction)
|
|
|
|
|
|
|
|
|
|
val notification = NotificationCompat.Builder(context)
|
|
|
|
|
val builder = NotificationCompat.Builder(context)
|
|
|
|
|
.setSmallIcon(R.drawable.ic_notification)
|
|
|
|
|
.setContentTitle(habit.name)
|
|
|
|
|
.setContentText(habit.description)
|
|
|
|
@ -84,7 +85,9 @@ class AndroidNotificationTray
|
|
|
|
|
.setWhen(reminderTime)
|
|
|
|
|
.setShowWhen(true)
|
|
|
|
|
.setOngoing(preferences.shouldMakeNotificationsSticky())
|
|
|
|
|
.build()
|
|
|
|
|
if (preferences.shouldMakeNotificationsLed())
|
|
|
|
|
builder.setLights(Color.RED, 1000, 1000)
|
|
|
|
|
val notification = builder.build()
|
|
|
|
|
|
|
|
|
|
val notificationManager = context.getSystemService(
|
|
|
|
|
Activity.NOTIFICATION_SERVICE) as NotificationManager
|
|
|
|
|