show more items at event list view or widget
This commit is contained in:
parent
f844c4a0be
commit
eee6d11f9f
|
@ -98,12 +98,12 @@ class EventListWidgetAdapter(val context: Context, val intent: Intent) : RemoteV
|
|||
|
||||
override fun onDataSetChanged() {
|
||||
val fromTS = DateTime().seconds()
|
||||
val toTS = DateTime().plusMonths(6).seconds()
|
||||
val toTS = DateTime().plusYears(1).seconds()
|
||||
DBHelper(context).getEventsInBackground(fromTS, toTS, object : DBHelper.GetEventsListener {
|
||||
override fun gotEvents(events: MutableList<Event>) {
|
||||
val listItems = ArrayList<ListItem>(events.size)
|
||||
val sorted = events.sortedWith(compareBy({ it.startTS }, { it.endTS }, { it.title }, { it.description }))
|
||||
val sublist = sorted.subList(0, Math.min(sorted.size, 50))
|
||||
val sublist = sorted.subList(0, Math.min(sorted.size, 100))
|
||||
var prevCode = ""
|
||||
sublist.forEach {
|
||||
val code = Formatter.getDayCodeFromTS(it.startTS)
|
||||
|
|
|
@ -51,7 +51,7 @@ class EventListFragment : Fragment(), DBHelper.GetEventsListener, DBHelper.Event
|
|||
|
||||
private fun checkEvents() {
|
||||
val fromTS = DateTime().seconds()
|
||||
val toTS = DateTime().plusMonths(6).seconds()
|
||||
val toTS = DateTime().plusYears(1).seconds()
|
||||
DBHelper(context).getEvents(fromTS, toTS, this)
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class EventListFragment : Fragment(), DBHelper.GetEventsListener, DBHelper.Event
|
|||
val filtered = getEventsToShow(events)
|
||||
val listItems = ArrayList<ListItem>(filtered.size)
|
||||
val sorted = filtered.sortedWith(compareBy({ it.startTS }, { it.endTS }, { it.title }, { it.description }))
|
||||
val sublist = sorted.subList(0, Math.min(sorted.size, 50))
|
||||
val sublist = sorted.subList(0, Math.min(sorted.size, 100))
|
||||
var prevCode = ""
|
||||
sublist.forEach {
|
||||
val code = Formatter.getDayCodeFromTS(it.startTS)
|
||||
|
|
Loading…
Reference in New Issue