[Android] Videos: use proper menu update function

Geoffrey Métais git at videolan.org
Tue Oct 1 14:44:36 CEST 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep 26 15:48:44 2019 +0200| [abc36b6d76d53ceac8cb5b4c0d34f3f53b15d26b] | committer: Geoffrey Métais

Videos: use proper menu update function

(cherry picked from commit 513de0b312f6d81fc6869801aedffcd1af44a9e7)

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt         | 2 +-
 .../src/org/videolan/vlc/viewmodels/mobile/AlbumSongsViewModel.kt       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 82bd7aa8e..de116249d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -370,7 +370,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
             if (!mediaLibrary.isWorking) handler.sendEmptyMessage(UNSET_REFRESHING)
             updateEmptyView()
             setFabPlayVisibility(true)
-            UiTools.updateSortTitles(this at VideoGridFragment)
+            menu?.let { UiTools.updateSortTitles(it, viewModel.provider) }
         }
         restoreMultiSelectHelper()
     }
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AlbumSongsViewModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AlbumSongsViewModel.kt
index 8422dc7fc..257065467 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AlbumSongsViewModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/mobile/AlbumSongsViewModel.kt
@@ -52,7 +52,7 @@ class AlbumSongsViewModel(context: Context, val parent: MediaLibraryItem) : Medi
             else -> watchMedia()
         }
         //Initial state coming from preferences and falling back to [providersInCard] hardcoded values
-        for (i in 0 until displayModeKeys.size) {
+        for (i in displayModeKeys.indices) {
             providersInCard[i] = settings.getBoolean(displayModeKeys[i], providersInCard[i])
         }
     }



More information about the Android mailing list