mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
show all-day events above others on some views in some cases
This commit is contained in:
parent
687927b24a
commit
34c145d328
@ -94,8 +94,8 @@ class DayFragment : Fragment() {
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(R.string.ok) { dialog, which -> positivePressed(dateTime, datePicker) }
|
||||
.create().apply {
|
||||
activity?.setupDialogStuff(view, this)
|
||||
}
|
||||
activity?.setupDialogStuff(view, this)
|
||||
}
|
||||
}
|
||||
|
||||
private fun positivePressed(dateTime: DateTime, datePicker: DatePicker) {
|
||||
@ -123,7 +123,7 @@ class DayFragment : Fragment() {
|
||||
lastHash = newHash
|
||||
|
||||
val replaceDescription = context!!.config.replaceDescription
|
||||
val sorted = ArrayList<Event>(filtered.sortedWith(compareBy({ it.startTS }, { it.endTS }, { it.title }, {
|
||||
val sorted = ArrayList<Event>(filtered.sortedWith(compareBy({ !it.getIsAllDay() }, { it.startTS }, { it.endTS }, { it.title }, {
|
||||
if (replaceDescription) it.location else it.description
|
||||
})))
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
package com.simplemobiletools.calendar.models
|
||||
|
||||
data class MonthViewEvent(val id: Int, val title: String, val startTS: Int, val color: Int, val startDayIndex: Int, val daysCnt: Int, val originalStartDayIndex: Int)
|
||||
data class MonthViewEvent(val id: Int, val title: String, val startTS: Int, val color: Int, val startDayIndex: Int, val daysCnt: Int, val originalStartDayIndex: Int,
|
||||
val isAllDay: Boolean)
|
||||
|
@ -87,13 +87,14 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
||||
day.dayEvents.forEach {
|
||||
val event = it
|
||||
if (allEvents.firstOrNull { it.id == event.id } == null) {
|
||||
val monthViewEvent = MonthViewEvent(event.id, event.title, event.startTS, event.color, day.indexOnMonthView, getEventLastingDaysCount(event), day.indexOnMonthView)
|
||||
val monthViewEvent = MonthViewEvent(event.id, event.title, event.startTS, event.color, day.indexOnMonthView,
|
||||
getEventLastingDaysCount(event), day.indexOnMonthView, event.getIsAllDay())
|
||||
allEvents.add(monthViewEvent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allEvents = allEvents.sortedWith(compareBy({ -it.daysCnt }, { it.startTS }, { it.startDayIndex }, { it.title })).toMutableList() as ArrayList<MonthViewEvent>
|
||||
allEvents = allEvents.sortedWith(compareBy({ -it.daysCnt }, { !it.isAllDay }, { it.startTS }, { it.startDayIndex }, { it.title })).toMutableList() as ArrayList<MonthViewEvent>
|
||||
invalidate()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user