Commit d0c4bfd1 authored by Geoffrey Métais's avatar Geoffrey Métais

Merge development branch

parent 32062551
......@@ -82,7 +82,7 @@ public class ExternalMonitor extends BroadcastReceiver implements LifecycleObser
}
private static void checkNewStorages(final Context ctx) {
if (AndroidUtil.isICSOrLater && VLCApplication.getMLInstance().isInitiated())
if (VLCApplication.getMLInstance().isInitiated())
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
......
......@@ -110,11 +110,11 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment<BrowserPr
if (mCurrentMedia != null) mMrl = mCurrentMedia.getLocation();
else mMrl = bundle.getString(KEY_MRL);
mSavedPosition = bundle.getInt(KEY_POSITION);
} else if (getActivity().getIntent() != null){
mMrl = getActivity().getIntent().getDataString();
getActivity().setIntent(null);
} else if (requireActivity().getIntent() != null){
mMrl = requireActivity().getIntent().getDataString();
requireActivity().setIntent(null);
}
mShowHiddenFiles = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("browser_show_hidden_files", false);
mShowHiddenFiles = PreferenceManager.getDefaultSharedPreferences(requireContext()).getBoolean("browser_show_hidden_files", false);
mRoot = defineIsRoot();
}
......@@ -162,7 +162,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment<BrowserPr
mProvider.getDescriptionUpdate().observe(this, new Observer<Pair<Integer, String>>() {
@Override
public void onChanged(@Nullable Pair<Integer, String> pair) {
mAdapter.notifyItemChanged(pair.getFirst(), pair.getSecond());
if (pair != null) mAdapter.notifyItemChanged(pair.getFirst(), pair.getSecond());
}
});
initFavorites();
......@@ -290,13 +290,6 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment<BrowserPr
}
}
protected int getBrowserFlags() {
int flags = MediaBrowser.Flag.Interact;
if (mShowHiddenFiles)
flags |= MediaBrowser.Flag.ShowHiddenFiles;
return flags;
}
static class BrowserFragmentHandler extends WeakHandler<BaseBrowserFragment> {
static final int MSG_SHOW_LOADING = 0;
......
......@@ -124,9 +124,4 @@ public class FilePickerFragment extends FileBrowserFragment {
return true;
} else return mMrl.length() < 7;
}
@Override
protected int getBrowserFlags() {
return MediaBrowser.Flag.Interact|MediaBrowser.Flag.NoSlavesAutodetect;
}
}
......@@ -82,7 +82,6 @@ abstract class BrowserProvider(val url: String?, private val showHiddenFiles: Bo
}
}
//TODO Show hidden files
private fun parseSubDirectories() {
synchronized(currentMediaList) {
currentMediaList.addAll(dataset.value)
......
......@@ -3,6 +3,8 @@ package org.videolan.vlc.viewmodels.browser
import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider
import org.videolan.libvlc.util.MediaBrowser
import org.videolan.medialibrary.media.MediaLibraryItem
import org.videolan.medialibrary.media.MediaWrapper
class FilePickerProvider(url: String?) : FileBrowserProvider(url, true, false) {
......@@ -13,8 +15,13 @@ class FilePickerProvider(url: String?) : FileBrowserProvider(url, true, false) {
override fun initBrowser(listener: MediaBrowser.EventListener) {
super.initBrowser(listener)
mediabrowser?.setIgnoreFileTypes("db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv");
mediabrowser?.setIgnoreFileTypes("db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv")
}
override suspend fun addMedia(media: MediaLibraryItem) {
if (media is MediaWrapper && media.type == MediaWrapper.TYPE_SUBTITLE) super.addMedia(media)
}
class Factory(val url: String?): ViewModelProvider.NewInstanceFactory() {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
@Suppress("UNCHECKED_CAST")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment