[Android] File browser: use the correct ViewModel
Geoffrey Métais
git at videolan.org
Tue Feb 4 17:41:43 CET 2020
vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 4 17:00:00 2020 +0100| [e1401e76c1afe2a422a5901d57171af8bf7a7277] | committer: Geoffrey Métais
File browser: use the correct ViewModel
> https://code.videolan.org/videolan/vlc-android/commit/e1401e76c1afe2a422a5901d57171af8bf7a7277
---
.../src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt b/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt
index cc2ac0e85..e3de92bbb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt
@@ -34,10 +34,7 @@ import org.videolan.vlc.util.CATEGORY
import org.videolan.vlc.util.FileUtils
import org.videolan.vlc.util.ITEM
import org.videolan.vlc.util.isSchemeSupported
-import org.videolan.vlc.viewmodels.browser.BrowserModel
-import org.videolan.vlc.viewmodels.browser.NetworkModel
-import org.videolan.vlc.viewmodels.browser.TYPE_FILE
-import org.videolan.vlc.viewmodels.browser.TYPE_NETWORK
+import org.videolan.vlc.viewmodels.browser.*
private const val TAG = "FileBrowserTvFragment"
@UseExperimental(ObsoleteCoroutinesApi::class)
@@ -94,7 +91,7 @@ class FileBrowserTvFragment : BaseBrowserTvFragment(), PathAdapterListener {
isRootLevel = arguments?.getBoolean("rootLevel") ?: false
(item as? MediaWrapper)?.run { mrl = location }
- viewModel = ViewModelProviders.of(this, NetworkModel.Factory(requireContext(), mrl, false)).get(NetworkModel::class.java)
+ viewModel = getBrowserModel(category = getCategory(), url = mrl, showHiddenFiles = false, showDummyCategory = false)
viewModel.currentItem = item
browserFavRepository = BrowserFavRepository.getInstance(requireContext())
More information about the Android
mailing list