Skip to content

Commit da12b92

Browse files
committed
Fix fast seek arc not going under system ui
1 parent a3f99bd commit da12b92

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,17 @@ public void onChange(final boolean selfChange) {
580580
v.getPaddingTop(),
581581
v.getPaddingRight(),
582582
v.getPaddingBottom());
583-
binding.fastSeekOverlay.setPadding(
584-
v.getPaddingLeft(),
585-
v.getPaddingTop(),
586-
v.getPaddingRight(),
587-
v.getPaddingBottom());
583+
584+
// If we added padding to the fast seek overlay, too, it would not go under the
585+
// system ui. Instead we apply negative margins equal to the window insets of
586+
// the opposite side, so that the view covers all of the player (overflowing on
587+
// some sides) and its center coincides with the center of other controls.
588+
final RelativeLayout.LayoutParams fastSeekParams = (RelativeLayout.LayoutParams)
589+
binding.fastSeekOverlay.getLayoutParams();
590+
fastSeekParams.leftMargin = -v.getPaddingRight();
591+
fastSeekParams.topMargin = -v.getPaddingBottom();
592+
fastSeekParams.rightMargin = -v.getPaddingLeft();
593+
fastSeekParams.bottomMargin = -v.getPaddingTop();
588594
});
589595
}
590596

0 commit comments

Comments
 (0)