mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-24 15:31:05 +01:00
use the event title and description at the event notification
This commit is contained in:
parent
86fd2f6fac
commit
28e1b06703
@ -32,8 +32,7 @@ class NotificationReceiver : BroadcastReceiver() {
|
|||||||
val pendingIntent = getPendingIntent(context, event)
|
val pendingIntent = getPendingIntent(context, event)
|
||||||
val startTime = Formatter.getTimeFromTS(context, event.startTS)
|
val startTime = Formatter.getTimeFromTS(context, event.startTS)
|
||||||
val endTime = Formatter.getTimeFromTS(context, event.endTS)
|
val endTime = Formatter.getTimeFromTS(context, event.endTS)
|
||||||
val title = event.title
|
val notification = getNotification(context, pendingIntent, event.title, "${getEventTime(startTime, endTime)} ${event.description}")
|
||||||
val notification = getNotification(context, pendingIntent, "${getEventTime(startTime, endTime)} $title")
|
|
||||||
notificationManager.notify(id, notification)
|
notificationManager.notify(id, notification)
|
||||||
|
|
||||||
if (event.repeatInterval != 0)
|
if (event.repeatInterval != 0)
|
||||||
@ -48,10 +47,10 @@ class NotificationReceiver : BroadcastReceiver() {
|
|||||||
return PendingIntent.getActivity(context, event.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
return PendingIntent.getActivity(context, event.id, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getNotification(context: Context, pendingIntent: PendingIntent, content: String): Notification {
|
private fun getNotification(context: Context, pendingIntent: PendingIntent, title: String, content: String): Notification {
|
||||||
val soundUri = Uri.parse(context.config.reminderSound)
|
val soundUri = Uri.parse(context.config.reminderSound)
|
||||||
val builder = Notification.Builder(context)
|
val builder = Notification.Builder(context)
|
||||||
.setContentTitle(context.resources.getString(R.string.app_name))
|
.setContentTitle(title)
|
||||||
.setContentText(content)
|
.setContentText(content)
|
||||||
.setSmallIcon(R.drawable.ic_calendar)
|
.setSmallIcon(R.drawable.ic_calendar)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
|
Loading…
Reference in New Issue
Block a user