[Android] Fix play queue item when there is no subtitle and "stop after this" is enabled
Nicolas Pomepuy
git at videolan.org
Fri Oct 20 12:01:31 UTC 2023
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Oct 10 09:52:13 2023 +0200| [d7e8d20cc176fa9d0afb0ba711177b41e1b78b5c] | committer: Duncan McNamara
Fix play queue item when there is no subtitle and "stop after this" is enabled
> https://code.videolan.org/videolan/vlc-android/commit/d7e8d20cc176fa9d0afb0ba711177b41e1b78b5c
---
application/vlc-android/res/layout/playlist_item.xml | 6 +++++-
.../vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/application/vlc-android/res/layout/playlist_item.xml b/application/vlc-android/res/layout/playlist_item.xml
index 9962fa7951..b109446d47 100644
--- a/application/vlc-android/res/layout/playlist_item.xml
+++ b/application/vlc-android/res/layout/playlist_item.xml
@@ -31,6 +31,10 @@
name="scaleType"
type="android.widget.ImageView.ScaleType" />
+ <variable
+ name="stopAfterThis"
+ type="java.lang.Boolean" />
+
<variable
name="masked"
type="java.lang.Boolean" />
@@ -136,7 +140,7 @@
android:text="@{subTitle}"
android:textColor="?attr/font_audio_light"
android:textSize="12sp"
- android:visibility="@{TextUtils.isEmpty(subTitle) ? View.GONE : View.VISIBLE}"
+ android:visibility="@{TextUtils.isEmpty(subTitle) && !stopAfterThis ? View.GONE : View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/stop_after"
app:layout_constraintHorizontal_bias="0.5"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
index 7e9a28702b..d1a9207859 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
@@ -129,6 +129,7 @@ class PlaylistAdapter(private val player: IPlayer) : DiffUtilAdapter<MediaWrappe
holder.binding.subTitle = MediaUtils.getMediaSubtitle(media)
holder.binding.scaleType = ImageView.ScaleType.CENTER_CROP
holder.binding.stopAfter.visibility = if (stopAfter == position) View.VISIBLE else View.GONE
+ holder.binding.stopAfterThis = (position == stopAfter)
if (currentIndex == position) {
if (model?.playing != false) holder.binding.playing.start() else holder.binding.playing.stop()
holder.binding.playing.visibility = View.VISIBLE
More information about the Android
mailing list