Fix bad timer display

This commit is contained in:
Benoit Marty 2021-07-09 21:21:45 +02:00
parent 2c1335a2f5
commit a69ac965b6

View file

@ -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<Int>()
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() {