[Android] Fix audio more item visibility on scroll

Nicolas Pomepuy git at videolan.org
Tue Sep 7 07:36:37 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Sep  6 09:04:37 2021 +0200| [e1681ee1b0dfe9fecee066b5d044a7cb007201d7] | committer: Nicolas Pomepuy

Fix audio more item visibility on scroll

Fixes #2165

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

 application/vlc-android/res/layout/audio_browser_card_item.xml      | 6 +++++-
 application/vlc-android/res/layout/audio_browser_item.xml           | 6 +++++-
 .../src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt           | 1 +
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/res/layout/audio_browser_card_item.xml b/application/vlc-android/res/layout/audio_browser_card_item.xml
index 101e0efb1..97c177328 100644
--- a/application/vlc-android/res/layout/audio_browser_card_item.xml
+++ b/application/vlc-android/res/layout/audio_browser_card_item.xml
@@ -44,6 +44,10 @@
                 name="isPresent"
                 type="boolean" />
 
+        <variable
+                name="inSelection"
+                type="boolean" />
+
         <variable
                 name="selected"
                 type="boolean" />
@@ -208,7 +212,7 @@
                     android:contentDescription="@string/more_actions"
                     android:onClick="@{holder::onMoreClick}"
                     android:scaleType="center"
-                    android:visibility="@{isPresent ? View.VISIBLE : View.GONE}"
+                    android:visibility="@{isPresent && !inSelection ? View.VISIBLE : View.GONE}"
                     vlc:layout_constraintBottom_toBottomOf="parent"
                     vlc:layout_constraintEnd_toEndOf="parent"
                     vlc:layout_constraintTop_toTopOf="@+id/title"
diff --git a/application/vlc-android/res/layout/audio_browser_item.xml b/application/vlc-android/res/layout/audio_browser_item.xml
index 31a10355b..a88a31696 100644
--- a/application/vlc-android/res/layout/audio_browser_item.xml
+++ b/application/vlc-android/res/layout/audio_browser_item.xml
@@ -36,6 +36,10 @@
                 name="isPresent"
                 type="boolean" />
 
+        <variable
+                name="inSelection"
+                type="boolean" />
+
         <variable
                 name="selected"
                 type="boolean" />
@@ -197,7 +201,7 @@
                 android:onClick="@{holder::onMoreClick}"
                 android:scaleType="center"
                 vlc:srcCompat="@drawable/ic_more"
-                android:visibility="@{isPresent ? View.VISIBLE : View.GONE}"
+                android:visibility="@{isPresent && !inSelection ? View.VISIBLE : View.GONE}"
                 android:background="?attr/selectableItemBackgroundBorderless"
                 vlc:layout_constraintBottom_toBottomOf="@+id/subtitle"
                 vlc:layout_constraintEnd_toEndOf="parent"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
index 68df8e766..8ef8cd62d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
@@ -141,6 +141,7 @@ class AudioBrowserAdapter @JvmOverloads constructor(
         holder.selectView(isSelected)
         holder.binding.setVariable(BR.isNetwork,(item as? MediaWrapper)?.uri?.scheme?.isSchemeDistant() ?: false)
         holder.binding.setVariable(BR.isPresent,(item as? MediaWrapper)?.isPresent ?: true)
+        holder.binding.setVariable(BR.inSelection,multiSelectHelper.inActionMode)
         holder.binding.executePendingBindings()
         if (position == focusNext) {
             holder.binding.root.requestFocus()



More information about the Android mailing list