mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
hide the event notification if the edit screen opens in any way
This commit is contained in:
@@ -89,6 +89,8 @@ class EventActivity : SimpleActivity() {
|
|||||||
if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) {
|
if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) {
|
||||||
mEvent.id = 0
|
mEvent.id = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cancelNotification(mEvent.id)
|
||||||
} else {
|
} else {
|
||||||
mEvent = Event()
|
mEvent = Event()
|
||||||
mReminder1Minutes = config.defaultReminderMinutes
|
mReminder1Minutes = config.defaultReminderMinutes
|
||||||
|
@@ -119,8 +119,7 @@ fun Context.scheduleEventIn(notifTS: Long, event: Event, activity: SimpleActivit
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Context.cancelNotification(id: Int) {
|
fun Context.cancelNotification(id: Int) {
|
||||||
val intent = Intent(applicationContext, NotificationReceiver::class.java)
|
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).cancel(id)
|
||||||
PendingIntent.getBroadcast(applicationContext, id, intent, PendingIntent.FLAG_UPDATE_CURRENT).cancel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getNotificationIntent(context: Context, event: Event): PendingIntent {
|
private fun getNotificationIntent(context: Context, event: Event): PendingIntent {
|
||||||
|
Reference in New Issue
Block a user