Commit f3c63e22 by olly Committed by marcbaechinger

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
parent 4fd8e791
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
* Fix measurement of `StyledPlayerView` and `StyledPlayerControlView` when * Fix measurement of `StyledPlayerView` and `StyledPlayerControlView` when
`wrap_content` is used `wrap_content` is used
([#8726](https://github.com/google/ExoPlayer/issues/8726)). ([#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: * Audio:
* Report unexpected discontinuities in * Report unexpected discontinuities in
`AnalyticsListener.onAudioSinkError` `AnalyticsListener.onAudioSinkError`
......
...@@ -587,13 +587,17 @@ import java.util.List; ...@@ -587,13 +587,17 @@ import java.util.List;
- (centerControls != null - (centerControls != null
? (centerControls.getPaddingLeft() + centerControls.getPaddingRight()) ? (centerControls.getPaddingLeft() + centerControls.getPaddingRight())
: 0); : 0);
int centerControlHeight =
getHeightWithMargins(centerControls)
- (centerControls != null
? (centerControls.getPaddingTop() + centerControls.getPaddingBottom())
: 0);
int defaultModeMinimumWidth = int defaultModeMinimumWidth =
Math.max( Math.max(
centerControlWidth, centerControlWidth,
getWidthWithMargins(timeView) + getWidthWithMargins(overflowShowButton)); getWidthWithMargins(timeView) + getWidthWithMargins(overflowShowButton));
int defaultModeMinimumHeight = int defaultModeMinimumHeight = centerControlHeight + (2 * getHeightWithMargins(bottomBar));
getHeightWithMargins(centerControls) + 2 * getHeightWithMargins(bottomBar);
return width <= defaultModeMinimumWidth || height <= defaultModeMinimumHeight; return width <= defaultModeMinimumWidth || height <= defaultModeMinimumHeight;
} }
......
...@@ -130,7 +130,8 @@ ...@@ -130,7 +130,8 @@
android:layout_gravity="center" android:layout_gravity="center"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:gravity="center" 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" <ImageButton android:id="@id/exo_prev"
style="@style/ExoStyledControls.Button.Center.Previous"/> style="@style/ExoStyledControls.Button.Center.Previous"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment