[Android] Prevent storage fragment to display the fab when launched from the secondary activity

Nicolas Pomepuy git at videolan.org
Thu Aug 5 05:25:53 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Aug  4 08:27:49 2021 +0200| [c7aca9c98cf8d9e1df233323e6dc3c4197baedff] | committer: Nicolas Pomepuy

Prevent storage fragment to display the fab when launched from the secondary activity

Fixes #2119

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

 .../src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt
index 2b666af19..bad2d0ea8 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt
@@ -51,6 +51,7 @@ import org.videolan.tools.*
 import org.videolan.vlc.R
 import org.videolan.vlc.databinding.BrowserItemBinding
 import org.videolan.vlc.gui.AudioPlayerContainerActivity
+import org.videolan.vlc.gui.SecondaryActivity
 import org.videolan.vlc.gui.dialogs.showContext
 import org.videolan.vlc.gui.helpers.ThreeStatesCheckbox
 import org.videolan.vlc.gui.helpers.UiTools
@@ -76,6 +77,11 @@ class StorageBrowserFragment : FileBrowserFragment(), BrowserContainer<MediaLibr
         return StorageBrowserFragment()
     }
 
+    override fun hasFAB(): Boolean {
+        if (requireActivity() is SecondaryActivity) return false
+        return super.hasFAB()
+    }
+
     override fun onCreate(bundle: Bundle?) {
         var bundle = bundle
         super.onCreate(bundle)



More information about the Android mailing list