Skip to content

Commit

Permalink
Issue boostcampwm-2021#104 feat: 코루틴 Dispatcher 변경 IO -> Default, 테스트…
Browse files Browse the repository at this point in the history
… 로그 제거
  • Loading branch information
PsPLoG committed Nov 11, 2021
1 parent bc2b169 commit ffd22b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import kotlinx.coroutines.withContext

class MonthAdapter(val onDaySelectStateListener: OnDaySelectStateListener) : RecyclerView.Adapter<MonthAdapter.Holder>() {

private var timeTest = 0L

private val schedules = mutableListOf<CalendarScheduleObject>()

private val currentList = mutableListOf<CalendarDate>()
Expand Down Expand Up @@ -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()
}

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import java.time.LocalDate

class MonthPageAdapter : RecyclerView.Adapter<MonthPageAdapter.Holder>() {

private var timeTest = 0L

private val list = mutableListOf<CalendarSet>()

private val schedules = mutableListOf<CalendarScheduleObject>()
Expand All @@ -40,9 +38,6 @@ class MonthPageAdapter : RecyclerView.Adapter<MonthPageAdapter.Holder>() {
cachedCalendar.clear()
this.list.clear()
this.list.addAll(list)

timeTest = System.currentTimeMillis()
Log.e(this::class.simpleName, "setItems")
notifyDataSetChanged()
}

Expand Down Expand Up @@ -94,7 +89,7 @@ class MonthPageAdapter : RecyclerView.Adapter<MonthPageAdapter.Holder>() {
onDayClick: OnDayClickListener?,
onDaySecondClick: OnDaySecondClickListener?
) {
CoroutineScope(Dispatchers.IO).launch {
CoroutineScope(Dispatchers.Default).launch {
val dates = mutableListOf<CalendarDate>()
val startMonth = item.startDate.monthValue
val startDay = item.startDate.dayOfWeek
Expand Down Expand Up @@ -154,9 +149,6 @@ class MonthPageAdapter : RecyclerView.Adapter<MonthPageAdapter.Holder>() {
monthAdapter.onDateSecondClickListener = onDaySecondClick
}
}


Log.e("monthPage", "bind end $adapterPosition ${System.currentTimeMillis() - timeTest}")
}

private fun makeDates(date: LocalDate, month: Int): List<CalendarDate> {
Expand Down

0 comments on commit ffd22b2

Please sign in to comment.