[Android] Fix playlist tracks number display

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


vlc-android | branch: master | Geoffrey Métais <geoffrey at videolan.org> | Wed Nov 20 10:55:57 2019 +0100| [98d797a28f3f8bed6c5c4368be040f2479cfc448] | committer: Geoffrey Métais

Fix playlist tracks number display

Use correct format and prevent I/O from main thread

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

 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 ae5dfd30f..0988a08c2 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -697,7 +697,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 54845f2a5..6d7b0afb5 100644
--- a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
+++ b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
@@ -177,7 +177,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