lets use a simple return time at getting running events
This commit is contained in:
parent
d9f7707d3f
commit
33d8da8919
|
@ -153,9 +153,7 @@ fun Context.getFilteredEvents(events: List<Event>): List<Event> {
|
|||
}
|
||||
|
||||
fun Context.notifyRunningEvents() {
|
||||
dbHelper.getRunningEvents {
|
||||
it.forEach { notifyEvent(it) }
|
||||
}
|
||||
dbHelper.getRunningEvents().forEach { notifyEvent(it) }
|
||||
}
|
||||
|
||||
fun Context.notifyEvent(event: Event) {
|
||||
|
|
|
@ -393,7 +393,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||
return newEvents
|
||||
}
|
||||
|
||||
fun getRunningEvents(callback: (events: ArrayList<Event>) -> Unit) {
|
||||
fun getRunningEvents(): List<Event> {
|
||||
val events = ArrayList<Event>()
|
||||
val ts = (System.currentTimeMillis() / 1000).toInt()
|
||||
|
||||
|
@ -403,8 +403,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||
events.addAll(fillEvents(cursor))
|
||||
|
||||
events.addAll(getRepeatableEventsFor(ts, ts, true))
|
||||
|
||||
callback(events)
|
||||
return events
|
||||
}
|
||||
|
||||
private fun getEvents(selection: String): List<Event> {
|
||||
|
|
Loading…
Reference in New Issue