[Android] TV: reset lines only when necessary

Geoffrey Métais git at videolan.org
Fri Jul 5 14:07:46 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul  5 14:05:34 2019 +0200| [38480cedbc873b0e4fcb55e77ec47bbe0db2773e] | committer: Geoffrey Métais

TV: reset lines only when necessary

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

 vlc-android/src/org/videolan/vlc/gui/tv/MainTvFragment.kt | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvFragment.kt b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvFragment.kt
index ebdbdf97d..e3898a59c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvFragment.kt
@@ -182,20 +182,16 @@ class MainTvFragment : BrowseSupportFragment(), OnItemViewSelectedListener, OnIt
     }
 
     private fun resetLines() {
-
         val adapters = listOf(nowPlayingRow, videoRow, audioRow, playlistRow, historyRow, browsersRow, miscRow).filter {
-
             when {
                 !displayHistory && it == historyRow -> false
                 !displayPlaylist && it == playlistRow -> false
                 !displayNowPlaying && it == nowPlayingRow -> false
-
                 else -> true
-
             }
 
         }
-        rowsAdapter.setItems(adapters, TvUtil.listDiffCallback)
+        if (adapters.size != rowsAdapter.size()) rowsAdapter.setItems(adapters, TvUtil.listDiffCallback)
     }
 
     override fun onStart() {



More information about the Android mailing list