From a69ac965b60e018f2ea2f8b218603bca4e2ceef4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 9 Jul 2021 21:21:45 +0200 Subject: [PATCH] Fix bad timer display --- .../home/room/detail/composer/VoiceMessageRecorderView.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt index cfc922272a..271a3c9acb 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/VoiceMessageRecorderView.kt @@ -69,7 +69,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor( private var lastX: Float = 0f private var lastY: Float = 0f - private var recordingTime: Int = 0 + private var recordingTime: Int = -1 private var amplitudeList = emptyList() private val recordingTimer = Timer() private var recordingTimerTask: TimerTask? = null @@ -266,7 +266,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor( } private fun showRecordingTimer() { - val formattedTimerText = DateUtils.formatElapsedTime((recordingTime).toLong()) + val formattedTimerText = DateUtils.formatElapsedTime(recordingTime.toLong()) if (recordingState == RecordingState.LOCKED) { views.voicePlaybackTime.apply { post { @@ -294,7 +294,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor( private fun stopRecordingTimer() { recordingTimerTask?.cancel() - recordingTime = 0 + recordingTime = -1 } private fun showRecordingViews() {