mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00
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:
parent
4fd8e791f6
commit
f3c63e224d
@ -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`
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user