fix #270, make sure events on monthly view are sorted by time
This commit is contained in:
parent
3a14475004
commit
5c33927754
|
@ -47,7 +47,7 @@ ext {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.38.9'
|
||||
compile 'com.simplemobiletools:commons:2.38.10'
|
||||
compile 'joda-time:joda-time:2.9.9'
|
||||
compile 'com.facebook.stetho:stetho:1.5.0'
|
||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||
|
|
|
@ -294,11 +294,11 @@ private fun addTodaysBackground(textView: TextView, res: Resources, dayLabelHeig
|
|||
textView.addResizedBackgroundDrawable(res, dayLabelHeight, mPrimaryColor, R.drawable.monthly_today_circle)
|
||||
|
||||
fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) {
|
||||
day.dayEvents.forEach {
|
||||
val backgroundDrawable = res.getDrawable(R.drawable.day_monthly_event_background)
|
||||
backgroundDrawable.mutate().setColorFilter(it.color, PorterDuff.Mode.SRC_IN)
|
||||
val backgroundDrawable = res.getDrawable(R.drawable.day_monthly_event_background)
|
||||
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
|
||||
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
day.dayEvents.sortedWith(compareBy({ it.startTS }, { it.endTS }, { it.title })).forEach {
|
||||
backgroundDrawable.mutate().setColorFilter(it.color, PorterDuff.Mode.SRC_IN)
|
||||
eventLayoutParams.setMargins(dividerMargin, 0, dividerMargin, dividerMargin)
|
||||
|
||||
var textColor = it.color.getContrastColor()
|
||||
|
|
Loading…
Reference in New Issue