[Android] Secondary Display : add a dual display mode

Alexandre Perraud git at videolan.org
Mon Apr 28 22:40:43 CEST 2014


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Mon Apr 28 17:45:12 2014 +0200| [b8bfca5df5186ad68af43e2f726fe495c6bfaf55] | committer: Jean-Baptiste Kempf

Secondary Display : add a dual display mode

Close #11352

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 vlc-android/res/values/strings.xml                             |    4 +++-
 vlc-android/res/xml/preferences.xml                            |    5 +++++
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java    |    8 ++++++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 69c3323..b69ca2a 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -255,7 +255,9 @@
     <string name="dump_logcat">Dump logcat log</string>
     <string name="dump_logcat_success">Logcat successfully dumped to %1$s!</string>
     <string name="dump_logcat_failure">Failed to dump logcat.</string>
-
+	<string name="enable_dual_display">Dual display mode</string>
+    <string name="enable_dual_display_summary">Disable remote mode when there is a secondary display via HDMI, Chromecast…</string>
+    
     <string-array name="hardware_acceleration_list">
         <item>@string/automatic</item>
         <item>@string/hardware_acceleration_disabled</item>
diff --git a/vlc-android/res/xml/preferences.xml b/vlc-android/res/xml/preferences.xml
index b556118..1904b77 100644
--- a/vlc-android/res/xml/preferences.xml
+++ b/vlc-android/res/xml/preferences.xml
@@ -39,6 +39,11 @@
         <PreferenceScreen android:title="@string/interface_prefs_category" >
             <PreferenceCategory android:title="@string/interface_prefs_category" >
                 <CheckBoxPreference
+                    android:defaultValue="false"
+                    android:key="enable_dual_display"
+                    android:summary="@string/enable_dual_display_summary"
+                    android:title="@string/enable_dual_display" />
+                <CheckBoxPreference
                     android:defaultValue="true"
                     android:key="enable_brightness_gesture"
                     android:summary="@string/enable_brightness_gesture_summary"
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index fa4f125..7d36193 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -166,6 +166,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
     private ImageButton mForward;
     private boolean mEnableJumpButtons;
     private boolean mEnableBrightnessGesture;
+    private boolean mEnableDualDisplay;
     private boolean mDisplayRemainingTime = false;
     private int mScreenOrientation;
     private ImageButton mAudioTrack;
@@ -245,10 +246,13 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
             };
         }
 
+
+        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
+
+        mEnableDualDisplay = pref.getBoolean("enable_dual_display", false);
         createPresentation();
         setContentView(mPresentation == null ? R.layout.player : R.layout.player_remote_control);
 
-        SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
         if (LibVlcUtil.isICSOrLater())
             getWindow().getDecorView().findViewById(android.R.id.content).setOnSystemUiVisibilityChangeListener(
                     new OnSystemUiVisibilityChangeListener() {
@@ -1983,7 +1987,7 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
 
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
     private void createPresentation() {
-        if (mMediaRouter == null)
+        if (mMediaRouter == null || mEnableDualDisplay)
             return;
 
         // Get the current route and its presentation display.



More information about the Android mailing list