Skip to content

Commit

Permalink
Fix fast seek overlay arc not correctly centered
Browse files Browse the repository at this point in the history
This happened in fullscreen player: while play-pause, brightness, volume, ... buttons were correctly centered in the app UI, the fast seek overlay was centered in the system UI, causing a mismatch between the two that looked ugly
  • Loading branch information
Stypox authored and TobiGr committed Feb 18, 2022
1 parent 54f0b3d commit 00767f4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,20 @@ public void onChange(final boolean selfChange) {
});

// PlaybackControlRoot already consumed window insets but we should pass them to
// player_overlays too. Without it they will be off-centered
// player_overlays and fast_seek_overlay too. Without it they will be off-centered.
binding.playbackControlRoot.addOnLayoutChangeListener(
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) ->
binding.playerOverlays.setPadding(
v.getPaddingLeft(),
v.getPaddingTop(),
v.getPaddingRight(),
v.getPaddingBottom()));
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
binding.playerOverlays.setPadding(
v.getPaddingLeft(),
v.getPaddingTop(),
v.getPaddingRight(),
v.getPaddingBottom());
binding.fastSeekOverlay.setPadding(
v.getPaddingLeft(),
v.getPaddingTop(),
v.getPaddingRight(),
v.getPaddingBottom());
});
}

/**
Expand Down

0 comments on commit 00767f4

Please sign in to comment.