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