Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,13 @@ public boolean onScroll(final MotionEvent initialEvent, final MotionEvent moving
return false;
}

final boolean isTouchingStatusBar = initialEvent.getY() < getStatusBarHeight();
final boolean isTouchingNavigationBar = initialEvent.getY()
> playerImpl.getRootView().getHeight() - getNavigationBarHeight();
if (isTouchingStatusBar || isTouchingNavigationBar) {
return false;
}

// if (DEBUG) {
// Log.d(TAG, "MainVideoPlayer.onScroll = " +
// "e1.getRaw = [" + initialEvent.getRawX() + ", "
Expand Down Expand Up @@ -1333,6 +1340,22 @@ public boolean onScroll(final MotionEvent initialEvent, final MotionEvent moving
return true;
}

private int getNavigationBarHeight() {
int resId = getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (resId > 0) {
return getResources().getDimensionPixelSize(resId);
}
return 0;
}

private int getStatusBarHeight() {
int resId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resId > 0) {
return getResources().getDimensionPixelSize(resId);
}
return 0;
}

private void onScrollEnd() {
if (DEBUG) {
Log.d(TAG, "onScrollEnd() called");
Expand Down