mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-05 13:08:28 +01:00
fix changing event filters at the Event List view
This commit is contained in:
parent
492ab31ce0
commit
907abbf5cf
@ -27,7 +27,6 @@ import java.util.*
|
||||
class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
||||
private var mEvents: List<Event> = ArrayList()
|
||||
private var prevEventsHash = 0
|
||||
private var lastHash = 0
|
||||
private var use24HourFormat = false
|
||||
lateinit var mView: View
|
||||
|
||||
@ -66,14 +65,9 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
||||
}
|
||||
|
||||
private fun receivedEvents(events: MutableList<Event>) {
|
||||
if (context == null || activity == null)
|
||||
return
|
||||
|
||||
val newHash = events.hashCode()
|
||||
if (newHash == lastHash) {
|
||||
if (context == null || activity == null) {
|
||||
return
|
||||
}
|
||||
lastHash = newHash
|
||||
|
||||
val filtered = context!!.getFilteredEvents(events)
|
||||
val hash = filtered.hashCode()
|
||||
|
@ -17,7 +17,6 @@ import com.simplemobiletools.calendar.models.EventType
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CALENDAR
|
||||
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_CALENDAR
|
||||
import org.joda.time.DateTimeZone
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
@ -197,7 +196,7 @@ class CalDAVHandler(val context: Context) {
|
||||
val fetchedEventIds = ArrayList<String>()
|
||||
val existingEvents = context.dbHelper.getEventsFromCalDAVCalendar(calendarId)
|
||||
existingEvents.forEach {
|
||||
importIdsMap.put(it.importId, it)
|
||||
importIdsMap[it.importId] = it
|
||||
}
|
||||
|
||||
val uri = CalendarContract.Events.CONTENT_URI
|
||||
@ -283,7 +282,7 @@ class CalDAVHandler(val context: Context) {
|
||||
|
||||
if (title.isNotEmpty()) {
|
||||
context.dbHelper.insert(event, false) {
|
||||
importIdsMap.put(event.importId, event)
|
||||
importIdsMap[event.importId] = event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user