StyledPlayerView: Fix layout issues

- Take centerControls padding into account to prevent switching to
  minimal mode too soon
- Disable clipping to padding to avoid the edges of controls from
  being clipped as the view gets smaller

Issue: #8763
PiperOrigin-RevId: 366966298
This commit is contained in:
olly 2021-04-06 10:39:51 +01:00 committed by marcbaechinger
parent 4fd8e791f6
commit f3c63e224d
3 changed files with 11 additions and 3 deletions

View File

@ -10,6 +10,9 @@
* Fix measurement of `StyledPlayerView` and `StyledPlayerControlView` when
`wrap_content` is used
([#8726](https://github.com/google/ExoPlayer/issues/8726)).
* Fix `StyledPlayerControlView` to stay in full mode (rather than minimal
mode) when possible
([#8763](https://github.com/google/ExoPlayer/issues/8763)).
* Audio:
* Report unexpected discontinuities in
`AnalyticsListener.onAudioSinkError`

View File

@ -587,13 +587,17 @@ import java.util.List;
- (centerControls != null
? (centerControls.getPaddingLeft() + centerControls.getPaddingRight())
: 0);
int centerControlHeight =
getHeightWithMargins(centerControls)
- (centerControls != null
? (centerControls.getPaddingTop() + centerControls.getPaddingBottom())
: 0);
int defaultModeMinimumWidth =
Math.max(
centerControlWidth,
getWidthWithMargins(timeView) + getWidthWithMargins(overflowShowButton));
int defaultModeMinimumHeight =
getHeightWithMargins(centerControls) + 2 * getHeightWithMargins(bottomBar);
int defaultModeMinimumHeight = centerControlHeight + (2 * getHeightWithMargins(bottomBar));
return width <= defaultModeMinimumWidth || height <= defaultModeMinimumHeight;
}

View File

@ -130,7 +130,8 @@
android:layout_gravity="center"
android:background="@android:color/transparent"
android:gravity="center"
android:padding="@dimen/exo_styled_controls_padding">
android:padding="@dimen/exo_styled_controls_padding"
android:clipToPadding="false">
<ImageButton android:id="@id/exo_prev"
style="@style/ExoStyledControls.Button.Center.Previous"/>