[Android] Fix media length not displayed in InfoActivity

Nicolas Pomepuy git at videolan.org
Tue Oct 8 16:21:05 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue Oct  8 09:06:34 2019 +0200| [35c758dd8ccbff595e08c8bd3e0f29b097dd04e4] | committer: Geoffrey Métais

Fix media length not displayed in InfoActivity

Refs #1060

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

 vlc-android/src/org/videolan/vlc/gui/InfoActivity.kt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/InfoActivity.kt b/vlc-android/src/org/videolan/vlc/gui/InfoActivity.kt
index 027144fe2..6f24e0fee 100644
--- a/vlc-android/src/org/videolan/vlc/gui/InfoActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/InfoActivity.kt
@@ -22,6 +22,7 @@ import com.google.android.material.snackbar.Snackbar
 import kotlinx.coroutines.*
 import org.videolan.libvlc.Media
 import org.videolan.libvlc.util.Extensions
+import org.videolan.medialibrary.Tools
 import org.videolan.medialibrary.interfaces.AbstractMedialibrary
 import org.videolan.medialibrary.interfaces.media.AbstractArtist
 import org.videolan.medialibrary.interfaces.media.AbstractMediaWrapper
@@ -120,12 +121,13 @@ class InfoActivity : AudioPlayerContainerActivity(), View.OnClickListener, PathA
         val nbTracks = tracks?.size ?: 0
         if (nbTracks > 0) for (media in tracks!!) length += media.length
         if (length > 0)
+            binding.length = Tools.millisToTextLarge(length)
 
-            if (item is AbstractMediaWrapper) {
-                val media = item as AbstractMediaWrapper
-                val resolution = generateResolutionClass(media.width, media.height)
-                binding.resolution = resolution
-            }
+        if (item is AbstractMediaWrapper) {
+            val media = item as AbstractMediaWrapper
+            val resolution = generateResolutionClass(media.width, media.height)
+            binding.resolution = resolution
+        }
 
         binding.scanned = true
         when {



More information about the Android mailing list