1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Fix fast seek arc not going under system ui

This commit is contained in:
Stypox 2022-02-19 11:00:05 +01:00
parent a3f99bd781
commit da12b92d75
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -580,11 +580,17 @@ public final class Player implements
v.getPaddingTop(),
v.getPaddingRight(),
v.getPaddingBottom());
binding.fastSeekOverlay.setPadding(
v.getPaddingLeft(),
v.getPaddingTop(),
v.getPaddingRight(),
v.getPaddingBottom());
// If we added padding to the fast seek overlay, too, it would not go under the
// system ui. Instead we apply negative margins equal to the window insets of
// the opposite side, so that the view covers all of the player (overflowing on
// some sides) and its center coincides with the center of other controls.
final RelativeLayout.LayoutParams fastSeekParams = (RelativeLayout.LayoutParams)
binding.fastSeekOverlay.getLayoutParams();
fastSeekParams.leftMargin = -v.getPaddingRight();
fastSeekParams.topMargin = -v.getPaddingBottom();
fastSeekParams.rightMargin = -v.getPaddingLeft();
fastSeekParams.bottomMargin = -v.getPaddingTop();
});
}