From fbb5f28737804d93955771b29d10f76b4fb4128e Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 6 Jan 2018 13:31:26 +0100 Subject: [PATCH] Allow to touch space next to video player --- .../de/danoeh/antennapod/activity/VideoplayerActivity.java | 5 +++-- app/src/main/res/layout/videoplayer_activity.xml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index bf1cc5b7e..f01a63e37 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -144,7 +144,8 @@ public class VideoplayerActivity extends MediaplayerActivity { videoview = (AspectRatioVideoView) findViewById(R.id.videoview); progressIndicator = (ProgressBar) findViewById(R.id.progressIndicator); videoview.getHolder().addCallback(surfaceHolderCallback); - videoview.setOnTouchListener(onVideoviewTouched); + findViewById(R.id.videoframe).setOnTouchListener(onVideoviewTouched); + videoOverlay.setOnTouchListener((view, motionEvent) -> true); // To suppress touches directly below the slider if (Build.VERSION.SDK_INT >= 16) { videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); @@ -181,7 +182,7 @@ public class VideoplayerActivity extends MediaplayerActivity { progressIndicator.setVisibility(View.INVISIBLE); } - View.OnTouchListener onVideoviewTouched = (v, event) -> { + private View.OnTouchListener onVideoviewTouched = (v, event) -> { if (event.getAction() == MotionEvent.ACTION_DOWN) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && isInPictureInPictureMode()) { diff --git a/app/src/main/res/layout/videoplayer_activity.xml b/app/src/main/res/layout/videoplayer_activity.xml index 4db663e19..2d0b0cf56 100644 --- a/app/src/main/res/layout/videoplayer_activity.xml +++ b/app/src/main/res/layout/videoplayer_activity.xml @@ -3,7 +3,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" - android:orientation="vertical"> + android:orientation="vertical" + android:id="@+id/videoframe">