[Android] Set focus to play/pause button by default

Geoffrey Métais git at videolan.org
Tue May 16 15:42:58 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 16 14:53:08 2017 +0200| [5f37e7fff7582d2ce9275ec33abb51b493ea224a] | committer: Geoffrey Métais

Set focus to play/pause button by default

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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 5b2b44f..c933bf4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2771,11 +2771,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         if (mOverlayTimeout != OVERLAY_INFINITE)
             mHandler.sendMessageDelayed(mHandler.obtainMessage(FADE_OUT), mOverlayTimeout);
         updateOverlayPausePlay();
-        if (!(mObjectFocused == null)) {
-            if (mObjectFocused.isFocusable())
-                mObjectFocused.requestFocus();
-            mObjectFocused =  null;
-        }
+        if (mObjectFocused != null)
+            mObjectFocused.requestFocus();
+        else if (getCurrentFocus() == null)
+            mPlayPause.requestFocus();
     }
 
     private void initOverlay() {



More information about the Android mailing list