diff --git a/app/build.gradle b/app/build.gradle index 7fe48c5a6..f481abfe0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:ee9863c9c5' + implementation 'com.github.SimpleMobileTools:Simple-Commons:c3c88596e0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt index bb73ec4a9..384c1a769 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt @@ -429,7 +429,6 @@ class WeekFragment : Fragment(), WeeklyCalendar { addEvents(currEvents) } - @SuppressLint("NewApi") private fun addEvents(events: ArrayList) { initGrid() allDayHolders.clear() @@ -483,9 +482,9 @@ class WeekFragment : Fragment(), WeeklyCalendar { } while (currentDayCode.toInt() <= endDayCode.toInt()) } - eventTimeRanges.forEach { daycode, eventDayList -> + for ((_, eventDayList) in eventTimeRanges) { val eventsCollisionChecked = ArrayList() - eventDayList.forEach { eventId, eventWeeklyView -> + for ((eventId, eventWeeklyView) in eventDayList) { if (eventWeeklyView.slot == 0) { eventWeeklyView.slot = 1 eventWeeklyView.slot_max = 1 @@ -493,7 +492,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { eventsCollisionChecked.add(eventId) val eventWeeklyViewsToCheck = eventDayList.filter { !eventsCollisionChecked.contains(it.key) } - eventWeeklyViewsToCheck.forEach { toCheckId, eventWeeklyViewToCheck -> + for ((toCheckId, eventWeeklyViewToCheck) in eventWeeklyViewsToCheck) { val areTouching = eventWeeklyView.range.touch(eventWeeklyViewToCheck.range) val doHaveCommonMinutes = if (areTouching) { eventWeeklyView.range.upper > eventWeeklyViewToCheck.range.lower || (eventWeeklyView.range.lower == eventWeeklyView.range.upper && @@ -507,7 +506,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { val nextSlot = eventWeeklyView.slot_max + 1 val slotRange = Array(eventWeeklyView.slot_max) { it + 1 } val collisionEventWeeklyViews = eventDayList.filter { eventWeeklyView.collisions.contains(it.key) } - collisionEventWeeklyViews.forEach { collision_id, collisionEventWeeklyView -> + for ((_, collisionEventWeeklyView) in collisionEventWeeklyViews) { if (collisionEventWeeklyView.range.touch(eventWeeklyViewToCheck.range)) { slotRange[collisionEventWeeklyView.slot - 1] = nextSlot } @@ -518,7 +517,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { if (slot == nextSlot) { eventWeeklyViewToCheck.slot_max = nextSlot eventWeeklyView.slot_max = nextSlot - collisionEventWeeklyViews.forEach { collision_id, collisionEventWeeklyView -> + for ((_, collisionEventWeeklyView) in collisionEventWeeklyViews) { collisionEventWeeklyView.slot_max++ } } else {