File tree Expand file tree Collapse file tree
app/src/main/kotlin/com/simplemobiletools/calendar/pro Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ import kotlinx.android.synthetic.main.week_event_marker.view.*
3535import org.joda.time.DateTime
3636import org.joda.time.Days
3737import java.util.*
38- import kotlin.collections.ArrayList
39- import kotlin.collections.LinkedHashMap
4038
4139class WeekFragment : Fragment (), WeeklyCalendar {
4240 private val WEEKLY_EVENT_ID_LABEL = " event_id_label"
@@ -268,7 +266,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
268266 val eventId = dragEvent.clipData.getItemAt(0 ).text.toString().toLong()
269267 val startHour = (dragEvent.y / rowHeight).toInt()
270268 ensureBackgroundThread {
271- val event = context?.eventsDB?.getEventWithId (eventId)
269+ val event = context?.eventsDB?.getEventOrTaskWithId (eventId)
272270 event?.let {
273271 val currentStartTime = Formatter .getDateTimeFromTS(it.startTS)
274272 val startTime = Formatter .getDateTimeFromTS(weekTimestamp + index * DAY_SECONDS )
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ interface EventsDao {
2121 @Query(" SELECT * FROM events WHERE id = :id AND type = $TYPE_TASK " )
2222 fun getTaskWithId (id : Long ): Event ?
2323
24+ @Query(" SELECT * FROM events WHERE id = :id AND type = $TYPE_EVENT OR type = $TYPE_TASK " )
25+ fun getEventOrTaskWithId (id : Long ): Event ?
26+
2427 @Query(" SELECT * FROM events WHERE import_id = :importId AND type = $TYPE_EVENT " )
2528 fun getEventWithImportId (importId : String ): Event ?
2629
You can’t perform that action at this time.
0 commit comments