Make setFullscreenButtonState UnstableApi

This commit is contained in:
oceanjules 2024-09-10 19:44:02 +01:00
parent 9b75523fd9
commit 25bb8e411b
3 changed files with 10 additions and 12 deletions

View File

@ -50,10 +50,9 @@
[#1594](https://github.com/androidx/media/issues/1594)). [#1594](https://github.com/androidx/media/issues/1594)).
* Add `setFullscreenButtonState` to `PlayerView` to allow updates of * Add `setFullscreenButtonState` to `PlayerView` to allow updates of
fullscreen button's icon on demand, i.e. out-of-band and not reactively fullscreen button's icon on demand, i.e. out-of-band and not reactively
to a click interaction. to a click interaction
([#1590](https://github.com/androidx/media/issues/1590), ([#1590](https://github.com/androidx/media/issues/1590),
[#184](https://github.com/androidx/media/issues/184), [#184](https://github.com/androidx/media/issues/184)).
[#10391](https://github.com/google/ExoPlayer/issues/10391))
* Downloads: * Downloads:
* OkHttp Extension: * OkHttp Extension:
* Cronet Extension: * Cronet Extension:

View File

@ -1582,16 +1582,14 @@ public class PlayerControlView extends FrameLayout {
* Updates whether the controller is in fullscreen, changing its fullscreen icon and reports it to * Updates whether the controller is in fullscreen, changing its fullscreen icon and reports it to
* to the listener. * to the listener.
* *
* <p>For {@code isFullscreen} equals {@code true} the icon will be set to {@link * <p>For {@code isFullscreen} equals {@code true} the icon will be set to
* R.drawable#exo_styled_controls_fullscreen_exit} or else {@link * {@code @drawable/exo_styled_controls_fullscreen_exit} or else
* R.drawable#exo_styled_controls_fullscreen_enter}. * {@code @drawable/exo_styled_controls_fullscreen_enter}.
* *
* @param isFullscreen If the view is in full screen. * @param isFullscreen If the view is in full screen.
*/ */
public void updateIsFullscreen(boolean isFullscreen) { public void updateIsFullscreen(boolean isFullscreen) {
boolean fullscreenModeChanged = this.isFullScreen != isFullscreen; if (this.isFullScreen == isFullscreen) {
if (!fullscreenModeChanged) {
return; return;
} }

View File

@ -1142,12 +1142,13 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
/** /**
* Sets whether the player is currently in fullscreen, this will change the displayed icon. * Sets whether the player is currently in fullscreen, this will change the displayed icon.
* *
* <p>If {@code isFullscreen} is {@code true}, {@link * <p>If {@code isFullscreen} is {@code true},
* R.drawable#exo_styled_controls_fullscreen_exit} will be displayed or else {@link * {@code @drawable/exo_styled_controls_fullscreen_exit} will be displayed or else
* R.drawable#exo_styled_controls_fullscreen_enter}. * {@code @drawable/exo_styled_controls_fullscreen_enter}.
* *
* @param isFullscreen Whether the player is currently in fullscreen. * @param isFullscreen Whether the player is currently in fullscreen.
*/ */
@UnstableApi
public void setFullscreenButtonState(boolean isFullscreen) { public void setFullscreenButtonState(boolean isFullscreen) {
Assertions.checkStateNotNull(controller); Assertions.checkStateNotNull(controller);
controller.updateIsFullscreen(isFullscreen); controller.updateIsFullscreen(isFullscreen);