make sure to add weekly events on the ui thread

This commit is contained in:
tibbi
2017-01-17 19:07:46 +01:00
parent a3b614862d
commit 78b8ece86f

View File

@ -60,10 +60,12 @@ class WeekFragment : Fragment(), WeeklyCalendar {
val layout = mView.findViewById(res.getIdentifier("week_column_$dayOfWeek", "id", context.packageName)) as LinearLayout val layout = mView.findViewById(res.getIdentifier("week_column_$dayOfWeek", "id", context.packageName)) as LinearLayout
LayoutInflater.from(context).inflate(R.layout.week_event_marker, null, false).apply { LayoutInflater.from(context).inflate(R.layout.week_event_marker, null, false).apply {
background = ColorDrawable(eventColor) background = ColorDrawable(eventColor)
activity.runOnUiThread {
layout.addView(this) layout.addView(this)
} }
} }
} }
}
fun setListener(listener: WeekScrollListener) { fun setListener(listener: WeekScrollListener) {
mListener = listener mListener = listener