[Android] Adapter: properly clear handler for marquee

Geoffrey Métais git at videolan.org
Thu Feb 13 14:35:54 CET 2020


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 13 14:35:17 2020 +0100| [6189ab4541ddd9af59ec0dc3c0fe71fa21771e9a] | committer: Geoffrey Métais

Adapter: properly clear handler for marquee

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt  | 4 ++--
 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.kt | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
index 1eb402ff4..006dd5a73 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
@@ -123,7 +123,7 @@ class AudioBrowserAdapter @JvmOverloads constructor(
     }
 
     override fun onDetachedFromRecyclerView(recyclerView: RecyclerView) {
-        handler.removeCallbacksAndMessages(null)
+        if (Settings.listTitleEllipsize == 4) handler.removeCallbacksAndMessages(null)
         super.onDetachedFromRecyclerView(recyclerView)
     }
 
@@ -256,7 +256,7 @@ class AudioBrowserAdapter @JvmOverloads constructor(
         }
 
         override fun recycle() {
-            handler.removeCallbacksAndMessages(null)
+            if (Settings.listTitleEllipsize == 4) handler.removeCallbacksAndMessages(null)
             binding.cover = if (cardSize == SHOW_IN_LIST && defaultCover != null) defaultCover else null
             binding.mediaCover.resetFade()
             binding.title.isSelected = false
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.kt
index f9b4da7fb..307a44417 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.kt
@@ -53,7 +53,6 @@ import org.videolan.vlc.gui.helpers.SelectorViewHolder
 import org.videolan.vlc.gui.helpers.enableMarqueeEffect
 import org.videolan.vlc.util.AndroidDevices
 import org.videolan.vlc.util.Settings
-import org.videolan.vlc.util.Settings.init
 import org.videolan.vlc.util.UPDATE_SELECTION
 import java.util.*
 
@@ -157,6 +156,7 @@ open class BaseBrowserAdapter(protected val fragment: BaseBrowserFragment) : Dif
 
     override fun onViewRecycled(holder: ViewHolder<ViewDataBinding>) {
         super.onViewRecycled(holder)
+        if (Settings.listTitleEllipsize == 0 || Settings.listTitleEllipsize == 4) handler.removeCallbacksAndMessages(null)
         holder.titleView?.isSelected = false
     }
 



More information about the Android mailing list