[Android] ML settings: Decode folders mrl

Geoffrey Métais git at videolan.org
Fri Mar 30 16:51:07 CEST 2018


vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar  9 17:57:38 2018 +0100| [d09ee78b0234d9d44c1b51935cf4941ea6567c58] | committer: Geoffrey Métais

ML settings: Decode folders mrl

(cherry picked from commit 0211b8df977726ffff96fc73e2b9850f6007adf4)

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java
index 6c63db046..e9ba0604a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserAdapter.java
@@ -23,6 +23,7 @@
 
 package org.videolan.vlc.gui.browser;
 
+import android.net.Uri;
 import android.support.annotation.MainThread;
 import android.view.View;
 import android.widget.CheckBox;
@@ -57,8 +58,7 @@ class StorageBrowserAdapter extends BaseBrowserAdapter {
         if (storage.getItemType() == MediaLibraryItem.TYPE_MEDIA)
             storage = new Storage(((MediaWrapper)storage).getUri());
         String storagePath = ((Storage)storage).getUri().getPath();
-        if (!storagePath.endsWith("/"))
-            storagePath += "/";
+        if (!storagePath.endsWith("/")) storagePath += "/";
         boolean hasContextMenu = mCustomDirsLocation.contains(storagePath);
         boolean checked = ((StorageBrowserFragment) fragment).mScannedDirectory || mMediaDirsLocation.contains(storagePath);
         vh.binding.setItem(storage);
@@ -93,7 +93,7 @@ class StorageBrowserAdapter extends BaseBrowserAdapter {
         final String folders[] = VLCApplication.getMLInstance().getFoldersList();
         mMediaDirsLocation = new ArrayList<>(folders.length);
         for (String folder : folders) {
-            mMediaDirsLocation.add(folder.startsWith("file://") ? folder.substring(7) : folder);
+            mMediaDirsLocation.add(Uri.decode(folder.startsWith("file://") ? folder.substring(7) : folder));
         }
         mCustomDirsLocation = new ArrayList<>(Arrays.asList(CustomDirectories.getCustomDirectories()));
     }



More information about the Android mailing list