[Android] Fix network browser showing up FAB once stopped

Geoffrey Métais git at videolan.org
Fri Jul 12 14:39:16 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul 12 14:38:27 2019 +0200| [6cafacc4eb3a837552d6c87db495145563cbf6a6] | committer: Geoffrey Métais

Fix network browser showing up FAB once stopped

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

 .../src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
index 9e4d182be..2ecadb57b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.kt
@@ -41,6 +41,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.ObsoleteCoroutinesApi
 import kotlinx.coroutines.launch
 import org.videolan.medialibrary.interfaces.media.AbstractMediaWrapper
+import org.videolan.tools.isStarted
 import org.videolan.vlc.ExternalMonitor
 import org.videolan.vlc.R
 import org.videolan.vlc.VLCApplication
@@ -80,7 +81,7 @@ class NetworkBrowserFragment : BaseBrowserFragment() {
     }
 
     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
-        inflater!!.inflate(R.menu.fragment_option_network, menu)
+        inflater.inflate(R.menu.fragment_option_network, menu)
         super.onCreateOptionsMenu(menu, inflater)
     }
 
@@ -105,7 +106,6 @@ class NetworkBrowserFragment : BaseBrowserFragment() {
         if (!isRootDirectory) LocalBroadcastManager.getInstance(VLCApplication.appContext).registerReceiver(mLocalReceiver, IntentFilter(VlcLoginDialog.ACTION_DIALOG_CANCELED))
         fabPlay?.setImageResource(if (isRootDirectory) R.drawable.ic_fab_add else R.drawable.ic_fab_play)
         fabPlay?.setOnClickListener(this)
-        setFabPlayVisibility(true)
     }
 
     override fun refresh() {
@@ -192,6 +192,6 @@ class NetworkBrowserFragment : BaseBrowserFragment() {
 
     override fun onUpdateFinished(adapter: RecyclerView.Adapter<*>) {
         super.onUpdateFinished(adapter)
-        if (isRootDirectory) fabPlay?.show()
+        if (isRootDirectory && isStarted()) fabPlay?.show()
     }
 }



More information about the Android mailing list