[Android] Fix favs saving not available for network servers

Geoffrey Métais git at videolan.org
Thu Mar 3 19:16:42 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar  3 18:59:46 2016 +0100| [f0c9adafeb51ab62f8f44fda83e570e31c73a933] | committer: Geoffrey Métais

Fix favs saving not available for network servers

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

 .../vlc/gui/tv/browser/BrowserGridFragment.java    |  3 ++-
 .../vlc/gui/tv/browser/SortedBrowserFragment.java  |  3 ++-
 .../vlc/gui/tv/browser/VerticalGridActivity.java   |  6 +++--
 .../gui/tv/browser/interfaces/DetailsFragment.java | 29 ++++++++++++++++++++++
 4 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
index a93778a..add13d4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
@@ -45,6 +45,7 @@ import org.videolan.vlc.gui.tv.MainTvActivity;
 import org.videolan.vlc.gui.tv.MediaItemDetails;
 import org.videolan.vlc.gui.tv.TvUtil;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserActivityInterface;
+import org.videolan.vlc.gui.tv.browser.interfaces.DetailsFragment;
 import org.videolan.vlc.media.MediaWrapper;
 import org.videolan.vlc.util.VLCInstance;
 
@@ -52,7 +53,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
-public class BrowserGridFragment extends GridFragment implements MediaBrowser.EventListener, OnItemViewSelectedListener, OnItemViewClickedListener {
+public class BrowserGridFragment extends GridFragment implements MediaBrowser.EventListener, OnItemViewSelectedListener, OnItemViewClickedListener, DetailsFragment {
 
     private MediaBrowser mMediaBrowser;
     private Uri mUri;
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
index dc906af..a4bf2ca 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
@@ -52,6 +52,7 @@ import org.videolan.vlc.gui.tv.MediaItemDetails;
 import org.videolan.vlc.gui.tv.TvUtil;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserActivityInterface;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserFragmentInterface;
+import org.videolan.vlc.gui.tv.browser.interfaces.DetailsFragment;
 import org.videolan.vlc.interfaces.IVideoBrowser;
 import org.videolan.vlc.media.MediaWrapper;
 import org.videolan.vlc.util.WeakHandler;
@@ -62,7 +63,7 @@ import java.util.Map;
 import java.util.TreeMap;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
-public abstract class SortedBrowserFragment extends BrowseFragment implements BrowserFragmentInterface, OnItemViewSelectedListener, OnItemViewClickedListener, IVideoBrowser {
+public abstract class SortedBrowserFragment extends BrowseFragment implements BrowserFragmentInterface, OnItemViewSelectedListener, OnItemViewClickedListener, IVideoBrowser, DetailsFragment {
 
     public static final String TAG = "VLC/SortedBrowserFragment";
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
index 14ab6b2..fde51c3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/VerticalGridActivity.java
@@ -34,6 +34,7 @@ import org.videolan.vlc.R;
 import org.videolan.vlc.gui.tv.MainTvActivity;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserActivityInterface;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserFragmentInterface;
+import org.videolan.vlc.gui.tv.browser.interfaces.DetailsFragment;
 import org.videolan.vlc.media.MediaLibrary;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@@ -90,8 +91,9 @@ public class VerticalGridActivity extends BaseTvActivity implements BrowserActiv
     }
 
     public boolean onKeyDown(int keyCode, KeyEvent event)  {
-        if (mFragment instanceof SortedBrowserFragment && (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE || keyCode == KeyEvent.KEYCODE_BUTTON_Y || keyCode == KeyEvent.KEYCODE_Y)) {
-            ((SortedBrowserFragment)mFragment).showDetails();
+        if ((mFragment instanceof DetailsFragment)
+                && (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE || keyCode == KeyEvent.KEYCODE_BUTTON_Y || keyCode == KeyEvent.KEYCODE_Y)) {
+            ((DetailsFragment)mFragment).showDetails();
             return true;
         }
         return super.onKeyDown(keyCode, event);
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/interfaces/DetailsFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/interfaces/DetailsFragment.java
new file mode 100644
index 0000000..75eb8a4
--- /dev/null
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/interfaces/DetailsFragment.java
@@ -0,0 +1,29 @@
+/*
+ * ************************************************************************
+ *  MediaFragment.java
+ * *************************************************************************
+ *  Copyright © 2016 VLC authors and VideoLAN
+ *  Author: Geoffrey Métais
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *
+ *  *************************************************************************
+ */
+
+package org.videolan.vlc.gui.tv.browser.interfaces;
+
+public interface DetailsFragment {
+    void showDetails();
+}



More information about the Android mailing list