[Android] Show bitrate in mediaInfo when not 0

Geoffrey Métais git at videolan.org
Tue Jan 12 13:49:59 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 12 13:35:46 2016 +0100| [60fa6ed846a2b0329e26aa235c4759ce954150f1] | committer: Geoffrey Métais

Show bitrate in mediaInfo when not 0

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

 vlc-android/res/layout/info_item.xml                             | 2 --
 vlc-android/res/values/strings.xml                               | 1 +
 vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java | 2 ++
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/layout/info_item.xml b/vlc-android/res/layout/info_item.xml
index 5094c28..bec1577 100644
--- a/vlc-android/res/layout/info_item.xml
+++ b/vlc-android/res/layout/info_item.xml
@@ -28,7 +28,6 @@
             android:fontFamily="sans-serif-light"
             android:textColor="?attr/list_title"
             android:textSize="16sp"
-            android:singleLine="true"
             android:scrollHorizontally="true"/>
 
         <TextView
@@ -40,7 +39,6 @@
             android:layout_marginRight="5dip"
             android:fontFamily="sans-serif-light"
             android:textColor="?attr/list_subtitle"
-            android:singleLine="true"
             android:ellipsize="start" />
     </LinearLayout>
 
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 3c61089..7baab9e 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -123,6 +123,7 @@
     <string name="track_video">Video track</string>
     <string name="track_text">Subtitle track</string>
     <string name="track_unknown">Unknown track</string>
+    <string name="track_bitrate_info">Bitrate: %1$s/s\n</string>
     <string name="track_codec_info">Codec: %1$s\n</string>
     <string name="track_language_info">Language: %1$s\n</string>
     <string name="volume">Volume</string>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java
index e436248..0965b02 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java
@@ -82,6 +82,8 @@ public class MediaInfoAdapter extends ArrayAdapter<Media.Track> {
     }
 
     private void appendCommon(StringBuilder textBuilder, Resources res, Media.Track track) {
+        if (track.bitrate != 0)
+            textBuilder.append(res.getString(R.string.track_bitrate_info, track.bitrate));
         textBuilder.append(res.getString(R.string.track_codec_info, track.codec));
         if (track.language != null && !track.language.equalsIgnoreCase("und"))
             textBuilder.append(res.getString(R.string.track_language_info, track.language));



More information about the Android mailing list