diff --git a/app/src/main/java/org/schabi/newpipe/player/VideoPlayerImpl.java b/app/src/main/java/org/schabi/newpipe/player/VideoPlayerImpl.java index f93df4d08..31c401089 100644 --- a/app/src/main/java/org/schabi/newpipe/player/VideoPlayerImpl.java +++ b/app/src/main/java/org/schabi/newpipe/player/VideoPlayerImpl.java @@ -172,6 +172,8 @@ public class VideoPlayerImpl extends VideoPlayer private RecyclerView itemsList; private ItemTouchHelper itemTouchHelper; + private RelativeLayout playerOverlays; + private boolean queueVisible; private MainPlayer.PlayerType playerType = MainPlayer.PlayerType.VIDEO; @@ -305,6 +307,8 @@ public class VideoPlayerImpl extends VideoPlayer this.itemsListCloseButton = view.findViewById(R.id.playQueueClose); this.itemsList = view.findViewById(R.id.playQueue); + this.playerOverlays = view.findViewById(R.id.player_overlays); + closingOverlayView = view.findViewById(R.id.closingOverlay); titleTextView.setSelected(true); @@ -481,6 +485,16 @@ public class VideoPlayerImpl extends VideoPlayer return windowInsets; }); } + + // PlaybackControlRoot already consumed window insets but we should pass them to + // player_overlays too. Without it they will be off-centered + getControlsRoot().addOnLayoutChangeListener((v, left, top, right, bottom, + oldLeft, oldTop, oldRight, oldBottom) -> + playerOverlays.setPadding( + v.getPaddingLeft(), + v.getPaddingTop(), + v.getPaddingRight(), + v.getPaddingBottom())); } public boolean onKeyDown(final int keyCode) { diff --git a/app/src/main/res/layout-large-land/player.xml b/app/src/main/res/layout-large-land/player.xml index 7e27765a0..c3f2e640c 100644 --- a/app/src/main/res/layout-large-land/player.xml +++ b/app/src/main/res/layout-large-land/player.xml @@ -530,117 +530,123 @@ - - - - - - + android:layout_height="match_parent"> - - - - - - - - + + tools:src="@drawable/ic_fast_rewind_white_24dp" + tools:visibility="visible" /> + + + + + + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + tools:ignore="RtlHardcoded"> - - - + android:background="@drawable/background_oval_black_transparent" + android:visibility="gone" + tools:visibility="visible"> + + + + + + + + + + + + + + - - - - - - - + android:layout_height="match_parent"> - - - - - - - - + + tools:src="@drawable/ic_fast_rewind_white_24dp" + tools:visibility="visible" /> + + + + + + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_gravity="center" + tools:ignore="RtlHardcoded"> - - - + android:background="@drawable/background_oval_black_transparent" + android:visibility="gone" + tools:visibility="visible"> + + + + + + + + + + + + + + -