[Android] Make the track info scroll in audio player

Nicolas Pomepuy git at videolan.org
Tue Feb 8 14:39:35 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Jan 24 11:36:37 2022 +0100| [0cf1d70d80041b01d472a45080a7da8186f89235] | committer: Nicolas Pomepuy

Make the track info scroll in audio player

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

 application/vlc-android/res/layout-land/audio_player.xml                | 2 ++
 application/vlc-android/res/layout/cover_media_switcher_item.xml        | 1 +
 application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt   | 1 +
 .../vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt     | 2 ++
 4 files changed, 6 insertions(+)

diff --git a/application/vlc-android/res/layout-land/audio_player.xml b/application/vlc-android/res/layout-land/audio_player.xml
index 30111a269..cfc54ade7 100644
--- a/application/vlc-android/res/layout-land/audio_player.xml
+++ b/application/vlc-android/res/layout-land/audio_player.xml
@@ -517,6 +517,8 @@
                     android:layout_marginEnd="24dp"
                     android:layout_marginBottom="16dp"
                     android:maxLines="1"
+                    android:ellipsize="marquee"
+                    android:marqueeRepeatLimit="1"
                     android:textColor="?attr/font_audio_light"
                     android:textSize="12sp"
                     app:layout_constrainedWidth="true"
diff --git a/application/vlc-android/res/layout/cover_media_switcher_item.xml b/application/vlc-android/res/layout/cover_media_switcher_item.xml
index b1a3f97d6..809f5a562 100644
--- a/application/vlc-android/res/layout/cover_media_switcher_item.xml
+++ b/application/vlc-android/res/layout/cover_media_switcher_item.xml
@@ -107,6 +107,7 @@
                 android:layout_marginEnd="24dp"
                 android:layout_marginBottom="32dp"
                 android:maxLines="1"
+                android:singleLine="true"
                 android:textColor="?attr/font_audio_light"
                 android:textSize="12sp"
                 app:layout_constrainedWidth="true"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index f50eefc84..4c95b1b2c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -316,6 +316,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
         binding.songSubtitle?.isSelected = true
         binding.songTrackInfo?.text = playlistModel.service?.trackInfo()
         binding.songTrackInfo?.visibility = if (Settings.showAudioTrackInfo) View.VISIBLE else View.GONE
+        binding.songTrackInfo?.isSelected = true
 
         binding.audioRewindText.text = "${Settings.audioJumpDelay}"
         binding.audioForwardText.text = "${Settings.audioJumpDelay}"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt
index 108170d18..0a90a8d96 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt
@@ -66,6 +66,8 @@ class CoverMediaSwitcher(context: Context, attrs: AttributeSet) : AudioMediaSwit
         if (Settings.listTitleEllipsize == 4) titleView.isSelected = true
         setEllipsizeModeByPref(artistView, true)
         if (Settings.listTitleEllipsize == 4) artistView.isSelected = true
+        setEllipsizeModeByPref(trackInfoView, true)
+        if (Settings.listTitleEllipsize == 4) trackInfoView.isSelected = true
 
         addView(v)
 



More information about the Android mailing list