[Android] Avoid showing grouping options on non root grid

Nicolas Pomepuy git at videolan.org
Tue Oct 1 14:44:33 CEST 2019


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Sep 26 11:13:12 2019 +0200| [a7b4c52e856f5fc1c99f831954c929d1a46cfbe8] | committer: Geoffrey Métais

Avoid showing grouping options on non root grid

(cherry picked from commit 4c5913be035ec4e493a3672c8ad4c89a44ed6ba0)

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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 36ba5352e..920463a59 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -125,7 +125,10 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
     override fun onPrepareOptionsMenu(menu: Menu) {
         super.onPrepareOptionsMenu(menu)
         menu.findItem(R.id.ml_menu_last_playlist).isVisible = true
-        menu.findItem(R.id.ml_menu_video_group).isVisible = true
+        menu.findItem(R.id.ml_menu_video_group).isVisible = viewModel.group == null && viewModel.folder == null
+        val displayInCards = Settings.getInstance(requireActivity()).getBoolean("video_display_in_cards", true)
+        menu.findItem(R.id.ml_menu_display_grid).isVisible = displayInCards
+        menu.findItem(R.id.ml_menu_display_list).isVisible = !displayInCards
     }
 
     override fun onOptionsItemSelected(item: MenuItem): Boolean {



More information about the Android mailing list