[Android] Force DPAD focus on video player hud
Geoffrey Métais
git at videolan.org
Fri Jun 16 16:57:21 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jun 16 16:56:27 2017 +0200| [38d439182629328bb4ec2b9df320f2b98c5c8ec0] | committer: Geoffrey Métais
Force DPAD focus on video player hud
Fixes focus mess
> https://code.videolan.org/videolan/vlc-android/commit/38d439182629328bb4ec2b9df320f2b98c5c8ec0
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
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 0c7662a46..f445257cf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2815,6 +2815,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
private void initOverlay() {
ViewStubCompat vsc = (ViewStubCompat) findViewById(R.id.player_hud_stub);
if (vsc != null) {
+ final boolean seekButtons = mSettings.getBoolean("enable_seek_buttons", false);
vsc.inflate();
mOverlayProgress = findViewById(R.id.progress_overlay);
RelativeLayout.LayoutParams layoutParams =
@@ -2839,7 +2840,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mLock = (ImageView) findViewById(R.id.lock_overlay_button);
mSize = (ImageView) findViewById(R.id.player_overlay_size);
mNavMenu = (ImageView) findViewById(R.id.player_overlay_navmenu);
- if (mSettings.getBoolean("enable_seek_buttons", false))
+ if (seekButtons)
initSeekButton();
mSeekbar = (SeekBar) findViewById(R.id.player_overlay_seekbar);
resetHudLayout();
@@ -2849,6 +2850,16 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
updateNavStatus();
setHudClickListeners();
initPlaylistUi();
+ if (!mService.hasPlaylist() && !seekButtons) {
+ if (rtl) {
+ mAdvOptions.setNextFocusRightId(R.id.player_overlay_play);
+ mTracks.setNextFocusLeftId(R.id.player_overlay_play);
+ } else {
+ mTracks.setNextFocusRightId(R.id.player_overlay_play);
+ mAdvOptions.setNextFocusLeftId(R.id.player_overlay_play);
+
+ }
+ }
}
}
More information about the Android
mailing list