From 30e15b813cdbfcffae69fa6a464b5fbe5b1ed574 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Mon, 9 Mar 2020 22:02:46 +0100 Subject: [PATCH] [HotFix/Timers] Change timers intervals from 1s to 500ms. --- .../szczodrzynski/edziennik/ui/dialogs/bell/BellSyncDialog.kt | 2 +- .../edziennik/ui/modules/home/CounterActivity.kt | 2 +- .../szczodrzynski/edziennik/ui/modules/home/HomeDummyCard.kt | 4 ++-- .../edziennik/ui/modules/home/cards/HomeTimetableCard.kt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/bell/BellSyncDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/bell/BellSyncDialog.kt index 738408eb..ab1b1f8f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/bell/BellSyncDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/bell/BellSyncDialog.kt @@ -90,7 +90,7 @@ class BellSyncDialog( } launch { - counterJob = startCoroutineTimer(repeatMillis = 1000) { + counterJob = startCoroutineTimer(repeatMillis = 500) { val (bellDiff, multiplier) = actualBellDiff val bellDiffText = (if (multiplier == -1) '-' else '+') + bellDiff.stringHMS b.bellSyncHowto.text = app.getString(R.string.bell_sync_howto, bellTime.stringHM, bellDiffText) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.kt index d7428a50..36002444 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.kt @@ -71,7 +71,7 @@ class CounterActivity : AppCompatActivity(), CoroutineScope { bellSyncDiffMillis *= app.config.timetable.bellSyncMultiplier.toLong() } - counterJob = startCoroutineTimer(repeatMillis = 1000) { + counterJob = startCoroutineTimer(repeatMillis = 500) { update() } }} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeDummyCard.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeDummyCard.kt index ac271b9c..1f6904d2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeDummyCard.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeDummyCard.kt @@ -39,7 +39,7 @@ class HomeDummyCard(override val id: Int) : HomeCard, CoroutineScope { } holder.root += text - timer = startCoroutineTimer(repeatMillis = 1000) { + timer = startCoroutineTimer(repeatMillis = 500) { time++ text.text = "Coroutine timer at #$id! $time seconds" } @@ -57,4 +57,4 @@ class HomeDummyCard(override val id: Int) : HomeCard, CoroutineScope { timer?.cancel() timer = null } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt index c33a52b4..f3d5a88b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeTimetableCard.kt @@ -249,7 +249,7 @@ class HomeTimetableCard( subjectSpannable = firstLesson.subjectSpannable - counterJob = startCoroutineTimer(repeatMillis = 1000) { + counterJob = startCoroutineTimer(repeatMillis = 500) { count() } }