Skip to content
Snippets Groups Projects
Commit 608f93fe authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Fix custom directories listing

parent 2ad06bb0
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,8 @@ public class StorageBrowserFragment extends FileBrowserFragment {
@Override
protected void browseRoot() {
String storages[] = mMediaLibrary.getDevices();
String[] storages = mMediaLibrary.getDevices();
String[] customDirectories = CustomDirectories.getCustomDirectories();
Storage storage;
for (String mediaDirLocation : storages) {
if (TextUtils.isEmpty(mediaDirLocation))
......@@ -117,6 +118,14 @@ public class StorageBrowserFragment extends FileBrowserFragment {
storage.setName(getString(R.string.internal_memory));
mAdapter.addItem(storage, false, false);
}
customLoop:
for (String customDir : customDirectories) {
for (String mediaDirLocation : storages)
if (customDir.startsWith(mediaDirLocation))
continue customLoop;
storage = new Storage(Uri.parse(customDir));
mAdapter.addItem(storage, false, false);
}
mHandler.sendEmptyMessage(BrowserFragmentHandler.MSG_HIDE_LOADING);
if (mReadyToDisplay) {
updateEmptyView();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment