[Android] Fix time not reverse on audio player header

Geoffrey Métais git at videolan.org
Tue May 15 15:01:57 CEST 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 15 15:00:33 2018 +0200| [e0e9cb5d37a29e5e67a3405ffc74064bfbdb0162] | committer: Geoffrey Métais

Fix time not reverse on audio player header

> https://code.videolan.org/videolan/vlc-android/commit/e0e9cb5d37a29e5e67a3405ffc74064bfbdb0162
---

 vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index 4c6ae9cc1..6ef233574 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -244,14 +244,15 @@ class AudioPlayer : PlaybackServiceFragment(), PlaybackService.Callback, Playlis
         if (mService === null) return
         val time = mService.time
         val length = mService.length
+        val timeText = Tools.millisToString((if (mShowRemainingTime) time - length else time))
 
-        mBinding.headerTime.text = Tools.millisToString(time)
+        mBinding.headerTime.text = timeText
         mBinding.length.text = Tools.millisToString(length)
         mBinding.timeline.max = length.toInt()
         mBinding.progressBar.max = length.toInt()
 
         if (!mPreviewingSeek) {
-            mBinding.time.text = Tools.millisToString((if (mShowRemainingTime) time - length else time))
+            mBinding.time.text = timeText
             mBinding.timeline.progress = time.toInt()
             mBinding.progressBar.progress = time.toInt()
         }
@@ -312,7 +313,6 @@ class AudioPlayer : PlaybackServiceFragment(), PlaybackService.Callback, Playlis
 
     fun onTimeLabelClick(view: View) {
         mShowRemainingTime = !mShowRemainingTime
-        update()
     }
 
     fun onPlayPauseClick(view: View) {



More information about the Android mailing list