diff --git a/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthAdapter.kt b/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthAdapter.kt index 380fd98e..c8bcc7f4 100644 --- a/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthAdapter.kt +++ b/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthAdapter.kt @@ -28,8 +28,6 @@ import kotlinx.coroutines.withContext class MonthAdapter(val onDaySelectStateListener: OnDaySelectStateListener) : RecyclerView.Adapter() { - private var timeTest = 0L - private val schedules = mutableListOf() private val currentList = mutableListOf() @@ -64,8 +62,6 @@ class MonthAdapter(val onDaySelectStateListener: OnDaySelectStateListener) : Rec this.schedules.addAll(schedules) this.currentList.clear() this.currentList.addAll(list) - timeTest = System.currentTimeMillis() - Log.e(this::class.simpleName, "setItems") notifyDataSetChanged() } @@ -112,7 +108,7 @@ class MonthAdapter(val onDaySelectStateListener: OnDaySelectStateListener) : Rec } binding.tvMonthDay.setTextColor(textColor) - CoroutineScope(Dispatchers.IO).launch { + CoroutineScope(Dispatchers.Default).launch { val scheduleContainer = makePaddingScheduleList(item, schedules) val hasAnySchedule = scheduleContainer.any { it != null } if (hasAnySchedule) { diff --git a/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthPageAdapter.kt b/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthPageAdapter.kt index fba1943e..48fac801 100644 --- a/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthPageAdapter.kt +++ b/library/src/main/java/com/drunkenboys/ckscalendar/month/MonthPageAdapter.kt @@ -17,8 +17,6 @@ import java.time.LocalDate class MonthPageAdapter : RecyclerView.Adapter() { - private var timeTest = 0L - private val list = mutableListOf() private val schedules = mutableListOf() @@ -40,9 +38,6 @@ class MonthPageAdapter : RecyclerView.Adapter() { cachedCalendar.clear() this.list.clear() this.list.addAll(list) - - timeTest = System.currentTimeMillis() - Log.e(this::class.simpleName, "setItems") notifyDataSetChanged() } @@ -94,7 +89,7 @@ class MonthPageAdapter : RecyclerView.Adapter() { onDayClick: OnDayClickListener?, onDaySecondClick: OnDaySecondClickListener? ) { - CoroutineScope(Dispatchers.IO).launch { + CoroutineScope(Dispatchers.Default).launch { val dates = mutableListOf() val startMonth = item.startDate.monthValue val startDay = item.startDate.dayOfWeek @@ -154,9 +149,6 @@ class MonthPageAdapter : RecyclerView.Adapter() { monthAdapter.onDateSecondClickListener = onDaySecondClick } } - - - Log.e("monthPage", "bind end $adapterPosition ${System.currentTimeMillis() - timeTest}") } private fun makeDates(date: LocalDate, month: Int): List {