diff --git a/demos/cast/src/main/java/androidx/media3/demo/cast/MainActivity.java b/demos/cast/src/main/java/androidx/media3/demo/cast/MainActivity.java index 7d0e3cd387..d6aec8c4a1 100644 --- a/demos/cast/src/main/java/androidx/media3/demo/cast/MainActivity.java +++ b/demos/cast/src/main/java/androidx/media3/demo/cast/MainActivity.java @@ -36,7 +36,7 @@ import androidx.media3.common.MediaItem; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.Util; import androidx.media3.exoplayer.ExoPlayer; -import androidx.media3.ui.StyledPlayerView; +import androidx.media3.ui.PlayerView; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -52,7 +52,7 @@ import com.google.android.gms.dynamite.DynamiteModule; public class MainActivity extends AppCompatActivity implements OnClickListener, PlayerManager.Listener { - private StyledPlayerView playerView; + private PlayerView playerView; private PlayerManager playerManager; private RecyclerView mediaQueueList; private MediaQueueListAdapter mediaQueueListAdapter; diff --git a/demos/cast/src/main/java/androidx/media3/demo/cast/PlayerManager.java b/demos/cast/src/main/java/androidx/media3/demo/cast/PlayerManager.java index d9660807bb..c59ad55139 100644 --- a/demos/cast/src/main/java/androidx/media3/demo/cast/PlayerManager.java +++ b/demos/cast/src/main/java/androidx/media3/demo/cast/PlayerManager.java @@ -28,8 +28,8 @@ import androidx.media3.common.Player.TimelineChangeReason; import androidx.media3.common.Timeline; import androidx.media3.common.TracksInfo; import androidx.media3.exoplayer.ExoPlayer; -import androidx.media3.ui.StyledPlayerControlView; -import androidx.media3.ui.StyledPlayerView; +import androidx.media3.ui.PlayerControlView; +import androidx.media3.ui.PlayerView; import com.google.android.gms.cast.framework.CastContext; import java.util.ArrayList; @@ -51,7 +51,7 @@ import java.util.ArrayList; } private final Context context; - private final StyledPlayerView playerView; + private final PlayerView playerView; private final Player localPlayer; private final CastPlayer castPlayer; private final ArrayList mediaQueue; @@ -66,11 +66,11 @@ import java.util.ArrayList; * * @param context A {@link Context}. * @param listener A {@link Listener} for queue position changes. - * @param playerView The {@link StyledPlayerView} for playback. + * @param playerView The {@link PlayerView} for playback. * @param castContext The {@link CastContext}. */ public PlayerManager( - Context context, Listener listener, StyledPlayerView playerView, CastContext castContext) { + Context context, Listener listener, PlayerView playerView, CastContext castContext) { this.context = context; this.listener = listener; this.playerView = playerView; @@ -270,7 +270,7 @@ import java.util.ArrayList; R.drawable.ic_baseline_cast_connected_400, /* theme= */ null)); } else { // currentPlayer == localPlayer - playerView.setControllerShowTimeoutMs(StyledPlayerControlView.DEFAULT_SHOW_TIMEOUT_MS); + playerView.setControllerShowTimeoutMs(PlayerControlView.DEFAULT_SHOW_TIMEOUT_MS); playerView.setDefaultArtwork(null); } diff --git a/demos/cast/src/main/res/layout/main_activity.xml b/demos/cast/src/main/res/layout/main_activity.xml index 86b6abe7b3..81320bb75b 100644 --- a/demos/cast/src/main/res/layout/main_activity.xml +++ b/demos/cast/src/main/res/layout/main_activity.xml @@ -20,7 +20,7 @@ android:layout_height="match_parent" android:keepScreenOn="true"> - - - = mutableListOf() diff --git a/demos/session/src/main/res/layout/activity_player.xml b/demos/session/src/main/res/layout/activity_player.xml index e1246c50cf..0caff0b445 100644 --- a/demos/session/src/main/res/layout/activity_player.xml +++ b/demos/session/src/main/res/layout/activity_player.xml @@ -26,7 +26,7 @@ android:layout_height="300dp" android:layout_width="match_parent" > - (android.content.Context); diff --git a/libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerControlView.java b/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java similarity index 98% rename from libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerControlView.java rename to libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java index dbc5a75e82..65a07b6eb5 100644 --- a/libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerControlView.java +++ b/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java @@ -158,7 +158,7 @@ import java.util.concurrent.CopyOnWriteArrayList; * below for more details. *
    *
  • Corresponding method: None - *
  • Default: {@code R.layout.exo_styled_player_control_view} + *
  • Default: {@code R.layout.exo_player_control_view} *
*
  • All attributes that can be set on {@link DefaultTimeBar} can also be set on a * StyledPlayerControlView, and will be propagated to the inflated {@link DefaultTimeBar} @@ -193,7 +193,7 @@ import java.util.concurrent.CopyOnWriteArrayList; *

    Overriding the layout file

    * * To customize the layout of StyledPlayerControlView throughout your app, or just for certain - * configurations, you can define {@code exo_styled_player_control_view.xml} layout files in your + * configurations, you can define {@code exo_player_control_view.xml} layout files in your * application {@code res/layout*} directories. But, in this case, you need to be careful since the * default animation implementation expects certain relative positions between children. See also Specifying a custom layout file. @@ -297,18 +297,18 @@ import java.util.concurrent.CopyOnWriteArrayList; * *

    Specifying a custom layout file

    * - * Defining your own {@code exo_styled_player_control_view.xml} is useful to customize the layout of + * Defining your own {@code exo_player_control_view.xml} is useful to customize the layout of * StyledPlayerControlView throughout your application. It's also possible to customize the layout * for a single instance in a layout file. This is achieved by setting the {@code * controller_layout_id} attribute on a StyledPlayerControlView. This will cause the specified - * layout to be inflated instead of {@code exo_styled_player_control_view.xml} for only the instance - * on which the attribute is set. + * layout to be inflated instead of {@code exo_player_control_view.xml} for only the instance on + * which the attribute is set. * *

    You need to be careful when you set the {@code controller_layout_id}, because the default * animation implementation expects certain relative positions between children. */ @UnstableApi -public class StyledPlayerControlView extends FrameLayout { +public class PlayerControlView extends FrameLayout { static { MediaLibraryInfo.registerModule("media3.ui"); @@ -426,7 +426,7 @@ public class StyledPlayerControlView extends FrameLayout { private boolean[] extraPlayedAdGroups; private long currentWindowOffset; - private StyledPlayerControlViewLayoutManager controlViewLayoutManager; + private PlayerControlViewLayoutManager controlViewLayoutManager; private Resources resources; private RecyclerView settingsView; @@ -448,15 +448,15 @@ public class StyledPlayerControlView extends FrameLayout { @Nullable private View playbackSpeedButton; @Nullable private View audioTrackButton; - public StyledPlayerControlView(Context context) { + public PlayerControlView(Context context) { this(context, /* attrs= */ null); } - public StyledPlayerControlView(Context context, @Nullable AttributeSet attrs) { + public PlayerControlView(Context context, @Nullable AttributeSet attrs) { this(context, attrs, /* defStyleAttr= */ 0); } - public StyledPlayerControlView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + public PlayerControlView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { this(context, attrs, defStyleAttr, attrs); } @@ -466,13 +466,13 @@ public class StyledPlayerControlView extends FrameLayout { "nullness:method.invocation", "nullness:methodref.receiver.bound" }) - public StyledPlayerControlView( + public PlayerControlView( Context context, @Nullable AttributeSet attrs, int defStyleAttr, @Nullable AttributeSet playbackAttrs) { super(context, attrs, defStyleAttr); - int controllerLayoutId = R.layout.exo_styled_player_control_view; + int controllerLayoutId = R.layout.exo_player_control_view; showTimeoutMs = DEFAULT_SHOW_TIMEOUT_MS; repeatToggleModes = DEFAULT_REPEAT_TOGGLE_MODES; timeBarMinUpdateIntervalMs = DEFAULT_TIME_BAR_MIN_UPDATE_INTERVAL_MS; @@ -646,7 +646,7 @@ public class StyledPlayerControlView extends FrameLayout { updateButton(/* enabled= */ false, vrButton); } - controlViewLayoutManager = new StyledPlayerControlViewLayoutManager(this); + controlViewLayoutManager = new PlayerControlViewLayoutManager(this); controlViewLayoutManager.setAnimationEnabled(animationEnabled); String[] settingTexts = new String[2]; @@ -1767,7 +1767,7 @@ public class StyledPlayerControlView extends FrameLayout { @Override public void onClick(View view) { - @Nullable Player player = StyledPlayerControlView.this.player; + @Nullable Player player = PlayerControlView.this.player; if (player == null) { return; } diff --git a/libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerControlViewLayoutManager.java b/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlViewLayoutManager.java similarity index 99% rename from libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerControlViewLayoutManager.java rename to libraries/ui/src/main/java/androidx/media3/ui/PlayerControlViewLayoutManager.java index b08d58a1a7..2bee086110 100644 --- a/libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerControlViewLayoutManager.java +++ b/libraries/ui/src/main/java/androidx/media3/ui/PlayerControlViewLayoutManager.java @@ -31,7 +31,7 @@ import androidx.annotation.Nullable; import java.util.ArrayList; import java.util.List; -/* package */ final class StyledPlayerControlViewLayoutManager { +/* package */ final class PlayerControlViewLayoutManager { private static final long ANIMATION_INTERVAL_MS = 2_000; private static final long DURATION_FOR_HIDING_ANIMATION_MS = 250; private static final long DURATION_FOR_SHOWING_ANIMATION_MS = 250; @@ -48,7 +48,7 @@ import java.util.List; // Int for defining the UX state where the views are being animated to be shown. private static final int UX_STATE_ANIMATING_SHOW = 4; - private final StyledPlayerControlView playerControlView; + private final PlayerControlView playerControlView; @Nullable private final View controlsBackground; @Nullable private final ViewGroup centerControls; @@ -84,7 +84,7 @@ import java.util.List; private boolean animationEnabled; @SuppressWarnings({"nullness:method.invocation", "nullness:methodref.receiver.bound"}) - public StyledPlayerControlViewLayoutManager(StyledPlayerControlView playerControlView) { + public PlayerControlViewLayoutManager(PlayerControlView playerControlView) { this.playerControlView = playerControlView; showAllBarsRunnable = this::showAllBars; hideAllBarsRunnable = this::hideAllBars; diff --git a/libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerView.java b/libraries/ui/src/main/java/androidx/media3/ui/PlayerView.java similarity index 90% rename from libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerView.java rename to libraries/ui/src/main/java/androidx/media3/ui/PlayerView.java index 46d8558de7..e9c104f8de 100644 --- a/libraries/ui/src/main/java/androidx/media3/ui/StyledPlayerView.java +++ b/libraries/ui/src/main/java/androidx/media3/ui/PlayerView.java @@ -75,15 +75,15 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; /** * A high level view for {@link Player} media playbacks. It displays video, subtitles and album art - * during playback, and displays playback controls using a {@link StyledPlayerControlView}. + * during playback, and displays playback controls using a {@link PlayerControlView}. * - *

    A StyledPlayerView can be customized by setting attributes (or calling corresponding methods), + *

    A PlayerView can be customized by setting attributes (or calling corresponding methods), * overriding drawables, overriding the view's layout file, or by specifying a custom view layout * file. * *

    Attributes

    * - * The following attributes can be set on a StyledPlayerView when used in a layout XML file: + * The following attributes can be set on a PlayerView when used in a layout XML file: * *
      *
    • {@code use_artwork} - Whether artwork is used if available in audio streams. @@ -159,33 +159,33 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; * for more details. *
        *
      • Corresponding method: None - *
      • Default: {@code R.layout.exo_styled_player_view} + *
      • Default: {@code R.layout.exo_player_view} *
      *
    • {@code controller_layout_id} - Specifies the id of the layout resource to be - * inflated by the child {@link StyledPlayerControlView}. See below for more details. + * inflated by the child {@link PlayerControlView}. See below for more details. *
        *
      • Corresponding method: None - *
      • Default: {@code R.layout.exo_styled_player_control_view} + *
      • Default: {@code R.layout.exo_player_control_view} *
      - *
    • All attributes that can be set on {@link StyledPlayerControlView} and {@link - * DefaultTimeBar} can also be set on a StyledPlayerView, and will be propagated to the - * inflated {@link StyledPlayerControlView} unless the layout is overridden to specify a - * custom {@code exo_controller} (see below). + *
    • All attributes that can be set on {@link PlayerControlView} and {@link DefaultTimeBar} can + * also be set on a PlayerView, and will be propagated to the inflated {@link + * PlayerControlView} unless the layout is overridden to specify a custom {@code + * exo_controller} (see below). *
    * *

    Overriding drawables

    * - * The drawables used by {@link StyledPlayerControlView} (with its default layout file) can be - * overridden by drawables with the same names defined in your application. See the {@link - * StyledPlayerControlView} documentation for a list of drawables that can be overridden. + * The drawables used by {@link PlayerControlView} (with its default layout file) can be overridden + * by drawables with the same names defined in your application. See the {@link PlayerControlView} + * documentation for a list of drawables that can be overridden. * *

    Overriding the layout file

    * - * To customize the layout of StyledPlayerView throughout your app, or just for certain - * configurations, you can define {@code exo_styled_player_view.xml} layout files in your - * application {@code res/layout*} directories. These layouts will override the one provided by the - * library, and will be inflated for use by StyledPlayerView. The view identifies and binds its - * children by looking for the following ids: + * To customize the layout of PlayerView throughout your app, or just for certain configurations, + * you can define {@code exo_player_view.xml} layout files in your application {@code res/layout*} + * directories. These layouts will override the one provided by the library, and will be inflated + * for use by PlayerView. The view identifies and binds its children by looking for the following + * ids: * *
      *
    • {@code exo_content_frame} - A frame whose aspect ratio is resized based on the video @@ -219,17 +219,17 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; *
    • Type: {@link TextView} *
    *
  • {@code exo_controller_placeholder} - A placeholder that's replaced with the inflated - * {@link StyledPlayerControlView}. Ignored if an {@code exo_controller} view exists. + * {@link PlayerControlView}. Ignored if an {@code exo_controller} view exists. *
      *
    • Type: {@link View} *
    - *
  • {@code exo_controller} - An already inflated {@link StyledPlayerControlView}. Allows - * use of a custom extension of {@link StyledPlayerControlView}. {@link - * StyledPlayerControlView} and {@link DefaultTimeBar} attributes set on the StyledPlayerView - * will not be automatically propagated through to this instance. If a view exists with this - * id, any {@code exo_controller_placeholder} view will be ignored. + *
  • {@code exo_controller} - An already inflated {@link PlayerControlView}. Allows use + * of a custom extension of {@link PlayerControlView}. {@link PlayerControlView} and {@link + * DefaultTimeBar} attributes set on the PlayerView will not be automatically propagated + * through to this instance. If a view exists with this id, any {@code + * exo_controller_placeholder} view will be ignored. *
      - *
    • Type: {@link StyledPlayerControlView} + *
    • Type: {@link PlayerControlView} *
    *
  • {@code exo_ad_overlay} - A {@link FrameLayout} positioned on top of the player which * is used to show ad UI (if applicable). @@ -248,14 +248,14 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; * *

    Specifying a custom layout file

    * - * Defining your own {@code exo_styled_player_view.xml} is useful to customize the layout of - * StyledPlayerView throughout your application. It's also possible to customize the layout for a - * single instance in a layout file. This is achieved by setting the {@code player_layout_id} - * attribute on a StyledPlayerView. This will cause the specified layout to be inflated instead of - * {@code exo_styled_player_view.xml} for only the instance on which the attribute is set. + * Defining your own {@code exo_player_view.xml} is useful to customize the layout of PlayerView + * throughout your application. It's also possible to customize the layout for a single instance in + * a layout file. This is achieved by setting the {@code player_layout_id} attribute on a + * PlayerView. This will cause the specified layout to be inflated instead of {@code + * exo_player_view.xml} for only the instance on which the attribute is set. */ @UnstableApi -public class StyledPlayerView extends FrameLayout implements AdViewProvider { +public class PlayerView extends FrameLayout implements AdViewProvider { /** * Determines when the buffering view is shown. One of {@link #SHOW_BUFFERING_NEVER}, {@link @@ -293,13 +293,13 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { @Nullable private final SubtitleView subtitleView; @Nullable private final View bufferingView; @Nullable private final TextView errorMessageView; - @Nullable private final StyledPlayerControlView controller; + @Nullable private final PlayerControlView controller; @Nullable private final FrameLayout adOverlayFrameLayout; @Nullable private final FrameLayout overlayFrameLayout; @Nullable private Player player; private boolean useController; - @Nullable private StyledPlayerControlView.VisibilityListener controllerVisibilityListener; + @Nullable private PlayerControlView.VisibilityListener controllerVisibilityListener; private boolean useArtwork; @Nullable private Drawable defaultArtwork; private @ShowBuffering int showBuffering; @@ -315,16 +315,16 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { private static final int PICTURE_TYPE_FRONT_COVER = 3; private static final int PICTURE_TYPE_NOT_SET = -1; - public StyledPlayerView(Context context) { + public PlayerView(Context context) { this(context, /* attrs= */ null); } - public StyledPlayerView(Context context, @Nullable AttributeSet attrs) { + public PlayerView(Context context, @Nullable AttributeSet attrs) { this(context, attrs, /* defStyleAttr= */ 0); } @SuppressWarnings({"nullness:argument", "nullness:method.invocation"}) - public StyledPlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + public PlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); componentListener = new ComponentListener(); @@ -353,13 +353,13 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { boolean shutterColorSet = false; int shutterColor = 0; - int playerLayoutId = R.layout.exo_styled_player_view; + int playerLayoutId = R.layout.exo_player_view; boolean useArtwork = true; int defaultArtworkId = 0; boolean useController = true; int surfaceType = SURFACE_TYPE_SURFACE_VIEW; int resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT; - int controllerShowTimeoutMs = StyledPlayerControlView.DEFAULT_SHOW_TIMEOUT_MS; + int controllerShowTimeoutMs = PlayerControlView.DEFAULT_SHOW_TIMEOUT_MS; boolean controllerHideOnTouch = true; boolean controllerAutoShow = true; boolean controllerHideDuringAds = true; @@ -369,32 +369,28 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { context .getTheme() .obtainStyledAttributes( - attrs, R.styleable.StyledPlayerView, defStyleAttr, /* defStyleRes= */ 0); + attrs, R.styleable.PlayerView, defStyleAttr, /* defStyleRes= */ 0); try { - shutterColorSet = a.hasValue(R.styleable.StyledPlayerView_shutter_background_color); - shutterColor = - a.getColor(R.styleable.StyledPlayerView_shutter_background_color, shutterColor); - playerLayoutId = - a.getResourceId(R.styleable.StyledPlayerView_player_layout_id, playerLayoutId); - useArtwork = a.getBoolean(R.styleable.StyledPlayerView_use_artwork, useArtwork); + shutterColorSet = a.hasValue(R.styleable.PlayerView_shutter_background_color); + shutterColor = a.getColor(R.styleable.PlayerView_shutter_background_color, shutterColor); + playerLayoutId = a.getResourceId(R.styleable.PlayerView_player_layout_id, playerLayoutId); + useArtwork = a.getBoolean(R.styleable.PlayerView_use_artwork, useArtwork); defaultArtworkId = - a.getResourceId(R.styleable.StyledPlayerView_default_artwork, defaultArtworkId); - useController = a.getBoolean(R.styleable.StyledPlayerView_use_controller, useController); - surfaceType = a.getInt(R.styleable.StyledPlayerView_surface_type, surfaceType); - resizeMode = a.getInt(R.styleable.StyledPlayerView_resize_mode, resizeMode); + a.getResourceId(R.styleable.PlayerView_default_artwork, defaultArtworkId); + useController = a.getBoolean(R.styleable.PlayerView_use_controller, useController); + surfaceType = a.getInt(R.styleable.PlayerView_surface_type, surfaceType); + resizeMode = a.getInt(R.styleable.PlayerView_resize_mode, resizeMode); controllerShowTimeoutMs = - a.getInt(R.styleable.StyledPlayerView_show_timeout, controllerShowTimeoutMs); + a.getInt(R.styleable.PlayerView_show_timeout, controllerShowTimeoutMs); controllerHideOnTouch = - a.getBoolean(R.styleable.StyledPlayerView_hide_on_touch, controllerHideOnTouch); - controllerAutoShow = - a.getBoolean(R.styleable.StyledPlayerView_auto_show, controllerAutoShow); - showBuffering = a.getInteger(R.styleable.StyledPlayerView_show_buffering, showBuffering); + a.getBoolean(R.styleable.PlayerView_hide_on_touch, controllerHideOnTouch); + controllerAutoShow = a.getBoolean(R.styleable.PlayerView_auto_show, controllerAutoShow); + showBuffering = a.getInteger(R.styleable.PlayerView_show_buffering, showBuffering); keepContentOnPlayerReset = a.getBoolean( - R.styleable.StyledPlayerView_keep_content_on_player_reset, - keepContentOnPlayerReset); + R.styleable.PlayerView_keep_content_on_player_reset, keepContentOnPlayerReset); controllerHideDuringAds = - a.getBoolean(R.styleable.StyledPlayerView_hide_during_ads, controllerHideDuringAds); + a.getBoolean(R.styleable.PlayerView_hide_during_ads, controllerHideDuringAds); } finally { a.recycle(); } @@ -451,9 +447,9 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { break; } surfaceView.setLayoutParams(params); - // We don't want surfaceView to be clickable separately to the StyledPlayerView itself, but we + // We don't want surfaceView to be clickable separately to the PlayerView itself, but we // do want to register as an OnClickListener so that surfaceView implementations can propagate - // click events up to the StyledPlayerView by calling their own performClick method. + // click events up to the PlayerView by calling their own performClick method. surfaceView.setOnClickListener(componentListener); surfaceView.setClickable(false); contentFrame.addView(surfaceView, 0); @@ -496,14 +492,14 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { } // Playback control view. - StyledPlayerControlView customController = findViewById(R.id.exo_controller); + PlayerControlView customController = findViewById(R.id.exo_controller); View controllerPlaceholder = findViewById(R.id.exo_controller_placeholder); if (customController != null) { this.controller = customController; } else if (controllerPlaceholder != null) { // Propagate attrs as playbackAttrs so that StyledPlayerControlView's custom attributes are // transferred, but standard attributes (e.g. background) are not. - this.controller = new StyledPlayerControlView(context, null, 0, attrs); + this.controller = new PlayerControlView(context, null, 0, attrs); controller.setId(R.id.exo_controller); controller.setLayoutParams(controllerPlaceholder.getLayoutParams()); ViewGroup parent = ((ViewGroup) controllerPlaceholder.getParent()); @@ -533,9 +529,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { * @param newPlayerView The new view to attach to the player. */ public static void switchTargetView( - Player player, - @Nullable StyledPlayerView oldPlayerView, - @Nullable StyledPlayerView newPlayerView) { + Player player, @Nullable PlayerView oldPlayerView, @Nullable PlayerView newPlayerView) { if (oldPlayerView == newPlayerView) { return; } @@ -561,10 +555,10 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { * Sets the {@link Player} to use. * *

    To transition a {@link Player} from targeting one view to another, it's recommended to use - * {@link #switchTargetView(Player, StyledPlayerView, StyledPlayerView)} rather than this method. - * If you do wish to use this method directly, be sure to attach the player to the new view - * before calling {@code setPlayer(null)} to detach it from the old one. This ordering is - * significantly more efficient and may allow for more seamless transitions. + * {@link #switchTargetView(Player, PlayerView, PlayerView)} rather than this method. If you do + * wish to use this method directly, be sure to attach the player to the new view before + * calling {@code setPlayer(null)} to detach it from the old one. This ordering is significantly + * more efficient and may allow for more seamless transitions. * * @param player The {@link Player} to use, or {@code null} to detach the current player. Only * players which are accessed on the main thread are supported ({@code @@ -913,13 +907,13 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { } /** - * Sets the {@link StyledPlayerControlView.VisibilityListener}. + * Sets the {@link PlayerControlView.VisibilityListener}. * * @param listener The listener to be notified about visibility changes, or null to remove the * current listener. */ public void setControllerVisibilityListener( - @Nullable StyledPlayerControlView.VisibilityListener listener) { + @Nullable PlayerControlView.VisibilityListener listener) { Assertions.checkStateNotNull(controller); if (this.controllerVisibilityListener == listener) { return; @@ -934,13 +928,13 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { } /** - * Sets the {@link StyledPlayerControlView.OnFullScreenModeChangedListener}. + * Sets the {@link PlayerControlView.OnFullScreenModeChangedListener}. * * @param listener The listener to be notified when the fullscreen button is clicked, or null to * remove the current listener and hide the fullscreen button. */ public void setControllerOnFullScreenModeChangedListener( - @Nullable StyledPlayerControlView.OnFullScreenModeChangedListener listener) { + @Nullable PlayerControlView.OnFullScreenModeChangedListener listener) { Assertions.checkStateNotNull(controller); controller.setOnFullScreenModeChangedListener(listener); } @@ -1496,7 +1490,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { implements Player.Listener, OnLayoutChangeListener, OnClickListener, - StyledPlayerControlView.VisibilityListener { + PlayerControlView.VisibilityListener { private final Period period; private @Nullable Object lastPeriodUidWithTracks; @@ -1531,7 +1525,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider { // Suppress the update if transitioning to an unprepared period within the same window. This // is necessary to avoid closing the shutter when such a transition occurs. See: // https://github.com/google/ExoPlayer/issues/5507. - Player player = checkNotNull(StyledPlayerView.this.player); + Player player = checkNotNull(PlayerView.this.player); Timeline timeline = player.getCurrentTimeline(); if (timeline.isEmpty()) { lastPeriodUidWithTracks = null; diff --git a/libraries/ui/src/main/res/layout-v23/exo_styled_player_control_ffwd_button.xml b/libraries/ui/src/main/res/layout-v23/exo_player_control_ffwd_button.xml similarity index 100% rename from libraries/ui/src/main/res/layout-v23/exo_styled_player_control_ffwd_button.xml rename to libraries/ui/src/main/res/layout-v23/exo_player_control_ffwd_button.xml diff --git a/libraries/ui/src/main/res/layout-v23/exo_styled_player_control_rewind_button.xml b/libraries/ui/src/main/res/layout-v23/exo_player_control_rewind_button.xml similarity index 100% rename from libraries/ui/src/main/res/layout-v23/exo_styled_player_control_rewind_button.xml rename to libraries/ui/src/main/res/layout-v23/exo_player_control_rewind_button.xml diff --git a/libraries/ui/src/main/res/layout/exo_styled_player_control_ffwd_button.xml b/libraries/ui/src/main/res/layout/exo_player_control_ffwd_button.xml similarity index 100% rename from libraries/ui/src/main/res/layout/exo_styled_player_control_ffwd_button.xml rename to libraries/ui/src/main/res/layout/exo_player_control_ffwd_button.xml diff --git a/libraries/ui/src/main/res/layout/exo_styled_player_control_rewind_button.xml b/libraries/ui/src/main/res/layout/exo_player_control_rewind_button.xml similarity index 100% rename from libraries/ui/src/main/res/layout/exo_styled_player_control_rewind_button.xml rename to libraries/ui/src/main/res/layout/exo_player_control_rewind_button.xml diff --git a/libraries/ui/src/main/res/layout/exo_styled_player_control_view.xml b/libraries/ui/src/main/res/layout/exo_player_control_view.xml similarity index 97% rename from libraries/ui/src/main/res/layout/exo_styled_player_control_view.xml rename to libraries/ui/src/main/res/layout/exo_player_control_view.xml index a83bb1c72c..0a5ad9a21d 100644 --- a/libraries/ui/src/main/res/layout/exo_styled_player_control_view.xml +++ b/libraries/ui/src/main/res/layout/exo_player_control_view.xml @@ -136,12 +136,12 @@ - + - + diff --git a/libraries/ui/src/main/res/layout/exo_styled_player_view.xml b/libraries/ui/src/main/res/layout/exo_player_view.xml similarity index 100% rename from libraries/ui/src/main/res/layout/exo_styled_player_view.xml rename to libraries/ui/src/main/res/layout/exo_player_view.xml diff --git a/libraries/ui/src/main/res/values/attrs.xml b/libraries/ui/src/main/res/values/attrs.xml index 921f56fc44..9442753966 100644 --- a/libraries/ui/src/main/res/values/attrs.xml +++ b/libraries/ui/src/main/res/values/attrs.xml @@ -24,7 +24,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -105,7 +105,7 @@ - +