[Android] Fix focus lost on video tracks on TV

Nicolas Pomepuy git at videolan.org
Thu Mar 2 12:56:40 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Mar  1 15:13:42 2023 +0100| [357dc1495d67a2f15f72146da7539064c6b0733a] | committer: Nicolas Pomepuy

Fix focus lost on video tracks on TV

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

 .../src/org/videolan/vlc/gui/dialogs/adapters/TrackAdapter.kt         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/adapters/TrackAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/adapters/TrackAdapter.kt
index d8b10de535..9fc74584b2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/adapters/TrackAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/adapters/TrackAdapter.kt
@@ -66,8 +66,10 @@ class TrackAdapter(private val tracks: Array<VlcTrack>, var selectedTrack: VlcTr
         init {
 
             itemView.setOnClickListener {
+                val oldSelectedIndex = tracks.indexOf(selectedTrack)
                 selectedTrack = tracks[layoutPosition]
-                notifyDataSetChanged()
+                notifyItemChanged(oldSelectedIndex)
+                notifyItemChanged(layoutPosition)
                 trackSelectedListener.invoke(tracks[layoutPosition])
             }
         }



More information about the Android mailing list