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)).
* Add `setFullscreenButtonState` to `PlayerView` to allow updates of
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),
[#184](https://github.com/androidx/media/issues/184),
[#10391](https://github.com/google/ExoPlayer/issues/10391))
[#184](https://github.com/androidx/media/issues/184)).
* Downloads:
* OkHttp 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
* to the listener.
*
* <p>For {@code isFullscreen} equals {@code true} the icon will be set to {@link
* R.drawable#exo_styled_controls_fullscreen_exit} or else {@link
* R.drawable#exo_styled_controls_fullscreen_enter}.
* <p>For {@code isFullscreen} equals {@code true} the icon will be set to
* {@code @drawable/exo_styled_controls_fullscreen_exit} or else
* {@code @drawable/exo_styled_controls_fullscreen_enter}.
*
* @param isFullscreen If the view is in full screen.
*/
public void updateIsFullscreen(boolean isFullscreen) {
boolean fullscreenModeChanged = this.isFullScreen != isFullscreen;
if (!fullscreenModeChanged) {
if (this.isFullScreen == isFullscreen) {
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.
*
* <p>If {@code isFullscreen} is {@code true}, {@link
* R.drawable#exo_styled_controls_fullscreen_exit} will be displayed or else {@link
* R.drawable#exo_styled_controls_fullscreen_enter}.
* <p>If {@code isFullscreen} is {@code true},
* {@code @drawable/exo_styled_controls_fullscreen_exit} will be displayed or else
* {@code @drawable/exo_styled_controls_fullscreen_enter}.
*
* @param isFullscreen Whether the player is currently in fullscreen.
*/
@UnstableApi
public void setFullscreenButtonState(boolean isFullscreen) {
Assertions.checkStateNotNull(controller);
controller.updateIsFullscreen(isFullscreen);