mirror of
https://github.com/androidx/media.git
synced 2025-05-07 15:40: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
|
* 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;
|
|||||||
- (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 @@
|
|||||||
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"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user