From f87ca689460e409c4361e7d03a6dafc504839cff Mon Sep 17 00:00:00 2001 From: darthpaul Date: Fri, 24 Sep 2021 22:43:35 +0100 Subject: [PATCH] fix dragged view showing in previous location briefly --- .../calendar/pro/fragments/WeekFragment.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 4b75ea2cd..66e4670be 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 @@ -286,7 +286,12 @@ class WeekFragment : Fragment(), WeeklyCalendar { event?.let { val currentStartTime = Formatter.getDateTimeFromTS(it.startTS) val startTime = Formatter.getDateTimeFromTS(weekTimestamp + index * DAY_SECONDS) - .withTime(startHour, currentStartTime.minuteOfHour, currentStartTime.secondOfMinute, currentStartTime.millisOfSecond).seconds() + .withTime( + startHour, + currentStartTime.minuteOfHour, + currentStartTime.secondOfMinute, + currentStartTime.millisOfSecond + ).seconds() val currentEventDuration = event.endTS - event.startTS val endTime = startTime + currentEventDuration context?.eventsHelper?.updateEvent( @@ -771,14 +776,13 @@ class WeekFragment : Fragment(), WeeklyCalendar { return when (dragEvent.action) { DragEvent.ACTION_DRAG_STARTED -> currentlyDraggedView == view DragEvent.ACTION_DRAG_ENTERED -> { - view.beInvisible() + view.beGone() false } // handle ACTION_DRAG_LOCATION due to https://stackoverflow.com/a/19460338 DragEvent.ACTION_DRAG_LOCATION -> true DragEvent.ACTION_DRAG_ENDED -> { currentlyDraggedView = null - view.beVisible() true } else -> false