[Android] Use same UI for TV and no-TV audio and subtitle delay

Alexandre Perraud git at videolan.org
Thu Jul 9 18:14:21 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Thu Jul  9 17:28:19 2015 +0200| [c42fb0d1d433e4f836a70cffcc6472a9af1c6354] | committer: Geoffrey Métais

Use same UI for TV and no-TV audio and subtitle delay

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

 vlc-android/res/layout/player.xml                  |    2 +
 .../videolan/vlc/gui/dialogs/AdvOptionsDialog.java |   54 ++++++--------------
 .../vlc/gui/video/VideoPlayerActivity.java         |    2 +
 3 files changed, 21 insertions(+), 37 deletions(-)

diff --git a/vlc-android/res/layout/player.xml b/vlc-android/res/layout/player.xml
index 1446670..2b7d37a 100644
--- a/vlc-android/res/layout/player.xml
+++ b/vlc-android/res/layout/player.xml
@@ -105,6 +105,7 @@
             android:layout_alignParentRight="true"
             android:layout_margin="@dimen/default_margin"
             android:src="@drawable/ic_minus_circle"
+            android:focusable="true"
             android:visibility="invisible"/>
         <ImageView
             android:id="@+id/player_delay_plus"
@@ -114,6 +115,7 @@
             android:layout_above="@+id/player_delay_minus"
             android:layout_alignParentRight="true"
             android:src="@drawable/ic_plus_circle"
+            android:focusable="true"
             android:visibility="invisible"/>
 
         <include layout="@layout/player_hud"/>
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index 66ca4aa..f0e1ac4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -46,7 +46,6 @@ import android.widget.Spinner;
 import android.widget.TextView;
 
 import org.videolan.libvlc.MediaPlayer;
-import org.videolan.vlc.BuildConfig;
 import org.videolan.vlc.PlaybackService;
 import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
@@ -259,42 +258,23 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
         if (mDelayController == null && getActivity() instanceof IDelayController)
             mDelayController = (IDelayController) getActivity();
         DialogFragment newFragment = null;
-        if (BuildConfig.tv) {
-            switch (action){
-                case PickTimeFragment.ACTION_AUDIO_DELAY:
-                    newFragment = new AudioDelayDialog();
-                    break;
-                case PickTimeFragment.ACTION_SPU_DELAY:
-                    newFragment = new SubsDelayDialog();
-                    break;
-                case PickTimeFragmentTemp.ACTION_JUMP_TO_TIME:
-                    newFragment = new JumpToTimeDialog();
-                    break;
-                case PickTimeFragmentTemp.ACTION_SLEEP_TIMER:
-                    newFragment = new SleepTimerDialog();
-                    break;
-                default:
-                    return;
-            }
-        } else {
-            switch (action){
-                case PickTimeFragment.ACTION_AUDIO_DELAY:
-                    if (mDelayController != null)
-                        mDelayController.showAudioDelaySetting();
-                    break;
-                case PickTimeFragment.ACTION_SPU_DELAY:
-                    if (mDelayController != null)
-                        mDelayController.showSubsDelaySetting();
-                    break;
-                case PickTimeFragmentTemp.ACTION_JUMP_TO_TIME:
-                    newFragment = new JumpToTimeDialog();
-                    break;
-                case PickTimeFragmentTemp.ACTION_SLEEP_TIMER:
-                    newFragment = new SleepTimerDialog();
-                    break;
-                default:
-                    return;
-            }
+        switch (action){
+            case PickTimeFragment.ACTION_AUDIO_DELAY:
+                if (mDelayController != null)
+                    mDelayController.showAudioDelaySetting();
+                break;
+            case PickTimeFragment.ACTION_SPU_DELAY:
+                if (mDelayController != null)
+                    mDelayController.showSubsDelaySetting();
+                break;
+            case PickTimeFragmentTemp.ACTION_JUMP_TO_TIME:
+                newFragment = new JumpToTimeDialog();
+                break;
+            case PickTimeFragmentTemp.ACTION_SLEEP_TIMER:
+                newFragment = new SleepTimerDialog();
+                break;
+            default:
+                return;
         }
         if (newFragment != null)
             newFragment.show(getActivity().getSupportFragmentManager(), "time");
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 76052dd..373e22c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1066,6 +1066,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         mDelayPlus.setOnTouchListener(new OnRepeatListener(mAudioDelayListener));
         mDelayMinus.setVisibility(View.VISIBLE);
         mDelayPlus.setVisibility(View.VISIBLE);
+        mDelayPlus.requestFocus();
         initDelayInfo();
     }
 
@@ -1096,6 +1097,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         mDelayPlus.setVisibility(View.INVISIBLE);
         mInfo.setVisibility(View.INVISIBLE);
         mInfo.setText("");
+        mPlayPause.requestFocus();
     }
 
     private OnClickListener mAudioDelayListener = new OnClickListener() {



More information about the Android mailing list