[Android] Allow picking subtitles on SMB
Nicolas Pomepuy
git at videolan.org
Tue Nov 3 15:47:10 CET 2020
vlc-android | branch: 3.3.x | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Nov 3 10:19:01 2020 +0100| [c4b8a82b9e14b0e869ea0e07c7a02db040d38efb] | committer: Nicolas Pomepuy
Allow picking subtitles on SMB
Fixes #1529
(cherry picked from commit 5b8602e39ccc135db5acc690407232a16afb3050)
> https://code.videolan.org/videolan/vlc-android/commit/c4b8a82b9e14b0e869ea0e07c7a02db040d38efb
---
.../src/org/videolan/vlc/gui/browser/FilePickerActivity.kt | 7 ++++---
.../src/org/videolan/vlc/gui/browser/FilePickerFragment.kt | 8 +-------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerActivity.kt
index d58ed2821..e8b9ab3b5 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerActivity.kt
@@ -28,9 +28,13 @@ import android.view.Gravity
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.medialibrary.interfaces.media.MediaWrapper
import org.videolan.vlc.R
+ at ObsoleteCoroutinesApi
+ at ExperimentalCoroutinesApi
class FilePickerActivity : AppCompatActivity() {
public override fun onCreate(savedInstanceState: Bundle?) {
@@ -54,7 +58,4 @@ class FilePickerActivity : AppCompatActivity() {
fun onCloseClick(v:View) {
finish()
}
-
- companion object {
- }
}
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt
index f9833317c..336add175 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/FilePickerFragment.kt
@@ -69,13 +69,7 @@ class FilePickerFragment : FileBrowserFragment(), BrowserContainer<MediaLibraryI
}
override fun setupBrowser() {
- //if scheme is not file, we want to allow picking anywhere
- val url = try {
- if (Uri.parse(mrl).scheme.isSchemeFile()) mrl else null
- } catch (e: Exception) {
- mrl
- }
- viewModel = ViewModelProviders.of(this, BrowserModel.Factory(requireContext(), url, TYPE_PICKER, false)).get(BrowserModel::class.java)
+ viewModel = ViewModelProviders.of(this, BrowserModel.Factory(requireContext(), mrl, TYPE_PICKER, false)).get(BrowserModel::class.java)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
More information about the Android
mailing list