[Android] Revert "Update media directories in DirectoryViewFragment"

Geoffrey Métais git at videolan.org
Thu Mar 26 18:48:58 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 26 18:48:11 2015 +0100| [b423c1882e75f37e4f2a77802fe606ca2b20d464] | committer: Geoffrey Métais

Revert "Update media directories in DirectoryViewFragment"

Media directories are too baldy managed. We leave it for now

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=b423c1882e75f37e4f2a77802fe606ca2b20d464
---

 .../src/org/videolan/vlc/gui/DirectoryViewFragment.java |    7 +------
 .../src/org/videolan/vlc/util/AndroidDevices.java       |    2 +-
 .../src/org/videolan/vlc/util/CustomDirectories.java    |   15 ---------------
 3 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index 3232e8e..5ec2332 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -60,6 +60,7 @@ import android.view.ViewGroup;
 import android.widget.AbsListView;
 import android.widget.AdapterView;
 import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.AdapterView.OnItemLongClickListener;
 import android.widget.ListView;
 
 public class DirectoryViewFragment extends BrowserFragment implements IRefreshable, SwipeRefreshLayout.OnRefreshListener, AdapterView.OnItemClickListener {
@@ -91,12 +92,6 @@ public class DirectoryViewFragment extends BrowserFragment implements IRefreshab
         focusHelper(mDirectoryAdapter.isEmpty());
     }
 
-    @Override
-    public void onResume() {
-        super.onResume();
-        refresh();
-    }
-
     private void focusHelper(boolean idIsEmpty) {
         View parent = View.inflate(getActivity(),
             R.layout.directory_view, null);
diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
index 993e553..003c2e0 100644
--- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
+++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
@@ -142,7 +142,7 @@ public class AndroidDevices {
     public static String[] getMediaDirectories() {
         ArrayList<String> list = new ArrayList<String>();
         list.addAll(getStorageDirectories());
-        list.addAll(CustomDirectories.getActiveCustomDirectories());
+        list.addAll(Arrays.asList(CustomDirectories.getCustomDirectories()));
         return list.toArray(new String[list.size()]);
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/util/CustomDirectories.java b/vlc-android/src/org/videolan/vlc/util/CustomDirectories.java
index 06934d5..1a1ac1b 100644
--- a/vlc-android/src/org/videolan/vlc/util/CustomDirectories.java
+++ b/vlc-android/src/org/videolan/vlc/util/CustomDirectories.java
@@ -20,13 +20,9 @@
 
 package org.videolan.vlc.util;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
 
-import org.videolan.vlc.MediaDatabase;
 import org.videolan.vlc.VLCApplication;
 
 import android.content.SharedPreferences;
@@ -85,15 +81,4 @@ public class CustomDirectories {
             return custom_paths.split(":");
     }
 
-    public static ArrayList<String> getActiveCustomDirectories() {
-        ArrayList<String> activePaths = new ArrayList<String>();
-        final ArrayList<String> customPaths = new ArrayList<String>(Arrays.asList(getCustomDirectories()));
-        List<File> dirs = MediaDatabase.getInstance().getMediaDirs();
-        for (File dir : dirs){
-            if (customPaths.contains(dir.getPath()))
-                activePaths.add(dir.getPath());
-        }
-        return activePaths;
-    }
-
 }



More information about the Android mailing list