[Android] Fix playlist tracks number display

Geoffrey Métais git at videolan.org
Wed Nov 20 10:56:57 CET 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey at videolan.org> | Wed Nov 20 09:55:57 2019 +0000| [3d21f01b898f54d9a17e8da9baa5af4c560ce462] | committer: Geoffrey Métais

Fix playlist tracks number display

Use correct format and prevent I/O from main thread


(cherry picked from commit 98d797a28f3f8bed6c5c4368be040f2479cfc448)

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

 vlc-android/res/values/strings.xml                   | 2 +-
 vlc-android/src/org/videolan/vlc/util/Kextensions.kt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index e7206408f..35d57716b 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -702,7 +702,7 @@
     <string name="popup_force_legacy_title">Use custom Picture-in-Picture popup</string>
     <string name="popup_force_legacy_summary">Use custom Picture-in-Picture resizable popup</string>
     <string name="device_default">Device default</string>
-    <string name="track_number">%s tracks</string>
+    <string name="track_number">%d tracks</string>
     <string name="jump_to">Jump to</string>
     <string name="show_video_thumbnails_summary">Show video thumbnails in lists</string>
     <string name="show_video_thumbnails">Video thumbnails</string>
diff --git a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
index 3d2698368..001336560 100644
--- a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
+++ b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
@@ -154,7 +154,7 @@ fun asyncTextItem(view: TextView, item: MediaLibraryItem?) {
         view.visibility = View.GONE
         return
     }
-    val text = if (item.itemType == MediaLibraryItem.TYPE_PLAYLIST) view.context.getString(org.videolan.vlc.R.string.track_number, item.tracks.size.toString()) else item.description
+    val text = if (item.itemType == MediaLibraryItem.TYPE_PLAYLIST) view.context.getString(R.string.track_number, item.tracksCount) else item.description
     if (text.isNullOrEmpty()) {
         view.visibility = View.GONE
         return



More information about the Android mailing list