mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-19 21:20:43 +01:00
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 {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.38.9'
|
compile 'com.simplemobiletools:commons:2.38.10'
|
||||||
compile 'joda-time:joda-time:2.9.9'
|
compile 'joda-time:joda-time:2.9.9'
|
||||||
compile 'com.facebook.stetho:stetho:1.5.0'
|
compile 'com.facebook.stetho:stetho:1.5.0'
|
||||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
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)
|
textView.addResizedBackgroundDrawable(res, dayLabelHeight, mPrimaryColor, R.drawable.monthly_today_circle)
|
||||||
|
|
||||||
fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) {
|
fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) {
|
||||||
day.dayEvents.forEach {
|
val backgroundDrawable = res.getDrawable(R.drawable.day_monthly_event_background)
|
||||||
val backgroundDrawable = res.getDrawable(R.drawable.day_monthly_event_background)
|
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
backgroundDrawable.mutate().setColorFilter(it.color, PorterDuff.Mode.SRC_IN)
|
|
||||||
|
|
||||||
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)
|
eventLayoutParams.setMargins(dividerMargin, 0, dividerMargin, dividerMargin)
|
||||||
|
|
||||||
var textColor = it.color.getContrastColor()
|
var textColor = it.color.getContrastColor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user