From 037ff0c55f720f13276a119bdb174a928b2bd070 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 8 Jul 2018 22:21:54 +0200 Subject: [PATCH] show a swipe guide if the user doesnt finish swiping in any side --- .../clock/activities/ReminderActivity.kt | 8 ++++++++ app/src/main/res/layout/activity_reminder.xml | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt index 3909d406..de908cf0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/ReminderActivity.kt @@ -22,6 +22,7 @@ class ReminderActivity : SimpleActivity() { private val increaseVolumeHandler = Handler() private val maxReminderDurationHandler = Handler() + private val swipeGuideFadeHandler = Handler() private var isAlarmReminder = false private var didVibrate = false private var alarm: Alarm? = null @@ -88,6 +89,12 @@ class ReminderActivity : SimpleActivity() { reminder_draggable.animate().x(initialDraggableX).withEndAction { reminder_draggable_background.animate().alpha(0.2f) } + + reminder_guide.animate().alpha(1f).start() + swipeGuideFadeHandler.removeCallbacksAndMessages(null) + swipeGuideFadeHandler.postDelayed({ + reminder_guide.animate().alpha(0f).start() + }, 2000L) } } MotionEvent.ACTION_MOVE -> { @@ -151,6 +158,7 @@ class ReminderActivity : SimpleActivity() { super.onDestroy() increaseVolumeHandler.removeCallbacksAndMessages(null) maxReminderDurationHandler.removeCallbacksAndMessages(null) + swipeGuideFadeHandler.removeCallbacksAndMessages(null) destroyPlayer() } diff --git a/app/src/main/res/layout/activity_reminder.xml b/app/src/main/res/layout/activity_reminder.xml index d10ea0dd..ae2bf82a 100644 --- a/app/src/main/res/layout/activity_reminder.xml +++ b/app/src/main/res/layout/activity_reminder.xml @@ -83,4 +83,15 @@ app:layout_constraintStart_toEndOf="@+id/reminder_draggable" app:layout_constraintTop_toTopOf="@+id/reminder_draggable"/> + +