[Android] Update discover method

Geoffrey Métais git at videolan.org
Mon Feb 9 11:30:49 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb  4 16:04:30 2015 +0100| [d70d843a880e6414c2ada729540d0c913579fed2] | committer: Geoffrey Métais

Update discover method

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

 .../src/org/videolan/vlc/gui/network/NetworkFragment.java     |    9 +++++++--
 .../org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java  |    7 +++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java b/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java
index 289bd86..c9a1331 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java
@@ -153,7 +153,9 @@ public class NetworkFragment extends BrowserFragment implements IRefreshable, Me
     }
 
     @Override
-    public void onMediaRemoved(int index) {}
+    public void onMediaRemoved(int index, Media media) {
+        //TODO
+    }
 
     @Override
     public void onBrowseEnd() {
@@ -197,7 +199,10 @@ public class NetworkFragment extends BrowserFragment implements IRefreshable, Me
                 mAdapter.addItem("Network favorites", false, true);
             }
         }
-        mMediaBrowser.browse(mMrl);
+        if (mRoot)
+            mMediaBrowser.discoverNetworkShares();
+        else
+            mMediaBrowser.browse(mMrl);
         mHandler.sendEmptyMessageDelayed(NetworkFragmentHandler.MSG_SHOW_LOADING, 300);
     }
 
diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
index 628758e..93a5003 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
@@ -69,7 +69,10 @@ public class BrowserGridFragment extends GridFragment implements MediaBrowser.Ev
                     } catch (LibVlcException e) {}
                 if (mMediaBrowser != null) {
                     mMediaList = new ArrayList<>();
-                    mMediaBrowser.browse(mMrl != null ? mMrl : NetworkFragment.SMB_ROOT);
+                    if (mMrl != null)
+                        mMediaBrowser.browse(mMrl);
+                    else
+                        mMediaBrowser.discoverNetworkShares();
                 }
             }
             setOnItemViewClickedListener(mClickListener);
@@ -89,7 +92,7 @@ public class BrowserGridFragment extends GridFragment implements MediaBrowser.Ev
     }
 
     @Override
-    public void onMediaRemoved(int index) {}
+    public void onMediaRemoved(int index, Media media) {}
 
     @Override
     public void onBrowseEnd() {



More information about the Android mailing list