fix #992, fixing some monthly widget view related sorting issues

This commit is contained in:
tibbi 2019-11-17 19:00:39 +01:00
parent 05e593e781
commit 93daf501cc
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.launchNewEventIntent import com.simplemobiletools.calendar.pro.extensions.launchNewEventIntent
import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar
import com.simplemobiletools.calendar.pro.models.DayMonthly import com.simplemobiletools.calendar.pro.models.DayMonthly
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import org.joda.time.DateTime import org.joda.time.DateTime
@ -121,6 +122,9 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
addDayNumber(context, views, day, currTextColor, id) addDayNumber(context, views, day, currTextColor, id)
setupDayOpenIntent(context, views, id, day.code) setupDayOpenIntent(context, views, id, day.code)
day.dayEvents = day.dayEvents.asSequence().sortedWith(compareBy({ it.flags and FLAG_ALL_DAY == 0 }, { it.startTS }, { it.title }))
.toMutableList() as ArrayList<Event>
day.dayEvents.forEach { day.dayEvents.forEach {
var backgroundColor = it.color var backgroundColor = it.color
var eventTextColor = backgroundColor.getContrastColor() var eventTextColor = backgroundColor.getContrastColor()